feat(tradein/v2): срок экспозиции подстрокой в карточке «Ожидаемая цена сделки» (#2639)
All checks were successful
Deploy Trade-In / changes (push) Successful in 11s
Deploy Trade-In / test (push) Has been skipped
Deploy Trade-In / build-browser (push) Has been skipped
Deploy Trade-In / build-backend (push) Has been skipped
Deploy Trade-In / build-frontend (push) Successful in 2m6s
Deploy Trade-In / deploy (push) Successful in 55s

This commit is contained in:
lekss361 2026-08-02 16:06:03 +00:00
parent 8c0511e0bd
commit 966415dc8a
4 changed files with 28 additions and 2 deletions

View file

@ -599,8 +599,9 @@ export default function TradeInV2Page() {
[locationIndexData],
);
const resultPanelData = useMemo(
() => (estimate ? mapResultPanel(estimate, streetDealsData) : null),
[estimate, streetDealsData],
() =>
estimate ? mapResultPanel(estimate, streetDealsData, analyticsData) : null,
[estimate, streetDealsData, analyticsData],
);
const summaryData = useMemo(
() =>

View file

@ -484,6 +484,7 @@ export default function ResultPanel({
// M2 — calm delta pill (was a 51px circular gauge that read like a
// tech "занижение" indicator). Full text «18% к цене объявления»,
// neutral accentDeep on a soft-blue chip, tabular-nums.
<>
<div
style={{
display: "flex",
@ -549,6 +550,20 @@ export default function ResultPanel({
Подробнее <span></span>
</button>
</div>
{card.exposureNote && (
<div
style={{
fontSize: 9,
color: muted2,
marginTop: 4,
lineHeight: 1.4,
maxWidth: "82%",
}}
>
{card.exposureNote}
</div>
)}
</>
)}
</div>
);

View file

@ -1038,6 +1038,7 @@ export function mapMarkers(e: AggregatedEstimate | null): MapMarker[] {
export function mapResultPanel(
e: AggregatedEstimate,
streetDeals?: StreetDealsResponse | null,
analytics?: HouseAnalyticsResponse | null,
): ResultPanelData {
const dealTier = resolveDealTier(e, streetDeals);
@ -1105,6 +1106,13 @@ export function mapResultPanel(
emptyNote: hasExpected
? undefined
: "Недостаточно данных для прогноза цены сделки — ориентируйтесь на рекомендованную цену в объявлении",
// Median exposure days (house/district), from house_placement_history —
// gated on hasExpected: when the card has no forecast it renders only
// emptyNote (see above), the exposure aside has nowhere honest to sit.
exposureNote:
hasExpected && analytics?.kpi?.median_exposure_days != null
? `срок продажи ~${analytics.kpi.median_exposure_days} дн`
: undefined,
note:
hasExpected &&
dealTier != null &&

View file

@ -55,6 +55,8 @@ export interface ResultCard {
deltaLabel?: string;
/** Reconciliation note under the value (card 2: expected price vs ДКП median). */
note?: string;
/** Медиана срока экспозиции по дому/району (house_placement_history), подстрока карточки 2. */
exposureNote?: string;
/** H1 empty-state message: when set (card 2, no expected-sold prediction) the
* card renders this instead of value/range/ppm/delta, and the panel moves the
* accent frame onto the «рекомендованная цена» card. */