feat(tradein): trust + actions (how-calculated, freshness, PDF, lead CTA) in result header #689

Merged
bot-reviewer merged 2 commits from feat/tradein-result-transparency into main 2026-05-30 08:16:13 +00:00

2 commits

Author SHA1 Message Date
lekss361
16a6d5a97b fix(tradein): hide lead CTA when contact email unset (no garbage mailto fallback)
Review #689: the CTA fallback was a throwaway address (settings.contact_email,
a Nominatim User-Agent contact — NOT a lead inbox). Unset env on first deploy →
client's заявка with PII drafts to a stranger, lead silently lost.
Fix: CONTACT_EMAIL = env only (trimmed, no fallback); render the «Оставить заявку»
CTA ONLY when leadEnabled (email configured). PDF + transparency unaffected.
tsc clean.
2026-05-30 11:13:00 +03:00
lekss361
2769fe6daf feat(tradein): trust + actions (how-calculated, freshness, PDF, lead CTA) in result header
Web-only trust signals over the static PDF, in the result header (HeroTransparency):
- «Как рассчитано» collapsible: comps tier (parsed from confidence_explanation),
  n_analogs, confidence band, full explanation.
- «Данные актуальны на …» freshness (last_scraped_at | now − data_freshness_minutes).
- «Скачать PDF-отчёт» — brand-aware (useActiveBrandSlug), existing PDF endpoint.
- «Оставить заявку на трейд-ин» CTA — no lead backend yet → graceful mailto stub
  (configurable contact, TODO(lead-flow)).
Scoped to HeroSummary + new HeroTransparency + css + one type field; page.tsx
untouched. tsc --noEmit clean; brand-themed; responsive; null-safe.

Refs #657
2026-05-30 10:46:09 +03:00