@@ -261,14 +261,37 @@ The application has two main pages:
261261
262262### Keyboard Shortcuts
263263
264+ #### Navigation Shortcuts
265+ * `h` or `←` (Left Arrow): Navigate to previous game in the folder structure
266+ * `l` or `→` (Right Arrow): Navigate to next game in the folder structure
264267* `p` (lowercase): Open game picker in same tab (from viewer)
265268* `P` (uppercase): Open game picker in new tab (from viewer)
269+
270+ #### Interface Shortcuts
271+ * `?`: Show keyboard shortcuts help modal (available on both viewer and picker pages)
266272* `t` (lowercase): Toggle floating table of contents
267273* `Ctrl/Cmd + D`: Toggle dark/light mode
268274* `Ctrl/Cmd + E`: Expand all sections
269275* `Ctrl/Cmd + Shift + E`: Collapse all sections
270276* `Escape`: Close all open sections
271277
278+ ### Keyboard Shortcuts Help Modal
279+
280+ Both the viewer and picker pages include a help modal accessible via the `?` button or `?` keyboard shortcut:
281+
282+ #### Modal Features
283+ * **Trigger**: `?` button in header or `?` keyboard shortcut
284+ * **Content**: Displays all available keyboard shortcuts organized by category
285+ * **Styling**: Bootstrap modal with consistent dark theme styling
286+ * **Dismissal**: Click outside modal, press Escape, or click close button
287+ * **Responsive**: Adapts to mobile screens appropriately
288+
289+ #### Modal Content Structure
290+ * **Navigation Shortcuts**: Game navigation (h/←, l/→, p/P)
291+ * **Interface Shortcuts**: UI controls (?/t, Ctrl+E combinations, Escape)
292+ * **Mouse Shortcuts**: Click behaviors and multi-click actions
293+ * **Page-Specific Shortcuts**: Different content for viewer vs picker pages
294+
272295### Floating Navigation
273296
274297* **Floating Table of Contents**: A floating navigation panel that provides quick navigation (always visible by default)
@@ -296,6 +319,12 @@ The application has two main pages:
296319
297320## Game Picker Design (`/picker`)
298321
322+ ### Header
323+
324+ * **Help button**: `?` button that shows keyboard shortcuts modal (same functionality as viewer page)
325+ * **Title**: "Pick a Game" with game controller icon
326+ * **Description**: Brief explanation of the picker functionality
327+
299328### Features
300329
301330* **Hierarchical Tree Structure**: Shows all folders recursively with proper indentation
@@ -341,10 +370,18 @@ The application has two main pages:
341370
342371### Header
343372
344- * **"Pick Game" button**: Navigate to picker (supports middle-click for new tab)
373+ #### Navigation Controls
374+ * **Previous/Next Game Buttons**: Navigate between games in alphabetical order within the folder structure
375+ - **Previous button**: Shows `h` and `←` keyboard shortcut indicators, disabled when no previous game available
376+ - **Next button**: Shows `l` and `→` keyboard shortcut indicators, disabled when no next game available
377+ - **Button styling**: Uses Bootstrap secondary button styling, similar to Pick Game button
378+ * **"Pick Game" button**: Navigate to picker (supports middle-click for new tab) - positioned in the center between navigation buttons
345379 - Shows `p` keyboard shortcut indicator
346380 - Tooltip explains middle-click functionality
347381* **"↗" button**: Always open picker in new tab
382+ * **Help button**: `?` button that shows keyboard shortcuts modal (available on both viewer and picker pages)
383+
384+ #### Other Header Elements
348385* **Dark/light mode toggle button**
349386* **Current folder path display** with copy functionality, move/rename button, and delete button
350387 - **Move/Rename button**: 📁 icon that opens a dialog for moving or renaming the experiment folder (exact same functionality as in the game picker)
@@ -568,6 +605,25 @@ Both the game picker and trajectory viewer include move/rename functionality for
568605- After successful move/rename in the trajectory viewer, the user is automatically redirected to the new folder path
569606- The move/rename button appears in the folder path section alongside copy and delete buttons
570607
608+ ## Navigation Implementation Details
609+
610+ ### Game Navigation Logic
611+ * **Navigation Order**: Games are sorted alphabetically by their folder path within the logs directory
612+ * **Backend Function**: `get_navigation_info(selected_folder)` determines previous/next games
613+ * **Button States**: Navigation buttons are automatically disabled when no previous/next game is available
614+ * **URL Generation**: Supports both dynamic Flask routes (`/?folder=`) and static frozen routes (`/game/`)
615+
616+ ### Keyboard Shortcut Implementation
617+ * **Event Handling**: Single consolidated keyboard event listener to prevent conflicts
618+ * **Input Field Detection**: Shortcuts are disabled when typing in input fields or textareas
619+ * **Modal Priority**: Dialog shortcuts (Escape/Enter) take precedence when modals are open
620+ * **Arrow Key Support**: Both letter keys (h/l) and arrow keys (←/→) work for navigation
621+
622+ ### Button Layout
623+ * **Header Organization**: Navigation buttons (Previous, Pick Game, Next, Help) in logical left-to-right order
624+ * **Consistent Styling**: All buttons use Bootstrap classes with consistent kbd shortcut indicators
625+ * **Responsive Design**: Button layout adapts appropriately on mobile devices
626+
571627### Important
572628
573629* Always use the player name from the metadata.json file, do not assume players are called p1, p2, etc.
0 commit comments