데모 콘솔 디자인 개편 — 미니멀 라이트 테마·컴포넌트 라이브러리 도입·제안가 추이 차트

- 연회색 바탕 위 무보더 흰 카드, 단일 파랑 악센트, 숫자 tabular-nums 통일
- 가격 트랙 → 제안가 추이 영역 차트(기준선 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:04:05 +09:00
1 parent 156ce3817d
commit 66c0429ea2
10 files changed
+382 -246

No files matched your search

+70 -36
View File
@@ -1,7 +1,7 @@
import type { ChatMetadata } from '../lib/api'
import type { DemoCase } from '../content/cases'
import type { NegoState } from '../App'
import { PriceTrack } from './PriceTrack'
import { PriceChart } from './PriceChart'
const FLOW = ['서비스안내', '담당자확인', '협상품목안내', '가격협상', '협상종료']
@@ -14,41 +14,69 @@ function flowIndex(step: string): number {
function Panel({ title, children }: { title: string; children: React.ReactNode }) {
return (
<section className="rounded-xl border border-line bg-panel p-4">
<h2 className="text-xs font-semibold uppercase tracking-wider text-muted">{title}</h2>
<section className="rounded-box bg-base-100 p-5">
<h2 className="text-xs font-semibold text-base-content/55">{title}</h2>
<div className="mt-3">{children}</div>
</section>
)
}
export function Dashboard({
demoCase, nego, meta, priceTrail, started,
demoCase, nego, meta, priceTrail, started, finalPrice,
}: {
demoCase: DemoCase
nego: NegoState
meta: ChatMetadata | null
priceTrail: number[]
started: boolean
finalPrice: number | null
}) {
const fi = started ? flowIndex(nego.step) : -1
const tension = meta?.tension ?? null
const indicator = meta?.indicator_value ?? null
// 합의가가 마지막 제안가와 다르면(1% 추가 네고 등) 차트 종점으로 잇는다
const series = finalPrice != null && priceTrail[priceTrail.length - 1] !== finalPrice
? [...priceTrail, finalPrice]
: priceTrail
const current = finalPrice ?? (priceTrail.length ? priceTrail[priceTrail.length - 1] : null)
const priceLabel = finalPrice != null ? '최종 합의가' : current != null ? '현재 제안가' : '기존 공급가'
const priceValue = current ?? demoCase.item_price
const savedPct = current != null && current < demoCase.item_price
? Math.round(((demoCase.item_price - current) / demoCase.item_price) * 1000) / 10
: null
return (
<aside className="flex flex-col gap-3 min-[960px]:min-h-0 min-[960px]:overflow-y-auto">
<Panel title="가격 트랙">
<PriceTrack demoCase={demoCase} priceTrail={priceTrail} />
<dl className="mt-3 flex items-center justify-between border-t border-line pt-2.5 text-xs">
<aside className="flex flex-col gap-4 min-[960px]:min-h-0 min-[960px]:overflow-y-auto">
<Panel title={priceLabel}>
<div className="flex items-baseline gap-2">
<p className="num text-2xl font-bold tracking-tight">
{priceValue.toLocaleString()}
<span className="ml-0.5 text-base font-semibold text-base-content/55">원</span>
</p>
{savedPct != null && (
<span className="num rounded-full bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary">
기존가 대비 −{savedPct}%
</span>
)}
</div>
<div className="mt-2">
<PriceChart demoCase={demoCase} priceTrail={series} />
</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-muted">시나리오</dt>
<dd className="font-mono font-medium">{demoCase.scenario.replace('Scenario_', '')}</dd>
<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-muted">인터넷 최저가</dt>
<dd className="font-mono font-medium">{demoCase.card_data.internet_min_price.toLocaleString()}원</dd>
<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-muted">
<p className="mt-2 text-[11px] leading-relaxed text-base-content/45">
앵커가·목표가는 실제 협상에서 공급사에게 보이지 않는 구매측 내부 기준입니다.
</p>
</Panel>
@@ -58,44 +86,50 @@ export function Dashboard({
{FLOW.map((s, i) => (
<li key={s} className="flex flex-1 flex-col items-center gap-1.5">
<div
className={`h-1.5 w-full rounded-full ${
i < fi ? 'bg-blue/40' : i === fi ? 'bg-blue' : 'bg-line'
className={`h-1 w-full rounded-full ${
i < fi ? 'bg-primary/35' : i === fi ? 'bg-primary' : 'bg-base-200'
}`}
/>
<span className={`text-[10px] ${i === fi ? 'font-semibold text-ink' : 'text-muted'}`}>{s}</span>
<span
className={`text-[10px] ${i === fi ? 'font-semibold text-base-content' : 'text-base-content/45'}`}
>
{s}
</span>
</li>
))}
</ol>
<div className="mt-3 flex items-center justify-between text-sm">
<span className="text-muted">가격 라운드</span>
<span className="font-mono font-medium">{Math.min(nego.iteration + (nego.initial ? 1 : 0), 5)} / 5</span>
<span className="text-base-content/55">가격 라운드</span>
<span className="num font-semibold">{Math.min(nego.iteration + (nego.initial ? 1 : 0), 5)} / 5</span>
</div>
</Panel>
<Panel title="엔진 판단">
{meta ? (
<dl className="flex flex-col gap-3 text-sm">
<dl className="flex flex-col gap-4 text-sm">
<div className="flex items-center justify-between gap-2">
<dt className="text-muted">협상 카드</dt>
<dd className="rounded bg-blue-soft px-2 py-0.5 font-mono text-[13px] font-medium text-blue">
{meta.card_id ?? '—'}
<dt className="text-base-content/55">협상 카드</dt>
<dd>
<span className="badge badge-soft badge-primary num font-mono text-[12px] font-semibold">
{meta.card_id ?? '—'}
</span>
</dd>
</div>
<div>
<div className="flex items-center justify-between">
<dt className="text-muted">가격 지표</dt>
<dd className="font-mono text-[13px]">
<dt className="text-base-content/55">가격 지표</dt>
<dd className="num text-[13px] font-medium">
{indicator != null ? (
<>
{indicator} <span className="text-muted">/ 99 · {meta.indicator_range}</span>
{indicator} <span className="text-base-content/45">/ 99 · {meta.indicator_range}</span>
</>
) : '—'}
</dd>
</div>
<div className="mt-1.5 h-1.5 rounded-full bg-paper">
<div className="mt-2 h-1.5 rounded-full bg-base-200">
<div
className="h-full rounded-full bg-blue transition-[width] duration-500"
className="h-full rounded-full bg-primary transition-[width] duration-500 motion-reduce:transition-none"
style={{ width: `${indicator ?? 0}%` }}
/>
</div>
@@ -103,34 +137,34 @@ export function Dashboard({
<div>
<div className="flex items-center justify-between">
<dt className="text-muted">협상 긴장도</dt>
<dd className="font-mono text-[13px]">{tension != null ? tension.toFixed(2) : '—'}</dd>
<dt className="text-base-content/55">협상 긴장도</dt>
<dd className="num text-[13px] font-medium">{tension != null ? tension.toFixed(2) : '—'}</dd>
</div>
<div className="mt-1.5 h-1.5 rounded-full bg-paper">
<div className="mt-2 h-1.5 rounded-full bg-base-200">
<div
className="h-full rounded-full bg-amber transition-[width] duration-500"
className="h-full rounded-full bg-warning transition-[width] duration-500 motion-reduce:transition-none"
style={{ width: `${(tension ?? 0) * 100}%` }}
/>
</div>
</div>
<div className="flex items-center justify-between gap-2">
<dt className="text-muted">적용 페르소나</dt>
<dt className="text-base-content/55">적용 페르소나</dt>
<dd>
{meta.persona ? (
<span className="rounded bg-amber-soft px-2 py-0.5 text-[13px] font-medium text-amber">
<span className="badge badge-soft badge-warning text-[12px] font-semibold">
{meta.persona}
</span>
) : (
<span className="text-muted">—</span>
<span className="text-base-content/45">—</span>
)}
</dd>
</div>
</dl>
) : (
<p className="text-xs leading-relaxed text-muted">
<p className="text-xs leading-relaxed text-base-content/55">
{nego.done
? '카드 라운드 없이 조기 합의됐습니다 — 첫 제안가가 앵커가 이하면 협상 카드 없이 종료됩니다.'
? '카드 라운드 없이 조기 합의됐어요 — 첫 제안가가 앵커가 이하면 협상 카드 없이 종료됩니다.'
: '가격 협상이 시작되면 선택된 협상 카드와 가격 지표·긴장도·페르소나가 여기에 표시됩니다.'}
</p>
)}