Task summary
When students review question sets or lecture notes in the in-app PDF viewer on desktop, pressing keyboard shortcuts should navigate pages and dismiss overlays without clicking on-screen buttons.
Estimated scope / difficulty
Starter (1 to 2 hours)
Motivation and context
When viewing assignment PDFs or lecture documents on desktop/laptop keyboards, students need quick keyboard controls to flip through multi-page documents and close views cleanly.
Relevant files and code pointers
src/pages/app/PDFViewerPage.tsx
src/components/ImageZoomModal.tsx
tests/unit/components.test.tsx
Acceptance criteria
Implementation guide and hints
Look at how window keydown event listeners and cleanup functions are implemented in src/components/ImageZoomModal.tsx. Ensure event listeners are attached on mount and cleaned up on unmount.
Task summary
When students review question sets or lecture notes in the in-app PDF viewer on desktop, pressing keyboard shortcuts should navigate pages and dismiss overlays without clicking on-screen buttons.
Estimated scope / difficulty
Starter (1 to 2 hours)
Motivation and context
When viewing assignment PDFs or lecture documents on desktop/laptop keyboards, students need quick keyboard controls to flip through multi-page documents and close views cleanly.
Relevant files and code pointers
src/pages/app/PDFViewerPage.tsxsrc/components/ImageZoomModal.tsxtests/unit/components.test.tsxAcceptance criteria
ArrowRightandArrowDownnavigate to the next page.ArrowLeftandArrowUpnavigate to the previous page.Escapecloses the PDF viewer when open as a modal; when rendered as a standalone page, it navigates back using router history.tests/unit/components.test.tsxverifying keydown event dispatching.npm testandnpm run lintpass with 0 errors.Implementation guide and hints
Look at how window
keydownevent listeners and cleanup functions are implemented insrc/components/ImageZoomModal.tsx. Ensure event listeners are attached on mount and cleaned up on unmount.