From 81dd103cb455c871654d521d4f4b6ab36a330437 Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 24 May 2026 15:47:40 +0300 Subject: [PATCH] fix(tradein-ui): replace Tailwind with OKLCH tokens + a11y on disclaimer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review-bot feedback on #517: - tradein-mvp/frontend doesn't use Tailwind — classes (rounded-lg, bg-amber-50, …) rendered as plain unstyled text. Replace with inline styles using project's OKLCH design tokens (--accent-2, --accent-2-soft, --surface-2, --radius, --fg). - Add role=status aria-live=polite on disclaimer for screen readers - Move handleResubmit below resultData declaration (ESLint no-use-before-define) --- tradein-mvp/frontend/src/app/page.tsx | 12 +- .../src/components/trade-in/HeroSummary.tsx | 124 +++++++++++------- 2 files changed, 79 insertions(+), 57 deletions(-) diff --git a/tradein-mvp/frontend/src/app/page.tsx b/tradein-mvp/frontend/src/app/page.tsx index e5748af4..99afcf14 100644 --- a/tradein-mvp/frontend/src/app/page.tsx +++ b/tradein-mvp/frontend/src/app/page.tsx @@ -59,12 +59,6 @@ export default function TradeInPage() { }); } - function handleResubmit(patch: { house_type?: HouseType; repair_state?: RepairState }) { - if (!resultData) return; - const enrichedInput: TradeInEstimateInput = { ...resultData.input, ...patch }; - handleSubmit(enrichedInput); - } - const apiError = mutation.error?.message ?? null; const resultData = freshResult ?? @@ -81,6 +75,12 @@ export default function TradeInPage() { } : null); + function handleResubmit(patch: { house_type?: HouseType; repair_state?: RepairState }) { + if (!resultData) return; + const enrichedInput: TradeInEstimateInput = { ...resultData.input, ...patch }; + handleSubmit(enrichedInput); + } + const isPending = mutation.isPending; return ( diff --git a/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx b/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx index cfd48d14..812a6e06 100644 --- a/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/HeroSummary.tsx @@ -102,8 +102,21 @@ export function HeroSummary({ estimate, input, onResubmit, isResubmitting = fals return (
{showMockDisclaimer && ( -
- Адрес распознан неточно — оценка может быть приближённой. +
+ ⚠️ Адрес распознан неточно — оценка может быть приближённой. Уточните адрес и пересчитайте для более точного результата.
)} @@ -323,55 +336,64 @@ export function HeroSummary({ estimate, input, onResubmit, isResubmitting = fals )} {showEnrichment && ( -
-
-

- Уточните для повышения точности оценки: -

-
-
- {needsHouseType && ( - - )} - {needsRepairState && ( - - )} -
- -
-
+
+

+ Уточните для повышения точности оценки: +

+
+
+ {needsHouseType && ( + + )} + {needsRepairState && ( + + )} +
+ +
)}