6.3 KiB
The app already has:
- An info modal using native
<dialog>element (reference pattern) - Fixed action buttons (info icon, back-to-top, print, etc.)
- Keyboard shortcuts implemented but not documented
- HTMX-driven interactions with server endpoints
Before starting, read the project documentation to understand the application structure and conventions: @CLAUDE.md @MODERN-WEB-TECHNIQUES.md
Use the architecture agent to thoroughly analyze the codebase and identify ALL keyboard shortcuts and user actions:- Examine documentation to understand application features and architecture
- Review all Go endpoints to identify available actions (toggles, language switching, etc.)
- Search for keyboard event handlers in hyperscript and JavaScript files
- Identify interactive elements (buttons, toggles, forms) and their functions
- Analyze HTMX attributes (hx-post, hx-get) to understand available actions
Create a comprehensive list of:
- Existing keyboard shortcuts (Ctrl+P for print, Ctrl+0 for zoom reset, etc.)
- Actions that could benefit from keyboard shortcuts
- Standard browser shortcuts that work in the app (Ctrl+F for find, etc.)
-
Modal Dialog: Create a keyboard shortcuts help modal
- Use native
<dialog>element (follow info modal pattern) - Display all keyboard shortcuts in organized groups
- Include descriptions of what each shortcut does
- Clean, readable layout with proper spacing
- Use native
-
Shortcuts Organization: Group shortcuts logically
- Navigation shortcuts (scroll, jump to sections)
- View controls (zoom, toggles)
- Actions (print, download)
- Browser shortcuts (search, refresh)
-
Accessibility:
- Proper ARIA labels for the button
- Keyboard navigation (ESC to close, Tab for focus)
- Screen reader friendly descriptions
-
Bilingual Support:
- Spanish and English translations
- Follow existing i18n patterns in the codebase
-
Modal Pattern:
- Use native
<dialog>element (see existing info modal as reference) - Include
::backdropstyling for overlay - Close button with onclick="this.closest('dialog').close()"
- Simple inline onclick for opening:
onclick="document.getElementById('shortcuts-modal').showModal()"
- Use native
-
Button Pattern:
- Follow fixed action button styling
- Use iconify-icon for the keyboard icon (find appropriate icon from mdi: collection)
- Position using existing CSS patterns for action buttons
-
File Structure:
- Create modal template in
./templates/partials/modals/or similar - Add button to appropriate location (likely near info button)
- Update CSS if needed for styling
- Create modal template in
-
NO JavaScript required for basic open/close (use native dialog features)
- Only use inline onclick attributes following existing patterns
- Leverage browser's built-in dialog functionality
WHY these patterns matter:
- Native
<dialog>provides built-in accessibility, focus management, and ESC key handling - Inline onclick keeps code simple and colocated with markup (following project philosophy)
- Consistent styling ensures professional, cohesive UI
- Minimal JavaScript aligns with project's "almost 0 JavaScript" goal
<shortcuts_content> Based on your research, include shortcuts such as (but not limited to):
Zoom Controls:
- Ctrl/Cmd + Plus: Zoom in
- Ctrl/Cmd + Minus: Zoom out
- Ctrl/Cmd + 0: Reset zoom to 100%
Actions:
- Ctrl/Cmd + P: Print friendly version
Browser Shortcuts (mention these too):
- Ctrl/Cmd + F: Find in page
- Ctrl/Cmd + R: Refresh page
Add any other shortcuts discovered during research.
Organize them in a clean table or list format with:
- Shortcut keys (visual representation)
- Description of action
- Bilingual labels (ES/EN) </shortcuts_content>
./templates/partials/modals/shortcuts-modal.html- Keyboard shortcuts modal dialog- Modify the appropriate template to add the keyboard shortcuts button (likely where other action buttons are)
- Update CSS if needed for button positioning and modal styling (follow existing patterns)
Use relative paths and ensure all changes integrate seamlessly with existing code.
Before declaring complete, verify:-
Research Complete:
- Run searches to confirm all keyboard shortcuts are identified
- Check that all major user actions are covered
-
Functionality:
- Button appears in correct position near info icon
- Clicking button opens modal
- ESC key closes modal
- Backdrop click closes modal
- Close button works
-
Visual Integration:
- Button styling matches other action buttons
- Modal styling matches info modal
- Layout is clean and readable
-
Bilingual:
- All text has Spanish and English versions
- Language switching works correctly
-
Accessibility:
- ARIA labels present
- Keyboard navigation works
- Focus management is correct
<success_criteria>
- Keyboard shortcuts help button visible and clickable near info icon
- Modal displays comprehensive list of all keyboard shortcuts
- Modal follows native
<dialog>pattern (like info modal) - All shortcuts organized logically with clear descriptions
- Bilingual support (ES/EN) working correctly
- Zero JavaScript required for basic functionality (native dialog features only)
- Code follows project philosophy and existing patterns </success_criteria>