가격 트랙 라벨 겹침 수정(스태거 배치) + 포트 변경 frontend 3000 · backend 3300

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 13:44:41 +09:00
1 parent 045f2517be
commit 156ce3817d
16 files changed
+71 -36

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ server {
# /api/* → backend (프리픽스 제거: /api/v1/... → /v1/...) — vite dev proxy 와 동일 규칙
location /api/ {
proxy_pass http://backend:53117/;
proxy_pass http://backend:3300/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
+1 -1
View File
@@ -130,7 +130,7 @@ export default function App() {
}`}
aria-hidden
/>
<span className="text-muted">{alive == null ? '확인 중' : alive ? '엔진 연결됨' : '엔진 응답 없음 (:53117)'}</span>
<span className="text-muted">{alive == null ? '확인 중' : alive ? '엔진 연결됨' : '엔진 응답 없음 (:3300)'}</span>
</div>
</header>
+1 -1
View File
@@ -109,7 +109,7 @@ export function ChatPanel({
</ol>
{error && (
<p className="mt-3 rounded-lg bg-amber-soft px-3 py-2 text-sm text-amber">
{error} — 서버(:53117)가 켜져 있는지 확인한 뒤 다시 시도하세요.
{error} — 서버(:3300)가 켜져 있는지 확인한 뒤 다시 시도하세요.
</p>
)}
</div>
+41 -6
View File
@@ -15,10 +15,42 @@ export function PriceTrack({ demoCase, priceTrail }: { demoCase: DemoCase; price
const lo = Math.min(anchor, ...(priceTrail.length ? priceTrail : [anchor])) * 0.97
const pos = (v: number) => Math.min(Math.max(((v - lo) / (hi - lo)) * 100, 0), 100)
const Tick = ({ value, label, cls }: { value: number; label: string; cls: string }) => (
// 기준선 3종 — 제안가가 범위를 크게 넓히면 서로 몰려 라벨이 겹치므로,
// 가까운 라벨(간격 < MIN_GAP%)은 아랫줄로 내려 층을 나눈다.
const MIN_GAP = 18
const ticks = [
{ value: anchor, label: '앵커가', cls: 'bg-blue' },
{ value: target, label: '목표가', cls: 'bg-ink/50' },
{ value: item_price, label: '기존가', cls: 'bg-muted/60' },
].sort((a, b) => a.value - b.value)
const rows = ticks.map(() => 0)
for (let i = 1; i < ticks.length; i++) {
let row = 0
for (let j = 0; j < i; j++) {
if (pos(ticks[i].value) - pos(ticks[j].value) < MIN_GAP && rows[j] === row) {
row += 1
j = -1 // 줄을 내렸으니 앞 라벨들과 다시 비교
}
}
rows[i] = row
}
const maxRow = Math.max(...rows)
// 가장자리에선 중앙정렬 대신 안쪽으로 붙여 패널 밖 클리핑을 막는다
const align = (p: number) =>
p <= 6
? 'translate-x-0 text-left'
: p >= 94
? '-translate-x-full text-right'
: '-translate-x-1/2 text-center'
const Tick = ({ value, label, cls, row }: { value: number; label: string; cls: string; row: number }) => (
<div className="absolute top-0 h-full" style={{ left: `${pos(value)}%` }}>
<div className={`h-full w-px ${cls}`} />
<div className="absolute top-full mt-1 -translate-x-1/2 text-center">
<div
className={`absolute whitespace-nowrap ${align(pos(value))}`}
style={{ top: `calc(100% + ${4 + row * 28}px)` }}
>
<div className="text-[10px] leading-tight text-muted">{label}</div>
<div className="font-mono text-[11px] font-medium leading-tight">{value.toLocaleString()}</div>
</div>
@@ -27,7 +59,10 @@ export function PriceTrack({ demoCase, priceTrail }: { demoCase: DemoCase; price
return (
<div>
<div className="relative mb-9 mt-6 h-3 rounded-full bg-paper">
<div
className="relative mt-6 h-3 rounded-full bg-paper"
style={{ marginBottom: `${2.25 + maxRow * 1.75}rem` }}
>
{/* 구간 채색: [lo~anchor]=파랑(최적) · [anchor~target]=연파랑(합의권) · [target~hi]=앰버(초과) */}
<div className="absolute inset-y-0 left-0 rounded-l-full bg-blue/70" style={{ width: `${pos(anchor)}%` }} />
<div
@@ -38,9 +73,9 @@ export function PriceTrack({ demoCase, priceTrail }: { demoCase: DemoCase; price
className="absolute inset-y-0 rounded-r-full bg-amber-soft"
style={{ left: `${pos(target)}%`, width: `${100 - pos(target)}%` }}
/>
<Tick value={anchor} label="앵커가" cls="bg-blue" />
<Tick value={target} label="목표가" cls="bg-ink/50" />
<Tick value={item_price} label="기존가" cls="bg-muted/60" />
{ticks.map((t, i) => (
<Tick key={t.label} value={t.value} label={t.label} cls={t.cls} row={rows[i]} />
))}
{/* 과거 제안 흔적 */}
{priceTrail.slice(0, -1).map((p, i) => (
+1 -1
View File
@@ -1,4 +1,4 @@
// NEGO_AGENT 서버 API — /api → :53117 (vite proxy)
// NEGO_AGENT 서버 API — /api → :3300 (vite proxy)
import type { CardData, DemoCase } from '../content/cases'
+3 -3
View File
@@ -5,11 +5,11 @@ import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [react(), tailwindcss()],
server: {
port: 5317,
port: 3000,
proxy: {
// NEGO_AGENT 서버 (:53117) — 데모는 항상 프록시 경유(/api)로 호출한다
// NEGO_AGENT 서버 (:3300) — 데모는 항상 프록시 경유(/api)로 호출한다
'/api': {
target: 'http://127.0.0.1:53117',
target: 'http://127.0.0.1:3300',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},