Commit 7a2b9dd
fix(workspace): persist parsed résumé pre-analysis + raise job page_size 12→50
Two issues from user testing:
1. "Every query returns exactly 12 jobs" — NOT an RPC/corpus cap. The
search call in WorkspaceShell hardcoded `page_size: 12` (earlier
grep missed it — it's the shell handler, not JobSearch.tsx).
Backend already allows up to 50. Set to 50; resolves the
exactly-12 mystery and the page_size decision in one line.
2. Parsed résumé lost on reload. Root cause: the workspace autosave
only fires once an analysis exists (`!analysisState → return`), so
a parsed-résumé-only state was never persisted; the
resume-builder, by contrast, autosaves every turn. Fix brings the
upload path to parity WITHOUT destabilising the working
post-analysis save:
- New ADDITIVE effect persists a minimal snapshot the moment a
résumé parses (signed-in, no analysis yet). It calls
`saveWorkspaceSnapshot` DIRECTLY, never `persistLatestWorkspace`
(which sets workspaceSaveMeta and would gate-block the analysis
autosave) — so the analysis path is wholly untouched. Ref-guarded
by résumé identity (one save per distinct parse, best-effort,
retry on failure). Single-row upsert ⇒ a later analysis save
cleanly supersedes the provisional row.
- `applySavedWorkspaceSnapshot` gains a résumé-only early-return:
a real analysis snapshot always has job_description.raw_text; a
résumé-only one has job_description:{}. Without this, restoring a
résumé-only snapshot would `setAnalysisState({})` and render a
broken empty "analysis" — worse than the original bug.
- No backend change: `_validate_workspace_snapshot` already accepts
the 5 required sections as empty {} (only checks isinstance dict);
single upsert per user_id. New hermetic test
(test_workspace_snapshot_validation.py, 7 cases) pins that
contract so a future tightening can't silently regress this.
Verified: backend contract test green; tsc + eslint clean. The authed
restore UX (sign in → parse → reload → résumé back, no empty-analysis)
can't be fully runtime-tested locally (authed flow) — eyeball on prod
after deploy. Frontend + test only; no backend code change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ba047b6 commit 7a2b9dd
2 files changed
Lines changed: 156 additions & 1 deletion
File tree
- frontend/src/components/workspace
- tests/backend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
781 | 782 | | |
782 | 783 | | |
783 | 784 | | |
784 | | - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
785 | 788 | | |
786 | 789 | | |
787 | 790 | | |
| |||
963 | 966 | | |
964 | 967 | | |
965 | 968 | | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
966 | 988 | | |
967 | 989 | | |
968 | 990 | | |
| |||
1622 | 1644 | | |
1623 | 1645 | | |
1624 | 1646 | | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1625 | 1704 | | |
1626 | 1705 | | |
1627 | 1706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
0 commit comments