|
735 | 735 | - `TASK-683-issues-summary.md`: P1 status changed from "Mitigation implemented" to "Resolved"; Next Verification Checklist step 1 marked done. |
736 | 736 | - Lint gate: ✓ PASSED. |
737 | 737 | - TypeScript gate: ✓ PASSED. |
| 738 | + |
| 739 | +### Investigate test diagnostic hotspots warning classes |
| 740 | + |
| 741 | +- Input: `TASK-683-test-diag-hotspots-2026-03-25.md` (5 warning classes, 515 total occurrences). |
| 742 | +- Researched all 5 warning classes across the codebase: |
| 743 | + |
| 744 | +#### 1. React Router Future Flag Warning (26 occurrences) |
| 745 | + |
| 746 | +- Partially fixed: `src/setupTests.ts` already mocks `MemoryRouter` with `v7_startTransition` and `v7_relativeSplatPath` flags. |
| 747 | +- Remaining: production `BrowserRouter` in `src/index.tsx` has no future flags set. |
| 748 | +- Fix: add `future={{ v7_startTransition: true, v7_relativeSplatPath: true }}` to `<Router>` in `src/index.tsx`. |
| 749 | + |
| 750 | +#### 2. `act(...)` warnings (173 occurrences) |
| 751 | + |
| 752 | +- Root cause: `fireEvent` calls without `act()` wrapping; async state updates after unmount. |
| 753 | +- Shared helpers `changeValue()` and `clickNth()` in `src/test-support/utils.ts` lack `act()`. |
| 754 | +- Strategy: fix shared helpers first (high-leverage), then audit individual test files, consider migrating to `userEvent`. |
| 755 | + |
| 756 | +#### 3. `validateDOMNesting` (10 occurrences) |
| 757 | + |
| 758 | +- 4 violations: `<div>` in `<tbody>` — `ErrorBoundary` via `withData` wrapping table content in `src/signs/ui/search/SignsSearch.tsx`. |
| 759 | +- 2+2 violations: `<figure>`/`<figcaption>` in `<p>` — `src/markup/ui/markup.tsx` uses `<p>` container for block-level markup content. |
| 760 | +- 1 violation: `<td>` in `<div>` — `LineLemmasContext.Provider` wrapping `<td>` in `src/transliteration/ui/LineAccumulator.tsx`. |
| 761 | + |
| 762 | +#### 4+5. `controlId ignored on FormLabel/FormControl` (153+153 = 306 occurrences) |
| 763 | + |
| 764 | +- React Bootstrap `^2.9.0` warns when `Form.Group` has `controlId` and children also have explicit `htmlFor`/`id`. |
| 765 | +- Key files: `LemmaInput.tsx`, `DateConverterFormField.tsx`, `CuneiformConverterForm.tsx`, plus many more. |
| 766 | +- Fix: remove redundant `htmlFor`/`id` from children (keep `controlId`), or remove `controlId` if manual management is intended. |
| 767 | + |
| 768 | +#### Prioritized fix plan |
| 769 | + |
| 770 | +1. React Router future flags — 1 file change, eliminates 26 warnings. |
| 771 | +2. controlId cleanup — mechanical, eliminates 306 warnings. |
| 772 | +3. validateDOMNesting — targeted structural fixes, eliminates 10 warnings. |
| 773 | +4. act() warnings — largest effort (phased), eliminates 173 warnings. |
| 774 | + |
| 775 | +- Updated `TASK-683-todo.md` with 4 new fix items. |
| 776 | + |
| 777 | +### Fix #1: React Router future flag warnings (26 occurrences) |
| 778 | + |
| 779 | +- Added `future={{ v7_startTransition: true, v7_relativeSplatPath: true }}` to `<Router>` (BrowserRouter) in `src/index.tsx`. |
| 780 | +- Added `{/* eslint-disable-next-line camelcase */}` to suppress camelcase lint error on React Router's snake_case API identifiers. |
| 781 | +- Focused test verification: `src/Header.test.tsx` — 21 tests passed, zero React Router future flag warnings. |
| 782 | +- Lint gate: ✓ PASSED. |
| 783 | +- TypeScript gate: ✓ PASSED. |
| 784 | +- Updated `TASK-683-todo.md`: marked item done. |
0 commit comments