From 0e76183efab5097ae4f91f4fe834697826c5a010 Mon Sep 17 00:00:00 2001 From: bot-frontend Date: Sat, 30 May 2026 18:40:57 +0300 Subject: [PATCH] =?UTF-8?q?fix(tradein):=20confidence=20=C2=AB=D1=81=D1=80?= =?UTF-8?q?=D0=B5=D0=B4=D0=BD=D1=8F=D1=8F=C2=BB=20=E2=86=92=20amber=20+=20?= =?UTF-8?q?FIXME=20=D0=B4=D0=BB=D1=8F=20compsTier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONF_LABELS.medium красился var(--success) (зелёный, читается как «высокая») → var(--warn) (amber). compsTier substring-парсит прозу confidence_explanation; структурного tier-поля в AggregatedEstimate нет — оставлен fallback + FIXME-маркер (#695 follow-up) для будущего backend-поля. Refs #742 --- tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx | 2 +- .../frontend/src/components/trade-in/HeroTransparency.tsx | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx b/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx index 617524de..46f84051 100644 --- a/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx @@ -53,7 +53,7 @@ const SOURCE_LABELS: Record = { const CONF_LABELS: Record = { high: { txt: "высокая", color: "var(--success)" }, - medium: { txt: "средняя", color: "var(--success)" }, + medium: { txt: "средняя", color: "var(--warn)" }, low: { txt: "низкая", color: "var(--danger)" }, }; diff --git a/tradein-mvp/frontend/src/components/trade-in/HeroTransparency.tsx b/tradein-mvp/frontend/src/components/trade-in/HeroTransparency.tsx index eca23deb..d372196a 100644 --- a/tradein-mvp/frontend/src/components/trade-in/HeroTransparency.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/HeroTransparency.tsx @@ -47,6 +47,11 @@ const CONTACT_EMAIL = (process.env.NEXT_PUBLIC_TRADEIN_CONTACT_EMAIL ?? "").trim * Null → ничего не показываем (graceful). */ function compsTier(explanation: string | null): string | null { + // FIXME: backend should expose structured comps_tier (#695 follow-up). + // AggregatedEstimate не отдаёт структурного tier-поля для anchor-уровня + // (только AnalogLot.tier для отдельных rosreestr-сделок), поэтому уровень + // приходится извлекать substring-эвристикой из прозы confidence_explanation. + // Хрупко к переформулировке бэкенда — оставлено как fallback до появления поля. if (!explanation) return null; const t = explanation.toLowerCase(); if (t.includes("тот же дом") || t.includes("того же дома") || t.includes("этом же доме")) -- 2.45.3