feat(tradein): web-native analytics cards on estimate result (map, distribution, trend, exposure) #688
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#688
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-result-analytics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Web-native analytics on the estimate result — things a static PDF (Brusnika) can't do.
4 graceful cards (each renders only when data present), added in page.tsx after StreetDealsCard:
Mirrors the new /estimate fields in TS types (AnalogLot.lat/lon, price_trend, last_scraped_at). Reuses Leaflet + recharts already in the project; brand-CSS-var themed (re-skins under praktika); responsive; strict TS, tsc --noEmit clean. HeroSummary untouched (sibling transparency PR owns it).
Refs #647 #667
Web-native analytics cards (map / distribution / trend / exposure). Reviewed via subagent (8-dim, data-viz edge cases).
esc()escapes the five HTML chars before innerHTML interpolation of address/kind; numerics go through fmtRub/toLocaleString.<3ORmax<=min→ [] (kills bin-width div-by-zero; bin idx clamped); Map 0 pins → null; Exposure<3→ null; Trend<2→ null +changePctguarded byfirst>0. All early-returns sit AFTER hooks (rules-of-hooks OK).price_trend ?? [], lat/lontypeof === numberfilter, old estimates without #685 fields → cards simply hidden, no crash.anyis the documented Leaflet CDN interop (eslint-disabled with rationale, matching MapPicker). NewPriceTrendPoint+ nullable lat/lon mirror the #685 schema.use client, recharts reused (no new deps), React keys present, useMemo for derived datasets. page.tsx wiring additive, each card self-guards visibility.APPROVE.