Skip to content

🎨 Palette: Flashcard Keyboard Shortcuts & Accessibility Hints#93

Merged
godie merged 1 commit into
masterfrom
palette-flashcard-shortcuts-v2-1633578750280856672
May 18, 2026
Merged

🎨 Palette: Flashcard Keyboard Shortcuts & Accessibility Hints#93
godie merged 1 commit into
masterfrom
palette-flashcard-shortcuts-v2-1633578750280856672

Conversation

@godie
Copy link
Copy Markdown
Owner

@godie godie commented May 11, 2026

This PR introduces keyboard shortcuts and visual accessibility hints to the V2 Flashcard Study interface, significantly improving the user experience for repetitive study tasks.

Key Changes:

  1. Keyboard Shortcuts:
    • Space or Enter: Flips the card if it's on the front. If already flipped, it submits a "Bien" (Quality 4) rating.
    • Keys 1, 2, 3, and 4: Directly trigger the corresponding quality ratings (Otra vez, Difícil, Bien, Fácil) when the card is flipped.
    • Input Protection: The shortcuts are automatically disabled when the user is focused on an input or textarea.
  2. Visual Hints & Accessibility:
    • Added visible hints in brackets (e.g., [Espacio], [3]) to button labels to aid shortcut discovery.
    • Enhanced accessibility with descriptive title and aria-label attributes (e.g., "Atajo: 1. Calificar como Otra vez").
  3. Stability & Quality:
    • Corrected hook ordering (useEffect after useCallback) to prevent initialization errors.
    • Added 3 new unit tests to V2FlashcardStudy.test.jsx verifying all shortcut paths.
    • Successfully passed all 365 existing tests and verified visually via Playwright.

These small but impactful changes align with the "Palette" philosophy of adding delight and accessibility through micro-UX improvements.


PR created automatically by Jules for task 1633578750280856672 started by @godie

- Implement global keydown listener for Space/Enter (flip/rate) and 1-4 (SM-2 ratings)
- Add visual hints [Espacio] and [1-4] to buttons for discoverability
- Update aria-label and title attributes for improved accessibility
- Add comprehensive unit tests for keyboard shortcut functionality
- Ensure hook order prevents initialization ReferenceErrors

Co-authored-by: godie <227743+godie@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@godie godie merged commit 654a3c6 into master May 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant