# Slice 7 — Frontend: backups Jobs tab (worker output) ## Files changed | File | Status | Lines | |------|--------|-------| | `frontend/src/pages/service-tabs/JobsTab.tsx` | new | 87 | | `frontend/src/pages/service-tabs/__tests__/JobsTab.test.tsx` | new | 64 | | `frontend/src/pages/service-tabs/index.ts` | modified | +2/-1 (import JobsTab from new file, remove from stubs import) | | `frontend/src/pages/service-tabs/stubs.tsx` | modified | -4 (removed JobsTab stub) | **Total: ~155 changed lines** (151 new files + 6 modified diff). Well under the 400-line budget. ## What was implemented ### 7.1 — JobsTab New file `frontend/src/pages/service-tabs/JobsTab.tsx`: - Accepts `{ instance }: { instance: ServiceInstance }` props. - Lifts the operational content from `components/BackupsPage.tsx`: the Jobs / Runs / Alerts tab structure with the three sub-tables (BackupJobsTable, BackupRunsTable, BackupAlertsTable). - The page heading ("Backups") is dropped since the service page header already renders the instance name + binding name. - All hooks (useBackupJobs, useBackupRuns, useBackupAlerts, useAcknowledgeAlert) are called exactly as in BackupsPage — **globally** (no service_id filtering). The `instance` prop is accepted but currently only referenced via `void instance` since per-instance scoping requires hook changes that are out of scope for this slice. ### 7.2 — Tests + cleanup - New test file `JobsTab.test.tsx`: 2 tests covering sub-tab presence (Jobs, Runs, Alerts via regex match since the label includes the count) and job-name rendering with mocked hooks. - Removed `JobsTabStub` from `stubs.tsx`. - `index.ts` updated to import the real `JobsTab` from `./JobsobsTab` instead of the stub. - `BackupsPage.tsx` and its tests are left intact (Slice 11 cleanup). ## Hooks: instance-scoped or global? **Global.** The backup hooks (`useBackupJobs`, `useBackupRuns`, `useBackupAlerts`) query without a service_id filter. The backend gained `service_id` attribution in Slice 3 (column on `backup_jobs`, `?service_id=` param on report endpoints), but the hooks don't yet accept a serviceId parameter. This tab shows ALL backups data for now. Per-instance scoping by `instance.id` is a documented follow-up (the `void instance` reference and the file docstring both call this out). ## Validation ``` npm run lint → 0 errors, 2 pre-existing warnings (UsersPage.impl.tsx, unrelated) npm run build → ✓ built (tsc -b + vite) npm run test → 30 files / 96 tests passed (was 94; +2 new) ``` ## Deviations from design 1. **Hooks not scoped by instance.id.** The design said "scope queries by `instance.id`" but the hooks (`useBackups.ts`) don't accept a serviceId param. Rewriting the hooks is out of scope for this slice (would touch `api/backups.ts`, `hooks/useBackups.ts`, and the widget source). A comment in the file docstring documents this as a follow-up. 2. **Page heading dropped.** BackupsPage.tsx rendered `