Complete S02 application package drafting loop

This commit is contained in:
2026-03-24 10:36:05 +01:00
parent 3e5f796326
commit b5b430947b
14 changed files with 864 additions and 152 deletions
@@ -0,0 +1,53 @@
---
estimated_steps: 4
estimated_files: 3
skills_used:
- react-best-practices
- test
---
# T02: Make the job workspace save and present the application package as real working material
**Slice:** S02 — Stronger AI application package drafting
**Milestone:** M001
## Description
Turn the Tailored CV/application package area into a coherent working loop. The workspace should make it obvious what was generated, what was edited, what was saved to the job, and what can be reused later, instead of feeling like a temporary AI preview pane.
## Steps
1. Update `job-tracker-ui/src/types.ts` if T01 changes the package contract or exposes stronger saved draft/package state.
2. Refine `job-tracker-ui/src/components/JobDetailsDialog.tsx` so generation, editing, saving, and redisplay of application package material feel like one continuous workflow tied to the job.
3. Expand `job-tracker-ui/src/job-details-generated-drafts.test.tsx` to prove the stronger package flow: generate with contextual outputs, edit/save the important draft artifacts, and verify the saved material is reflected back in the dialog state.
4. Keep the UI focused on working material already tied to the job; do not introduce a second competing draft surface or outbound automation.
## Must-Haves
- [ ] The Tailored CV tab clearly presents generated package artifacts as editable, savable job material rather than disposable previews.
- [ ] Saved package edits update dialog state in a way the user can trust and later slices can reuse.
- [ ] The focused React test proves generation and save behavior for the package loop.
## Verification
- `CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/job-details-generated-drafts.test.tsx`
- Confirm the expanded test proves generation, editing, and save-state behavior in the dialog.
## Observability Impact
- Signals added/changed: clearer UI state around generated vs saved package material and stronger test coverage for package-loop regressions.
- How a future agent inspects this: open the Tailored CV tab in `job-tracker-ui/src/components/JobDetailsDialog.tsx` and read `job-tracker-ui/src/job-details-generated-drafts.test.tsx`.
- Failure state exposed: the workspace and test should distinguish generation failure, unsaved edits, and saved package state instead of collapsing them into generic draft text.
## Inputs
- `job-tracker-ui/src/components/JobDetailsDialog.tsx` — existing package-generation and save UI.
- `job-tracker-ui/src/types.ts` — frontend package contracts.
- `JobTrackerApi/Controllers/JobApplicationsController.cs` — T01 package-generation contract.
- `job-tracker-ui/src/job-details-generated-drafts.test.tsx` — current focused dialog test.
## Expected Output
- `job-tracker-ui/src/components/JobDetailsDialog.tsx` — stronger package generation/edit/save flow.
- `job-tracker-ui/src/types.ts` — aligned package contract for the workspace.
- `job-tracker-ui/src/job-details-generated-drafts.test.tsx` — focused frontend proof for the improved package loop.