fix(career): preserve edits during polling
CI and Deploy / test (pull_request) Failing after 2m59s
CI and Deploy / deploy (pull_request) Has been skipped

Refresh extraction runs without reloading controlled profile fields. Keep stored-profile AI actions gated until pending edits are saved.
This commit is contained in:
cesnimda
2026-08-15 13:49:58 +02:00
parent 998ee07a9a
commit d424633f95
8 changed files with 136 additions and 45 deletions
@@ -1,6 +1,6 @@
# CAREER-001 Career Workspace redesign
Updated: 2026-08-09
Updated: 2026-08-15
Status: `IMPLEMENTED — NOT VERIFIED`. State-focused component tests, the full frontend suite and the production build pass. Browser and production checks remain.
@@ -22,18 +22,26 @@ Status: `IMPLEMENTED — NOT VERIFIED`. State-focused component tests, the full
- Anchor targets use scroll margins; action navigation is native keyboard-focusable links. The grid collapses at small widths.
- Existing profile persistence, extraction diff, low-confidence selection, Apply/Discard approval and version restore behavior are unchanged.
## Edit-persistence correction
- Active CV processing used to poll by calling the full profile loader every four seconds. That replaced `structuredCv` and raw CV text with the last saved API response, so any controlled input could appear editable and then reset.
- Profile/account loading and extraction-run loading are now separate. Initial load and explicit restore/apply still refresh authoritative profile data; background polling, queue, cancel, retry and discard refresh run status only.
- Every career-profile editor mutation now sets a shared unsaved state. The UI shows this state, prevents imported changes from overwriting it, and prevents rebuild/improve actions from using stale server-side profile text.
- The import pipeline already follows the proposed hybrid design: Python/local libraries extract PDF/DOCX/image text, Ollama is the default local normalizer/classifier, then deterministic C# normalization, plausibility checks, diffing and explicit review return validated structured data to the system. An LLM does not replace binary parsing/OCR because that would be slower, less deterministic and less safe.
## Verification
- Focused Career Workspace and Career Profile: 2 suites, 16/16 tests.
- Focused Career Workspace and Career Profile: 2 suites, 17/17 tests.
- State coverage includes first-run, returning/incomplete profile, recent general/job-specific CVs, queued processing, pending review, failure, loading and load error.
- Existing pending-review test proves changes are applied only after the explicit accept request.
- Full frontend: 49/49 suites, 178/178 tests.
- Production frontend build and TypeScript: pass.
- C# extraction/diff regressions: 8/8 pass. AI-sidecar extraction/routing contract: 22/22 pass (global Python environment; the repository `.venv` does not contain pytest).
- `git diff --check`: pass apart from repository line-ending notices.
## Remaining gates
- Browser tooling was finalized earlier in this session, so CAREER-001 was not inspected in a running browser. Required 375/768/1440, Light/Dark, keyboard/focus, Norwegian and rendered error/processing checks remain.
- Required 375/768/1440, Light/Dark, keyboard/focus, Norwegian and rendered error/processing checks remain for this latest correction.
- Synthetic-account production smoke and deployed route/anchor behavior remain unavailable without production access.
- The saved-job path explains where a job-specific CV is managed; the deeper CV Builder/application interaction redesign remains CAREER-002/JOBS-001 scope.