Something to revisit in the document viewer work
`Controls.tsx` and `usePageFind.ts` both independently manage highlight state (focused index, highlights array, pending state) and implement the same fetch-then-step-through pattern. `Controls` always hits `/search`, `usePageFind` always hits `/find`.
Recommendation: Consolidate into a single shared hook parameterised by endpoint, removing the duplication. This is closely related to #669 (search vs find endpoint clarification).
Files involved:
- `frontend/src/js/components/PageViewer/Controls.tsx`
- `frontend/src/js/components/PageViewer/usePageFind.ts`
Something to revisit in the document viewer work
`Controls.tsx` and `usePageFind.ts` both independently manage highlight state (focused index, highlights array, pending state) and implement the same fetch-then-step-through pattern. `Controls` always hits `/search`, `usePageFind` always hits `/find`.
Recommendation: Consolidate into a single shared hook parameterised by endpoint, removing the duplication. This is closely related to #669 (search vs find endpoint clarification).
Files involved: