|
19 | 19 |
|
20 | 20 | **Purpose**: Add the `DiffLine` and `DiffLineResult` types and the pure `segmentsToLines` utility that all subsequent tasks depend on. |
21 | 21 |
|
22 | | -- [ ] T001 Add `DiffLine` interface and `DiffLineResult` interface (extends `DiffResult`) to src/types/diff.ts |
23 | | -- [ ] T002 [P] Write unit tests for `segmentsToLines` utility in src/utils/segmentsToLines.test.ts (unchanged lines, removed lines, added lines, mixed segments, multi-line segments split by `\n`, single-line input, empty segments, segments ending with newline) |
24 | | -- [ ] T003 [P] Implement `segmentsToLines` pure function in src/utils/segmentsToLines.ts (iterate segments, split by `\n`, track original/modified line counters, emit DiffLine per output line) |
| 22 | +- [x] T001 Add `DiffLine` interface and `DiffLineResult` interface (extends `DiffResult`) to src/types/diff.ts |
| 23 | +- [x] T002 [P] Write unit tests for `segmentsToLines` utility in src/utils/segmentsToLines.test.ts (unchanged lines, removed lines, added lines, mixed segments, multi-line segments split by `\n`, single-line input, empty segments, segments ending with newline) |
| 24 | +- [x] T003 [P] Implement `segmentsToLines` pure function in src/utils/segmentsToLines.ts (iterate segments, split by `\n`, track original/modified line counters, emit DiffLine per output line) |
25 | 25 |
|
26 | 26 | **Checkpoint**: `DiffLine` type exists, `segmentsToLines` is tested and working. |
27 | 27 |
|
|
33 | 33 |
|
34 | 34 | **β οΈ CRITICAL**: No user story work can begin until this phase is complete. |
35 | 35 |
|
36 | | -- [ ] T004 Update `useDiff` hook to call `segmentsToLines` and return `DiffLineResult` (with `lines` field) in src/hooks/useDiff.ts |
37 | | -- [ ] T005 Update `useDiff` tests to verify `lines` output includes correct line numbers for all three diff methods in src/hooks/useDiff.test.ts |
38 | | -- [ ] T006 Update `DiffViewerProps` to accept `DiffLineResult` instead of `DiffResult` in src/components/DiffViewer/DiffViewer.types.ts |
| 36 | +- [x] T004 Update `useDiff` hook to call `segmentsToLines` and return `DiffLineResult` (with `lines` field) in src/hooks/useDiff.ts |
| 37 | +- [x] T005 Update `useDiff` tests to verify `lines` output includes correct line numbers for all three diff methods in src/hooks/useDiff.test.ts |
| 38 | +- [x] T006 Update `DiffViewerProps` to accept `DiffLineResult` instead of `DiffResult` in src/components/DiffViewer/DiffViewer.types.ts |
39 | 39 |
|
40 | 40 | **Checkpoint**: `useDiff` returns line-based output with correct line numbers, `DiffViewer` types updated. |
41 | 41 |
|
|
51 | 51 |
|
52 | 52 | > **NOTE: Write these tests FIRST, ensure they FAIL before implementation** |
53 | 53 |
|
54 | | -- [ ] T007 [P] [US1] Write unit tests for unified view line number rendering in src/components/DiffViewer/DiffViewer.test.tsx (gutter renders two columns with correct line numbers, removed lines show original number only, added lines show modified number only, unchanged lines show both, gutter is aria-hidden, gutter uses TextInput gutter styling classes) |
55 | | -- [ ] T008 [P] [US1] Write integration tests for unified view line numbers in src/components/App/App.test.tsx (line numbers appear when diff is displayed, line numbers correct across diff method changes) |
| 54 | +- [x] T007 [P] [US1] Write unit tests for unified view line number rendering in src/components/DiffViewer/DiffViewer.test.tsx (gutter renders two columns with correct line numbers, removed lines show original number only, added lines show modified number only, unchanged lines show both, gutter is aria-hidden, gutter uses TextInput gutter styling classes) |
| 55 | +- [x] T008 [P] [US1] Write integration tests for unified view line numbers in src/components/App/App.test.tsx (line numbers appear when diff is displayed, line numbers correct across diff method changes) |
56 | 56 |
|
57 | 57 | ### Implementation for User Story 1 |
58 | 58 |
|
59 | | -- [ ] T009 [US1] Restructure unified view rendering in src/components/DiffViewer/DiffViewer.tsx from inline spans to row-based layout with two-column gutter (original | modified) using TextInput gutter style classes (`bg-gray-50 dark:bg-gray-800`, `text-right font-mono text-sm leading-6 text-gray-400 dark:text-gray-500`, `select-none`, `aria-hidden="true"`) |
60 | | -- [ ] T010 [US1] Update App component to pass `DiffLineResult` to `DiffViewer` in src/components/App/App.tsx (type change only β `useDiff` already returns the new type after T004) |
| 59 | +- [x] T009 [US1] Restructure unified view rendering in src/components/DiffViewer/DiffViewer.tsx from inline spans to row-based layout with two-column gutter (original | modified) using TextInput gutter style classes (`bg-gray-50 dark:bg-gray-800`, `text-right font-mono text-sm leading-6 text-gray-400 dark:text-gray-500`, `select-none`, `aria-hidden="true"`) |
| 60 | +- [x] T010 [US1] Update App component to pass `DiffLineResult` to `DiffViewer` in src/components/App/App.tsx (type change only β `useDiff` already returns the new type after T004) |
61 | 61 |
|
62 | 62 | **Checkpoint**: User Story 1 is fully functional β unified view shows line number gutters, all tests pass. |
63 | 63 |
|
|
73 | 73 |
|
74 | 74 | > **NOTE: Write these tests FIRST, ensure they FAIL before implementation** |
75 | 75 |
|
76 | | -- [ ] T011 [P] [US2] Write unit tests for side-by-side line number rendering in src/components/DiffViewer/DiffViewer.test.tsx (each column has a gutter, original column shows original line numbers, modified column shows modified line numbers, placeholder rows have faint gray background and no line number, gutter is aria-hidden) |
77 | | -- [ ] T012 [P] [US2] Write integration tests for side-by-side line numbers in src/components/App/App.test.tsx (line numbers appear in side-by-side mode, placeholder rows render correctly) |
| 76 | +- [x] T011 [P] [US2] Write unit tests for side-by-side line number rendering in src/components/DiffViewer/DiffViewer.test.tsx (each column has a gutter, original column shows original line numbers, modified column shows modified line numbers, placeholder rows have faint gray background and no line number, gutter is aria-hidden) |
| 77 | +- [x] T012 [P] [US2] Write integration tests for side-by-side line numbers in src/components/App/App.test.tsx (line numbers appear in side-by-side mode, placeholder rows render correctly) |
78 | 78 |
|
79 | 79 | ### Implementation for User Story 2 |
80 | 80 |
|
81 | | -- [ ] T013 [US2] Restructure side-by-side view rendering in src/components/DiffViewer/DiffViewer.tsx from inline spans to row-based layout with single-column gutter per side, placeholder rows with `bg-gray-100 dark:bg-gray-800` for missing lines |
| 81 | +- [x] T013 [US2] Restructure side-by-side view rendering in src/components/DiffViewer/DiffViewer.tsx from inline spans to row-based layout with single-column gutter per side, placeholder rows with `bg-gray-100 dark:bg-gray-800` for missing lines |
82 | 82 |
|
83 | 83 | **Checkpoint**: User Stories 1 AND 2 both work independently β unified and side-by-side views both show line numbers. |
84 | 84 |
|
|
88 | 88 |
|
89 | 89 | **Purpose**: Final quality pass. |
90 | 90 |
|
91 | | -- [ ] T014 [P] Accessibility audit β verify `aria-hidden` on all gutters, keyboard tab order unaffected, screen reader does not announce line numbers |
92 | | -- [ ] T015 Run all quality gates: `npm run lint`, `npm run lint:tsc`, `npm run test:ci`, `npm run build` |
93 | | -- [ ] T016 Run quickstart.md validation β follow all steps in specs/003-diff-line-numbers/quickstart.md and verify they work end-to-end |
| 91 | +- [x] T014 [P] Accessibility audit β verify `aria-hidden` on all gutters, keyboard tab order unaffected, screen reader does not announce line numbers |
| 92 | +- [x] T015 Run all quality gates: `npm run lint`, `npm run lint:tsc`, `npm run test:ci`, `npm run build` |
| 93 | +- [x] T016 Run quickstart.md validation β follow all steps in specs/003-diff-line-numbers/quickstart.md and verify they work end-to-end |
94 | 94 |
|
95 | 95 | --- |
96 | 96 |
|
|
0 commit comments