test(S01/T01): Added a job-scoped Gmail matching contract with backend-…

- JobTrackerApi/Controllers/GmailController.cs
- JobTrackerApi/Services/GmailOAuthService.cs
- JobTrackerApi.Tests/GmailControllerTests.cs
- .gsd/milestones/M001/slices/S01/S01-PLAN.md
- .gsd/KNOWLEDGE.md
This commit is contained in:
2026-03-24 12:07:25 +01:00
parent 8890906231
commit 955cae6d4b
15 changed files with 557 additions and 65 deletions
@@ -0,0 +1,39 @@
---
title: T03 summary
status: done
files:
- job-tracker-ui/src/components/JobDetailsDialog.tsx
- job-tracker-ui/src/components/Correspondence.tsx
- job-tracker-ui/src/types.ts
- job-tracker-ui/src/correspondence-gmail-import.test.tsx
verification:
- npm ci (job-tracker-ui)
- CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/correspondence-gmail-import.test.tsx
---
Wired the job-aware Gmail matching contract into the actual job workspace UI.
What changed:
- `job-tracker-ui/src/types.ts`
- added frontend contracts for job-aware Gmail matches, match reasons, import results, and enriched correspondence metadata
- `job-tracker-ui/src/components/JobDetailsDialog.tsx`
- now passes the loaded `job` into `Correspondence` so the Gmail tab can stay job-aware without another job fetch
- `job-tracker-ui/src/components/Correspondence.tsx`
- replaced client-side Gmail ranking as the primary workflow
- Gmail tab now calls `/gmail/job-candidates`
- shows confidence, score, match reasons, and already-linked state
- preserves manual query override via the same job-aware endpoint
- refreshes correspondence plus Gmail candidate state after single-message and thread imports
- renders persisted Gmail metadata (`ExternalThreadId`, `ExternalFrom`, `ExternalTo`) in the correspondence view
- `job-tracker-ui/src/correspondence-gmail-import.test.tsx`
- verifies ranked Gmail suggestions render with visible reasons/confidence
- verifies single-message import refreshes the same jobs correspondence view
- verifies manual search override is sent as `queryOverride`
Verification:
- frontend dependencies were installed with `npm ci` in `job-tracker-ui`
- focused React test passed:
- `CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/correspondence-gmail-import.test.tsx`
Notes:
- The Gmail tab now treats the backend as the source of truth for ranking while keeping the manual search field as a fallback override.