From e0b63cc637df01f394658e7f0bb0e8143d2e3848 Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 26 Jul 2026 20:02:28 +0000 Subject: [PATCH 1/3] =?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 ------------------------------------------------------------ From c9ba1b15ba9d81b0b21c468695ce47dd364a46aa Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 26 Jul 2026 20:26:08 +0000 Subject: [PATCH 3/3] =?UTF-8?q?fix(tradein/v2):=20=D0=B2=D0=B5=D1=80=D0=BD?= =?UTF-8?q?=D1=83=D1=82=D1=8C=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D0=BD=D1=83?= =?UTF-8?q?=D1=8E=20=D0=BA=D0=B0=D1=80=D1=82=D0=BE=D1=87=D0=BA=D1=83=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2=D0=B5=D1=80=D1=85=20=D0=BA=D0=B0=D1=80=D1=82?= =?UTF-8?q?=D1=8B=20=D0=B8=20=D0=BA=D0=BE=D0=BE=D1=80=D0=B4=D0=B8=D0=BD?= =?UTF-8?q?=D0=B0=D1=82=D1=8B=20=D0=BF=D1=80=D0=B8=20restore-by-id=20(#253?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tradein-mvp/frontend/src/app/v2/page.tsx | 7 +++++++ .../frontend/src/components/trade-in/v2/HeroBar.tsx | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/tradein-mvp/frontend/src/app/v2/page.tsx b/tradein-mvp/frontend/src/app/v2/page.tsx index 91f13305..834a1a85 100644 --- a/tradein-mvp/frontend/src/app/v2/page.tsx +++ b/tradein-mvp/frontend/src/app/v2/page.tsx @@ -681,6 +681,13 @@ export default function TradeInV2Page() { house_type: estimate.house_type ?? undefined, repair_state: estimate.repair_state ?? undefined, has_balcony: estimate.has_balcony ?? undefined, + // Without these the 01 map falls back to its "pick an address" + // placeholder on every restored estimate (shared link, history, + // PDF flow) even though the address field is populated — the map + // keys off coords, not the address string, and only the geocode + // suggestion path used to supply them. + lat: estimate.target_lat ?? undefined, + lon: estimate.target_lon ?? undefined, } : undefined, [estimate], diff --git a/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx b/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx index 069602b9..c1e77d35 100644 --- a/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx @@ -476,6 +476,9 @@ export default function HeroBar({ background: "linear-gradient(90deg,rgba(238,244,250,.96) 0%,rgba(238,244,250,.5) 22%,transparent 40%)", pointerEvents: "none", + // Above Leaflet's tile pane (200) / overlay pane (400); below the + // marker (600) so the subject pin still reads through the fade. + zIndex: 500, }} /> @@ -487,6 +490,15 @@ export default function HeroBar({ top: "50%", transform: "translateY(-50%)", width: 182, + // MUST be set explicitly. .leaflet-container is position:relative + // with z-index:auto, so it does NOT open a stacking context — its + // internal panes (tiles 200 … popup 700) compete directly with + // these siblings, and an auto/0 card is painted UNDER the map. + // Shipped without this in #2529 and the address + location figure + // vanished from the hero on prod. 750 clears every pane; the + // attribution control (800) sits bottom-right and never overlaps + // this left-anchored card, so its link stays clickable. + zIndex: 750, background: tokens.surface.w72, backdropFilter: "blur(5px)", border: `1px solid ${tokens.line}`,