fix(tradein-frontend): Мера estimate — hydration #418 + photos 422 (#1803 #1804) #1808

Merged
lekss361 merged 1 commit from fix/mera-estimate-ui-artifacts into main 2026-06-19 17:49:45 +00:00
Owner

Closes #1803, closes #1804.

#1803 Hydration #418 (HeroTransparency.tsx)

  • formatRuDateTime без timeZone → SSR(UTC) ≠ client(MSK) → text mismatch. Фикс: timeZone: "UTC" в Intl.DateTimeFormat.
  • Date.now() в render-ветке data_freshness_minutes → перенесён в useEffect/useState (SSR → null, не рисуется до гидратации).

#1804 Photos 422 (PhotoUpload.tsx)

  • isRealEstimateId(id) (UUID4 + !startsWith("preview-")) гард в refresh()/handleFiles() → не слать GET /photos с fake preview-UUID.
  • Счётчик preview ? "— / 12" : "{n} / 12"; upload disabled в preview.

Тесты

tsc --noEmit 0 ошибок, pre-commit pass, next build clean.

На ревью

  • Гард isRealEstimateId не ломает реальный flow (валидный UUID → fetch как раньше).
  • timeZone: UTC — даты теперь в UTC; проверить, что это ожидаемо для отображения свежести (а не локальное МСК).
Closes #1803, closes #1804. ## #1803 Hydration #418 (`HeroTransparency.tsx`) - `formatRuDateTime` без `timeZone` → SSR(UTC) ≠ client(MSK) → text mismatch. Фикс: `timeZone: "UTC"` в `Intl.DateTimeFormat`. - `Date.now()` в render-ветке `data_freshness_minutes` → перенесён в `useEffect`/`useState` (SSR → null, не рисуется до гидратации). ## #1804 Photos 422 (`PhotoUpload.tsx`) - `isRealEstimateId(id)` (UUID4 + `!startsWith("preview-")`) гард в `refresh()`/`handleFiles()` → не слать GET /photos с fake preview-UUID. - Счётчик `preview ? "— / 12" : "{n} / 12"`; upload disabled в preview. ## Тесты tsc `--noEmit` 0 ошибок, pre-commit pass, `next build` clean. ## На ревью - Гард `isRealEstimateId` не ломает реальный flow (валидный UUID → fetch как раньше). - `timeZone: UTC` — даты теперь в UTC; проверить, что это ожидаемо для отображения свежести (а не локальное МСК).
lekss361 added 1 commit 2026-06-19 17:45:35 +00:00
fix(tradein-frontend): Мера estimate — hydration #418 + photos 422 graceful (#1803 #1804)
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
cbc20cfe54
#1803 HeroTransparency: formatRuDateTime добавляет timeZone:"UTC" (SSR Node UTC
vs клиент Europe/Moscow давали разный час → React minified error #418).
Date.now() fallback (data_freshness_minutes без last_scraped_at) вынесен в
useEffect/useState — не выполняется при SSR.

#1804 PhotoUpload: guard isRealEstimateId() проверяет UUID4 regex и отклоняет
preview-0000-... — GET/POST /photos с фейковым ID больше не слаются → нет 422.
Счётчик показывает «— / 12» вместо «0 / 12», input disabled в preview-режиме.
lekss361 merged commit c88170b680 into main 2026-06-19 17:49:45 +00:00
lekss361 deleted branch fix/mera-estimate-ui-artifacts 2026-06-19 17:49:45 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1808
No description provided.