From e7815834120d2d68fef0b2a54177d79962ef1e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AF=BC=ED=97=8C?= Date: Mon, 31 Aug 2026 14:18:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EC=9E=91=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=9D=84=20=EC=8B=9C=EB=82=98=EB=A6=AC=EC=98=A4=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=EC=9C=BC=EB=A1=9C=20=E2=80=94=20=EC=B1=84=ED=8C=85=20?= =?UTF-8?q?=EC=98=81=EC=97=AD=204=EB=B6=84=EB=A9=B4=20=ED=94=BC=EC=BB=A4?= =?UTF-8?q?=C2=B7=EC=A2=8C=EC=B8=A1=20=ED=8C=A8=EB=84=90=EC=9D=80=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EC=9A=94=EC=95=BD=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=97=AD=ED=95=A0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 첫 화면: 채팅 영역에 시나리오 설명 + A/B/D/C 카드(상품명 제거), 선택 시 협상 시작 - 좌측 패널: 선택 UI 중복 제거 — 선택된 시나리오 요약 + '시나리오 변경'(피커 복귀) - 상품 정보: 공급 유형·협력사 유형(X/단독/다수) 두 행으로 분리 - 채팅 하단 옵션 버튼 우측 정렬, 선택 전 우측 가격 패널은 빈 상태 안내 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01UFZ7JWdwCaQAwNYJErL8pP --- frontend/src/App.tsx | 21 +++- frontend/src/components/CasePanel.tsx | 93 +++++++------- frontend/src/components/ChatPanel.tsx | 168 +++++++++++++++----------- frontend/src/components/Dashboard.tsx | 42 ++++--- frontend/src/content/cases.ts | 10 ++ 5 files changed, 195 insertions(+), 139 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 626fb19..c0683ae 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -22,7 +22,7 @@ const IDLE: NegoState = { } export default function App() { - const [demoCase, setDemoCase] = useState(DEMO_CASES[0]) + const [demoCase, setDemoCase] = useState(null) const [nego, setNego] = useState(IDLE) const [messages, setMessages] = useState([]) const [meta, setMeta] = useState(null) @@ -43,6 +43,7 @@ export default function App() { const send = useCallback( async (userInput: string | null, state: NegoState, userLabel?: string) => { + if (!demoCase) return setBusy(true) setError(null) if (userLabel) setMessages((m) => [...m, { role: 'user', text: userLabel }]) @@ -106,6 +107,18 @@ export default function App() { // eslint-disable-next-line react-hooks/exhaustive-deps }, [runId]) + // 시나리오 선택 화면으로 복귀 (채팅 영역이 선택 UI가 된다) + const changeScenario = useCallback(async () => { + await invalidateSession(session.current).catch(() => {}) + setDemoCase(null) + setMessages([]) + setMeta(null) + setFinalPrice(null) + setPriceTrail([]) + setStarted(false) + setNego(IDLE) + }, []) + const answer = (label: string) => send(label, nego, label) const offer = (v: number) => { @@ -139,7 +152,7 @@ export default function App() {
- + start(demoCase)} + onRestart={() => demoCase && start(demoCase)} + onSelect={start} /> void + onChange: () => void }) { + if (!selected) { + return ( + + ) + } + + const q = SCENARIO_QUADRANTS.find((x) => x.scenario === selected.scenario) + return (