From 61f412bb276bf1b80830c2aa327bdf309febb030 Mon Sep 17 00:00:00 2001 From: cesnimda Date: Mon, 26 Oct 2026 04:01:22 +0100 Subject: [PATCH] fix(cv): retain preview geometry while refreshing last-good pages --- docs/cv-redesign/CHECKPOINT_IMPLEMENTATION.md | 4 ++++ docs/cv-redesign/TODO.md | 2 ++ job-tracker-ui/src/views/CvBuilderEditor.tsx | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/cv-redesign/CHECKPOINT_IMPLEMENTATION.md b/docs/cv-redesign/CHECKPOINT_IMPLEMENTATION.md index 3569f6a..10e423c 100644 --- a/docs/cv-redesign/CHECKPOINT_IMPLEMENTATION.md +++ b/docs/cv-redesign/CHECKPOINT_IMPLEMENTATION.md @@ -48,3 +48,7 @@ The first independent full review found three P2 acceptance gaps: location was c Fresh full Release backend1227/1227 (40 added cases, zero removed from the preceding1187 report) and frontend981/981 across107 suites passed. Source-bound frontend process before/after hashes match. Two letter browser cases passed after corrections; the unchanged native oracle passed all four letter fixtures/14pages with zero differences. Actual MariaDB source-bound transaction cases and final aggregate Windows/Linux runs remain pending. Re-review of the corrections found no remaining material defect; review did not substitute for execution. Actual MariaDB source-boundary successor59/59 passed (`provider-final-03`), including three real relational transaction/held-source cases with a stub inference service. Source hashes match and owned cleanup is confirmed. The intermediate `provider-final-02` preparation failed before starting a service or executing tests and remains preserved. Real API authorization checks also passed (missing owned interaction404; free account403). The seven-scenario responsive browser case additionally passed five targeted WCAG A/AA scans with zero violations; incomplete/manual qualifications remain open and final native reports retain their scan details. Its preceding exact-name locator timeout is a fixture failure retained separately: MUI exposes the select's label together with its selected value. + +## Last-good preview scroll regression + +The aggregate `final-04` run exposed a real regression in both original preview-presentation recovery cases: a held refresh changed scrollTop by7px against the unchanged1px tolerance. The new page selector unmounted while `previewReady` was false, shortening the toolbar and expanding the retained preview viewport. The narrow correction keeps the selector mounted when last-good multi-page HTML exists and disables it until ready. Both original EN/light and NB/dark scenarios now pass, including held/error/retry, retained iframe identity/content and scroll checks (`preview-scroll-successor-01.json`); focused editor50/50 and a fresh static build pass. Independent review found no material issue. No oracle tolerance or original assertion changed. Full frontend successor and fresh aggregate/PDF runs remain pending; failed/interrupted `final-04` is retained. diff --git a/docs/cv-redesign/TODO.md b/docs/cv-redesign/TODO.md index 3d4dcb5..c573f3b 100644 --- a/docs/cv-redesign/TODO.md +++ b/docs/cv-redesign/TODO.md @@ -22,4 +22,6 @@ Independent review corrections complete: optional contact selection, persistent Actual provider source-boundary suite59/59 passed with stable sources and positive cleanup; five targeted letter axe scans and real403/404 authorization checks passed. Final aggregate browser/contract/volume and Windows/Linux original CV+letter PDF gates remain open. +`final-04` found and retained a preview scroll regression. One-condition selector lifetime fix passed the unchanged two EN/NB recovery scenarios and50 focused editor tests; static build/review pass. Full frontend successor and `final-05` aggregate qualification remain pending. + Historical evidence: Phase 9 conditional acceptance is inherited, not fresh CV-UX test execution. Hosted isolation/production/manual/provider/AI semantic limitations remain open. Research checksum verification: 83/83; screenshot pairs: 37/37; contact sheets inspected locally. Raw third-party imagery stays outside Git/product assets. diff --git a/job-tracker-ui/src/views/CvBuilderEditor.tsx b/job-tracker-ui/src/views/CvBuilderEditor.tsx index 7ea5fd9..a141acb 100644 --- a/job-tracker-ui/src/views/CvBuilderEditor.tsx +++ b/job-tracker-ui/src/views/CvBuilderEditor.tsx @@ -651,7 +651,7 @@ export default function CvBuilderEditor() { {previewBusy ? t("cvEditorUpdatingPreview") : previewReady ? t("cvEditorPageCount", { count: pages }) : null} - {previewReady && pages > 1 && { + {!!html && pages > 1 && { const pane = scrollRef.current; const page = pane?.querySelector(`[data-cv-page="${Number(event.target.value)}"]`); if (pane && page) pane.scrollTop += page.getBoundingClientRect().top - pane.getBoundingClientRect().top;