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

- 연회색 바탕 위 무보더 흰 카드, 단일 파랑 악센트, 숫자 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

+52 -51
View File
@@ -52,16 +52,16 @@ export function ChatPanel({
: null
return (
<section className="flex min-h-[70vh] flex-col rounded-xl border border-line bg-panel min-[960px]:h-full min-[960px]:min-h-0">
<section className="flex min-h-[70vh] flex-col rounded-box bg-base-100 min-[960px]:h-full min-[960px]:min-h-0">
{started && (
<div className="flex items-center justify-between gap-3 border-b border-line px-4 py-2.5">
<span className="truncate text-sm font-semibold">{demoCase.item_name}</span>
<div className="flex items-center justify-between gap-3 border-b border-base-300/60 px-5 py-3">
<span className="truncate text-sm font-bold">{demoCase.item_name}</span>
{!nego.done && (
<button
type="button"
onClick={onRestart}
disabled={busy}
className="shrink-0 rounded-md border border-line px-2.5 py-1 text-xs text-muted hover:border-muted hover:text-ink disabled:opacity-40 focus-visible:ring-2 focus-visible:ring-blue focus-visible:outline-none"
className="btn btn-ghost btn-xs text-base-content/55"
>
다시 시작
</button>
@@ -69,94 +69,95 @@ export function ChatPanel({
</div>
)}
<div ref={scroller} className="flex-1 overflow-y-auto p-4">
<div ref={scroller} className="flex-1 overflow-y-auto px-5 py-4">
{!started && (
<div className="flex h-full flex-col items-center justify-center gap-2 text-center text-muted">
<p className="text-base font-medium text-ink">협상 준비 완료</p>
<p className="max-w-sm text-sm leading-relaxed">
왼쪽에서 협상 케이스를 선택하세요. 협상 카드·가격 지표·긴장도가
오른쪽 계기판에 실시간으로 표시됩니다.
<div className="flex h-full flex-col items-center justify-center gap-2 text-center">
<p className="text-lg font-bold">어떤 품목으로 협상해 볼까요?</p>
<p className="max-w-sm text-sm leading-relaxed text-base-content/55">
왼쪽에서 협상 케이스를 선택하면 시작됩니다. 엔진의 판단 근거는
오른쪽 계기판에 실시간으로 표시돼요.
</p>
</div>
)}
<ol className="flex flex-col gap-3">
<ol className="flex flex-col gap-1">
{messages.map((m, i) => (
<li key={i} className={`msg-in flex ${m.role === 'user' ? 'justify-end' : 'justify-start'}`}>
<li key={i} className={`msg-in chat ${m.role === 'user' ? 'chat-end' : 'chat-start'}`}>
{m.role === 'bot' && m.step && (
<div className="chat-header mb-1 flex items-center gap-1.5 text-[11px] font-semibold text-base-content/45">
<span>{stepLabel(m.step)}</span>
{m.meta?.card_id && (
<span className="num rounded-full bg-primary/10 px-1.5 py-px font-mono text-primary">
{m.meta.card_id}
</span>
)}
</div>
)}
<div
className={`max-w-[min(82%,34rem)] rounded-2xl px-4 py-3 text-[15px] leading-relaxed whitespace-pre-line ${
className={`chat-bubble max-w-[min(85%,34rem)] text-[15px] leading-relaxed whitespace-pre-line before:hidden ${
m.role === 'user'
? 'rounded-br-md bg-blue text-white'
: 'rounded-bl-md bg-bot'
? 'bg-primary text-primary-content'
: 'bg-base-200 text-base-content'
}`}
>
{m.role === 'bot' && m.step && (
<div className="mb-1 flex items-center gap-2 text-[11px] font-semibold text-muted">
<span>{stepLabel(m.step)}</span>
{m.meta?.card_id && (
<span className="rounded bg-blue-soft px-1.5 py-px font-mono text-blue">{m.meta.card_id}</span>
)}
</div>
)}
{m.text}
</div>
</li>
))}
{busy && (
<li className="flex justify-start">
<div className="rounded-2xl rounded-bl-md bg-bot px-4 py-3 text-sm text-muted">협상 중…</div>
<li className="chat chat-start">
<div className="chat-bubble flex items-center gap-2 bg-base-200 text-sm text-base-content/55 before:hidden">
<span className="loading loading-dots loading-sm" aria-hidden />
담당자가 검토하고 있어요
</div>
</li>
)}
</ol>
{error && (
<p className="mt-3 rounded-lg bg-amber-soft px-3 py-2 text-sm text-amber">
{error} — 서버(:3300)가 켜져 있는지 확인한 뒤 다시 시도하세요.
</p>
<div className="mt-3 rounded-field bg-error/8 px-4 py-3 text-sm text-error">
{error} — 엔진 연결을 확인한 뒤 다시 시도해 주세요.
</div>
)}
</div>
<div className="border-t border-line p-3">
<div className="border-t border-base-300/60 p-4">
{nego.done ? (
<div className="flex flex-wrap items-center justify-between gap-3">
{finalPrice != null ? (
<span className="text-sm">
<span className="font-semibold text-green">협상 완료</span>
<span className="text-muted"> — 최종 합의가 </span>
<span className="font-mono font-semibold">{finalPrice.toLocaleString()}원</span>
<span className="font-mono text-blue"> (기존가 대비 −{savedPct}%)</span>
</span>
<div>
<p className="text-xs font-semibold text-success">협상 완료</p>
<p className="num mt-0.5 text-lg font-bold">
{finalPrice.toLocaleString()}원
<span className="num ml-2 align-[2px] rounded-full bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary">
기존가 대비 −{savedPct}%
</span>
</p>
</div>
) : (
<span className="text-sm font-semibold">협상이 종료되었습니다</span>
<span className="text-sm font-bold">협상이 종료되었습니다</span>
)}
<button
type="button"
onClick={onRestart}
className="rounded-lg bg-ink px-4 py-2 text-sm font-semibold text-white hover:bg-ink/85 focus-visible:ring-2 focus-visible:ring-blue focus-visible:outline-none"
>
<button type="button" onClick={onRestart} className="btn btn-neutral rounded-field">
같은 케이스로 다시 협상
</button>
</div>
) : nego.mode === 'price' ? (
<form
className="flex gap-2"
onSubmit={(e) => { e.preventDefault(); submitPrice() }}
>
<form className="flex gap-2" onSubmit={(e) => { e.preventDefault(); submitPrice() }}>
<label htmlFor="price" className="sr-only">공급 제안가 (원)</label>
<input
id="price"
inputMode="numeric"
autoComplete="off"
placeholder={`공급 제안가 입력 (기존가 ${demoCase.item_price.toLocaleString()}원)`}
placeholder={`제안가 입력 (기존가 ${demoCase.item_price.toLocaleString()}원)`}
value={priceInput}
onChange={(e) => setPriceInput(e.target.value)}
disabled={busy}
className="min-w-0 flex-1 rounded-lg border border-line bg-paper px-3 py-2.5 font-mono text-sm focus-visible:ring-2 focus-visible:ring-blue focus-visible:outline-none"
className="input num min-w-0 flex-1 bg-base-200 text-[15px] focus:outline-primary"
/>
<button
type="submit"
disabled={busy || !priceInput.trim()}
className="shrink-0 rounded-lg bg-blue px-5 py-2.5 text-sm font-semibold text-white disabled:opacity-40 hover:bg-blue/90 focus-visible:ring-2 focus-visible:ring-ink focus-visible:outline-none"
className="btn btn-primary shrink-0 rounded-field px-6"
>
제안
제안하기
</button>
</form>
) : nego.options.length > 0 ? (
@@ -167,14 +168,14 @@ export function ChatPanel({
type="button"
disabled={busy}
onClick={() => onAnswer(opt)}
className="rounded-lg border border-line bg-paper px-4 py-2.5 text-sm font-medium hover:border-blue hover:text-blue disabled:opacity-40 focus-visible:ring-2 focus-visible:ring-blue focus-visible:outline-none"
className="btn rounded-field border-0 bg-base-200 px-5 font-semibold hover:bg-primary/10 hover:text-primary"
>
{opt}
</button>
))}
</div>
) : (
<p className="py-1 text-center text-sm text-muted">
<p className="py-1 text-center text-sm text-base-content/45">
{started ? '응답을 기다리는 중…' : '케이스를 선택하면 입력이 열립니다'}
</p>
)}