From e0b63cc637df01f394658e7f0bb0e8143d2e3848 Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 26 Jul 2026 20:02:28 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix(tradein/v2):=20=D0=BD=D0=B0=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D1=8F=D1=89=D0=B0=D1=8F=20=D0=BA=D0=B0=D1=80=D1=82=D0=B0?= =?UTF-8?q?=20Leaflet+OSM=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20=D0=B4?= =?UTF-8?q?=D0=B5=D0=BA=D0=BE=D1=80=D0=B0=D1=82=D0=B8=D0=B2=D0=BD=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=BF=D1=81=D0=B5=D0=B2=D0=B4=D0=BE-SVG=20(#252?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/trade-in/v2/ParamsPanel.tsx | 595 +++++++++++------- 1 file changed, 372 insertions(+), 223 deletions(-) diff --git a/tradein-mvp/frontend/src/components/trade-in/v2/ParamsPanel.tsx b/tradein-mvp/frontend/src/components/trade-in/v2/ParamsPanel.tsx index 1edcbc9d..251e66e3 100644 --- a/tradein-mvp/frontend/src/components/trade-in/v2/ParamsPanel.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/v2/ParamsPanel.tsx @@ -7,9 +7,16 @@ // styles are UNCHANGED — only the data plumbing differs (display
s became // s styled identically, dropdowns now feed real enum values). RU dropdown // labels <-> API enum values go through HOUSE_TYPE_*/REPAIR_* maps in ./mappers. -// РАДИУС is now wired (radius_m on submit + the outer map ring scales with it); -// the CRM dropdown still has no backend → kept visually but disabled. Hover/active -// + @keyframes live in a pp-prefixed local {/* LEFT: meta + buttons */} @@ -295,11 +437,15 @@ export default function HeroBar({
- {/* RIGHT: photo + overlays — dropped in compact mode (#2275): the box is - a fixed 560×152 with several absolutely-positioned children (address - card, compass, distance scale) pinned to that size, so it cannot - reflow to a phone width. «КАК РАССЧИТАНО» above still opens the same - location-coef drawer, so no functionality is lost. */} + {/* RIGHT: locator mini-map + overlays — dropped in compact mode (#2275): + the box is a fixed 560×152 with several absolutely-positioned + children (address card) pinned to that size, so it cannot reflow to + a phone width. «КАК РАССЧИТАНО» above still opens the same + location-coef drawer, so no functionality is lost. + User-reported bug: this used to be a single static building.png + photo shown for EVERY estimate regardless of the real address (a + user could be looking at someone else's building) — replaced with a + real Leaflet/OSM map centred on the subject's own coordinates. */} {!compact && (
- {!imgFailed && ( - setImgFailed(true)} - style={{ - position: "absolute", - inset: 0, - width: "100%", - height: "100%", - objectFit: "contain", - objectPosition: "right center", - filter: "saturate(.25) brightness(1.06) contrast(.95)", - }} - /> - )} - {/* blue duotone tint toward HUD accent — recedes the photo (only over - the real image; skip when it 404s so the placeholder stays clean) */} - {!imgFailed && ( -
- )} + + + {/* Left fade so the address card (below) stays legible over busy + map tiles instead of a floating card with no visual anchor — kept + from the old photo styling, where it served the same purpose. + pointerEvents:none so it never blocks map interaction/attribution + underneath. The old bottom vignette + scanning HUD sweep line are + dropped: both existed purely to stylise/recede the stock photo and + have no equivalent purpose over a live basemap. */}
-
-
@@ -406,31 +513,6 @@ export default function HeroBar({ {data.object.city}
- {/* streetView — Fix #4 (audit): always "" (TODO BE-3, mappers.ts - mapObject), so this slot + its divider are hidden together - rather than showing an empty caption row. Leaves the single - divider below to separate the address block from the coef row. */} - {data.object.streetView && ( - <> -
-
- {data.object.streetView} -
- - )}
- {/* compass — Fix #4 (audit): compass bearing is always "" (TODO BE-3, - mappers.ts mapObject), so the icon+label are hidden rather than - showing a compass that never actually points anywhere. Mirrors the - locationCoef "нет данных" graceful-fallback pattern already used - in this file. */} - {data.object.compass && ( -
- - - {data.object.compass} - -
- )} - {/* Fix #3 (audit) — the "0/25/50/75/100м" distance ruler here was a hardcoded tick scale over a generic stock photo with no real measurement behind it (not tied to any actual distance/scale value). Removed rather than fabricating a scale. */} - {/* corner brackets */} + {/* corner brackets — decorative HUD framing only; pointerEvents:none + so they never sit on top of the map's own bottom-right OSM + attribution link. */}
diff --git a/tradein-mvp/frontend/src/components/trade-in/v2/fixtures.ts b/tradein-mvp/frontend/src/components/trade-in/v2/fixtures.ts index bfa3af50..a56dbdb3 100644 --- a/tradein-mvp/frontend/src/components/trade-in/v2/fixtures.ts +++ b/tradein-mvp/frontend/src/components/trade-in/v2/fixtures.ts @@ -45,8 +45,10 @@ export const object: ObjectInfo = { repair: "Хороший", balcony: true, locationCoef: "0.87", - streetView: "Street View · май 2024", - compass: "СЕВЕРО-ЗАПАД", + // Approximate центр Екатеринбурга near ул. Малышева, 30 — illustrative + // fixture coordinate for the HeroBar locator mini-map (unwired usage only). + lat: 56.8384, + lon: 60.6057, }; // ---- 02 RESULT ------------------------------------------------------------ diff --git a/tradein-mvp/frontend/src/components/trade-in/v2/mappers.ts b/tradein-mvp/frontend/src/components/trade-in/v2/mappers.ts index 40afb5aa..eac886b6 100644 --- a/tradein-mvp/frontend/src/components/trade-in/v2/mappers.ts +++ b/tradein-mvp/frontend/src/components/trade-in/v2/mappers.ts @@ -20,8 +20,6 @@ // (parseAddress). Backend should return structured address components. // BE-3 location coefficient shipped 2026-07-03 (#2045) and is wired here // (mapObject/mapLocation consume GET /trade-in/location-coef, #2317). -// street-view caption / compass bearing are still not in the API → -// remain placeholders. // // Enum <-> RU reconciliation (design dropdowns have options with no enum value): // house type: 'Блочный' ⇄ enum 'other' (enum has no dedicated block type) @@ -820,8 +818,10 @@ export function mapObject( repair: e.repair_state ? REPAIR_RU[e.repair_state] : "—", balcony: e.has_balcony ?? false, locationCoef: coefDeltaLabel(coef), - streetView: "", // TODO BE-3 (backend does not surface a street-view caption) - compass: "", // TODO BE-3 (backend does not surface a compass bearing) + // Same target_lat/target_lon the ParamsPanel/SourcesMap map pins use — + // null while the estimate has no geocode yet. + lat: e.target_lat, + lon: e.target_lon, }; } diff --git a/tradein-mvp/frontend/src/components/trade-in/v2/types.ts b/tradein-mvp/frontend/src/components/trade-in/v2/types.ts index b8ce9886..4db48392 100644 --- a/tradein-mvp/frontend/src/components/trade-in/v2/types.ts +++ b/tradein-mvp/frontend/src/components/trade-in/v2/types.ts @@ -19,8 +19,11 @@ export interface ObjectInfo { repair: string; balcony: boolean; locationCoef: string; - streetView: string; - compass: string; + // Subject coordinates for the HeroBar locator mini-map (Leaflet/OSM). null + // when the estimate has no geocode yet — the map then renders an honest + // "нет координат" placeholder instead of an empty/broken box. + lat: number | null; + lon: number | null; } // ---- 02 RESULT ------------------------------------------------------------