콘솔 구조 개편 — 시나리오 4분면 선택·상품 정보 섹션·체크 스텝퍼·긴장도 구간 게이지

- 협상 케이스를 4분면(매출 규모×경쟁 강도) 시나리오 A/B/D/C 그리드로 교체
- 상품 정보 섹션 신설: 공급가·인터넷 최저가·공급 유형·거래 기간·응답률/VOC 이동
- 가격 패널 하단(시나리오·최저가·내부기준 문구) 제거
- 협상 진행을 체크 원형 세로 스텝퍼로 교체
- 긴장도를 3구간(낮음·보통·높음) 게이지로, 페르소나를 구간 결과로 묶어 인과 표시
- 차트 첫 제안 점 값 라벨의 좌측 클립 보정

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UFZ7JWdwCaQAwNYJErL8pP
This commit is contained in:
민헌andClaude Fable 5 committed 2026-08-31 14:09:17 +09:00
1 parent 66c0429ea2
commit 2e5fefada7
3 files changed
+125 -65

No files matched your search

+51 -26
View File
@@ -1,5 +1,13 @@
import { DIST_LABEL, type DemoCase } from '../content/cases' import { DIST_LABEL, type DemoCase } from '../content/cases'
// 시나리오 4분면 — 행: 매출 규모(높음/낮음), 열: 경쟁 강도(높음/낮음)
const QUADRANTS = [
{ scenario: 'Scenario_A', letter: 'A', axis: '매출 높음 · 경쟁 높음' },
{ scenario: 'Scenario_B', letter: 'B', axis: '매출 높음 · 경쟁 낮음' },
{ scenario: 'Scenario_D', letter: 'D', axis: '매출 낮음 · 경쟁 높음' },
{ scenario: 'Scenario_C', letter: 'C', axis: '매출 낮음 · 경쟁 낮음' },
]
export function CasePanel({ export function CasePanel({
cases, selected, started, busy, onStart, cases, selected, started, busy, onStart,
}: { }: {
@@ -13,51 +21,68 @@ export function CasePanel({
<aside className="flex flex-col gap-4 min-[960px]:min-h-0 min-[960px]:overflow-y-auto"> <aside className="flex flex-col gap-4 min-[960px]:min-h-0 min-[960px]:overflow-y-auto">
<section className="rounded-box bg-base-100 p-5"> <section className="rounded-box bg-base-100 p-5">
<h2 className="text-xs font-semibold text-base-content/55">협상 케이스</h2> <h2 className="text-xs font-semibold text-base-content/55">협상 케이스</h2>
<ul className="mt-3 flex flex-col gap-1.5"> <div className="mt-3 grid grid-cols-2 gap-2">
{cases.map((c) => { {QUADRANTS.map((q) => {
const c = cases.find((x) => x.scenario === q.scenario)
if (!c) return null
const active = started && c.id === selected.id const active = started && c.id === selected.id
return ( return (
<li key={c.id}>
<button <button
key={q.scenario}
type="button" type="button"
disabled={busy} disabled={busy}
onClick={() => onStart(c)} onClick={() => onStart(c)}
aria-pressed={active} aria-pressed={active}
className={`w-full cursor-pointer rounded-field p-3 text-left transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none ${ className={`cursor-pointer rounded-field p-3 text-left transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none ${
active ? 'bg-primary/8 ring-1 ring-primary/30' : 'hover:bg-base-200' active ? 'bg-primary/8 ring-1 ring-primary/30' : 'bg-base-200/60 hover:bg-base-200'
} ${busy ? 'opacity-60' : ''}`} } ${busy ? 'opacity-60' : ''}`}
> >
<div className="flex items-center justify-between gap-2"> <div className="flex items-baseline gap-1.5">
<span className={`text-sm font-bold ${active ? 'text-primary' : ''}`}>{c.item_name}</span> <span className={`text-lg font-extrabold ${active ? 'text-primary' : ''}`}>{q.letter}</span>
<span className="shrink-0 rounded-full bg-base-200 px-2 py-0.5 text-[10px] font-medium text-base-content/55"> <span className="text-[10px] font-medium text-base-content/45">시나리오</span>
{c.label}
</span>
</div> </div>
<div className="num mt-1 text-xs text-base-content/55"> <p className="mt-0.5 text-[10px] leading-tight text-base-content/50">{q.axis}</p>
기존 공급가 <span className="font-semibold text-base-content/80">{c.item_price.toLocaleString()}원</span> <p className={`mt-1.5 truncate text-xs font-semibold ${active ? 'text-primary' : 'text-base-content/80'}`}>
</div> {c.item_name}
{active && ( </p>
<dl className="mt-2.5 grid grid-cols-2 gap-x-2 gap-y-1 border-t border-primary/15 pt-2.5 text-[11px]">
<dt className="text-base-content/50">공급 유형</dt>
<dd className="text-right font-medium">{DIST_LABEL[c.dist]} · {c.partners_yn}</dd>
<dt className="text-base-content/50">거래 기간</dt>
<dd className="num text-right font-medium">{c.card_data.trading_period}년</dd>
<dt className="text-base-content/50">응답률 / VOC</dt>
<dd className="num text-right font-medium">{c.card_data.response_rate}% / {c.card_data.voc_count}건</dd>
</dl>
)}
</button> </button>
</li>
) )
})} })}
</ul> </div>
{!started && ( {!started && (
<p className="mt-3 text-xs leading-relaxed text-base-content/50"> <p className="mt-3 text-xs leading-relaxed text-base-content/50">
케이스를 선택하면 협상이 시작됩니다. 챗봇은 구매 담당자(MD) 역할이고, 시나리오를 선택하면 협상이 시작됩니다. 챗봇은 구매 담당자(MD) 역할이고,
당신은 공급사로서 가격 제안에 응답합니다. 당신은 공급사로서 가격 제안에 응답합니다.
</p> </p>
)} )}
</section> </section>
<section className="rounded-box bg-base-100 p-5">
<h2 className="text-xs font-semibold text-base-content/55">상품 정보</h2>
<p className="mt-2 text-sm font-bold">{selected.item_name}</p>
<dl className="mt-3 flex flex-col gap-2 text-xs">
<div className="flex items-center justify-between gap-2">
<dt className="text-base-content/50">기존 공급가</dt>
<dd className="num font-semibold">{selected.item_price.toLocaleString()}원</dd>
</div>
<div className="flex items-center justify-between gap-2">
<dt className="text-base-content/50">인터넷 최저가</dt>
<dd className="num font-semibold">{selected.card_data.internet_min_price.toLocaleString()}원</dd>
</div>
<div className="flex items-center justify-between gap-2">
<dt className="text-base-content/50">공급 유형</dt>
<dd className="font-medium">{DIST_LABEL[selected.dist]} · 협력사 {selected.partners_yn}</dd>
</div>
<div className="flex items-center justify-between gap-2">
<dt className="text-base-content/50">거래 기간</dt>
<dd className="num font-medium">{selected.card_data.trading_period}년</dd>
</div>
<div className="flex items-center justify-between gap-2">
<dt className="text-base-content/50">응답률 / VOC</dt>
<dd className="num font-medium">{selected.card_data.response_rate}% / {selected.card_data.voc_count}건</dd>
</div>
</dl>
</section>
</aside> </aside>
) )
} }
+73 -38
View File
@@ -5,6 +5,14 @@ import { PriceChart } from './PriceChart'
const FLOW = ['서비스안내', '담당자확인', '협상품목안내', '가격협상', '협상종료'] const FLOW = ['서비스안내', '담당자확인', '협상품목안내', '가격협상', '협상종료']
// 긴장도 구간 → 응대 페르소나 (엔진 프리셋과 동일한 3구간)
const PERSONA_ZONE: Record<string, number> = {
'우호적 마무리형': 0,
'균형 협상형': 1,
'단호한 압박형': 2,
}
const ZONE_LABELS = ['낮음', '보통', '높음']
function flowIndex(step: string): number { function flowIndex(step: string): number {
if (step.includes('종료') || step.includes('완료') || step.includes('실패')) return 4 if (step.includes('종료') || step.includes('완료') || step.includes('실패')) return 4
if (step.includes('가격') || step.startsWith('wild_')) return 3 if (step.includes('가격') || step.startsWith('wild_')) return 3
@@ -21,6 +29,25 @@ function Panel({ title, children }: { title: string; children: React.ReactNode }
) )
} }
function StepCircle({ state }: { state: 'done' | 'current' | 'todo' }) {
if (state === 'done') {
return (
<span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary">
<svg viewBox="0 0 10 8" className="w-2.5" aria-hidden>
<path d="M1 4l2.5 2.5L9 1" fill="none" stroke="white" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</span>
)
}
return (
<span
className={`size-5 shrink-0 rounded-full border-2 bg-base-100 ${
state === 'current' ? 'border-primary' : 'border-base-300'
}`}
/>
)
}
export function Dashboard({ export function Dashboard({
demoCase, nego, meta, priceTrail, started, finalPrice, demoCase, nego, meta, priceTrail, started, finalPrice,
}: { }: {
@@ -34,6 +61,7 @@ export function Dashboard({
const fi = started ? flowIndex(nego.step) : -1 const fi = started ? flowIndex(nego.step) : -1
const tension = meta?.tension ?? null const tension = meta?.tension ?? null
const indicator = meta?.indicator_value ?? null const indicator = meta?.indicator_value ?? null
const zone = meta?.persona != null ? PERSONA_ZONE[meta.persona] ?? null : null
// 합의가가 마지막 제안가와 다르면(1% 추가 네고 등) 차트 종점으로 잇는다 // 합의가가 마지막 제안가와 다르면(1% 추가 네고 등) 차트 종점으로 잇는다
const series = finalPrice != null && priceTrail[priceTrail.length - 1] !== finalPrice const series = finalPrice != null && priceTrail[priceTrail.length - 1] !== finalPrice
@@ -61,44 +89,39 @@ export function Dashboard({
</span> </span>
)} )}
</div> </div>
<div className="mt-2"> <div className="mt-2">
<PriceChart demoCase={demoCase} priceTrail={series} /> <PriceChart demoCase={demoCase} priceTrail={series} />
</div> </div>
<dl className="mt-2 flex items-center justify-between border-t border-base-300/60 pt-3 text-xs">
<div className="flex items-center gap-1.5">
<dt className="text-base-content/55">시나리오</dt>
<dd className="num font-semibold">{demoCase.scenario.replace('Scenario_', '')}</dd>
</div>
<div className="flex items-center gap-1.5">
<dt className="text-base-content/55">인터넷 최저가</dt>
<dd className="num font-semibold">{demoCase.card_data.internet_min_price.toLocaleString()}원</dd>
</div>
</dl>
<p className="mt-2 text-[11px] leading-relaxed text-base-content/45">
앵커가·목표가는 실제 협상에서 공급사에게 보이지 않는 구매측 내부 기준입니다.
</p>
</Panel> </Panel>
<Panel title="협상 진행"> <Panel title="협상 진행">
<ol className="flex items-center gap-1"> <ol className="flex flex-col">
{FLOW.map((s, i) => ( {FLOW.map((s, i) => {
<li key={s} className="flex flex-1 flex-col items-center gap-1.5"> const state = i < fi ? 'done' : i === fi ? 'current' : 'todo'
<div return (
className={`h-1 w-full rounded-full ${ <li key={s} className="flex gap-3">
i < fi ? 'bg-primary/35' : i === fi ? 'bg-primary' : 'bg-base-200' <div className="flex flex-col items-center">
}`} <StepCircle state={state} />
/> {i < FLOW.length - 1 && (
<div className={`w-0.5 flex-1 ${i < fi ? 'bg-primary' : 'bg-base-200'}`} />
)}
</div>
<span <span
className={`text-[10px] ${i === fi ? 'font-semibold text-base-content' : 'text-base-content/45'}`} className={`pb-4 text-xs leading-5 ${
state === 'current'
? 'font-bold text-primary'
: state === 'done'
? 'font-medium text-base-content/80'
: 'text-base-content/40'
}`}
> >
{s} {s}
</span> </span>
</li> </li>
))} )
})}
</ol> </ol>
<div className="mt-3 flex items-center justify-between text-sm"> <div className="mt-1 flex items-center justify-between border-t border-base-300/60 pt-3 text-sm">
<span className="text-base-content/55">가격 라운드</span> <span className="text-base-content/55">가격 라운드</span>
<span className="num font-semibold">{Math.min(nego.iteration + (nego.initial ? 1 : 0), 5)} / 5</span> <span className="num font-semibold">{Math.min(nego.iteration + (nego.initial ? 1 : 0), 5)} / 5</span>
</div> </div>
@@ -140,25 +163,37 @@ export function Dashboard({
<dt className="text-base-content/55">협상 긴장도</dt> <dt className="text-base-content/55">협상 긴장도</dt>
<dd className="num text-[13px] font-medium">{tension != null ? tension.toFixed(2) : '—'}</dd> <dd className="num text-[13px] font-medium">{tension != null ? tension.toFixed(2) : '—'}</dd>
</div> </div>
<div className="mt-2 h-1.5 rounded-full bg-base-200"> <div className="mt-2 flex gap-1" aria-hidden>
{ZONE_LABELS.map((_, i) => (
<div <div
className="h-full rounded-full bg-warning transition-[width] duration-500 motion-reduce:transition-none" key={i}
style={{ width: `${(tension ?? 0) * 100}%` }} className={`h-1.5 flex-1 rounded-full transition-colors ${
zone === i ? 'bg-warning' : 'bg-base-200'
}`}
/> />
))}
</div> </div>
</div> <div className="mt-1.5 flex text-[10px]" aria-hidden>
{ZONE_LABELS.map((l, i) => (
<div className="flex items-center justify-between gap-2"> <span
<dt className="text-base-content/55">적용 페르소나</dt> key={l}
<dd> className={`flex-1 text-center ${zone === i ? 'font-semibold text-warning' : 'text-base-content/40'}`}
{meta.persona ? ( >
<span className="badge badge-soft badge-warning text-[12px] font-semibold"> {l}
{meta.persona}
</span> </span>
))}
</div>
<div className="mt-2.5 flex items-center justify-between gap-2">
<span className="text-xs text-base-content/55">적용 페르소나</span>
{meta.persona ? (
<span className="badge badge-soft badge-warning text-[12px] font-semibold">{meta.persona}</span>
) : ( ) : (
<span className="text-base-content/45">—</span> <span className="text-base-content/45">—</span>
)} )}
</dd> </div>
<p className="mt-2 text-[11px] leading-relaxed text-base-content/45">
긴장도 구간에 따라 협상 말투(페르소나)가 정해집니다.
</p>
</div> </div>
</dl> </dl>
) : ( ) : (
+1 -1
View File
@@ -118,7 +118,7 @@ export function PriceChart({ demoCase, priceTrail }: { demoCase: DemoCase; price
<text <text
x={last.x} x={last.x}
y={last.y < 26 ? last.y + 18 : last.y - 10} y={last.y < 26 ? last.y + 18 : last.y - 10}
textAnchor={last.x > W - PAD.right - 30 ? 'end' : 'middle'} textAnchor={last.x > W - PAD.right - 30 ? 'end' : last.x < 36 ? 'start' : 'middle'}
fontSize="10.5" fontSize="10.5"
fontWeight="700" fontWeight="700"
fill="var(--color-base-content)" fill="var(--color-base-content)"