Skip to content

Conversation

@kentcdodds
Copy link
Member

@kentcdodds kentcdodds commented Jan 29, 2026

Add s+p+p keyboard shortcut to reset the playground.


Open in Cursor Open in Web


Note

Low Risk
Low risk UI/UX change that tweaks client-side keyboard shortcut sequencing; main risk is accidental triggering or timing edge cases around the updated s+p/s+p+p disambiguation.

Overview
Adds a new keyboard shortcut, s+p+p, to reset the playground to the current exercise and documents it in the keyboard shortcuts dialog.

Updates the playground reset button to advertise data-keyboard-action="s+p+p", and extends the keyboard shortcut handler to distinguish s+p vs s+p+p by briefly waiting for a second p when a reset target exists (falling back to s+p on timeout).

Written by Cursor Bugbot for commit b514c43. This will update automatically on new commits. Configure here.

@cursor
Copy link

cursor bot commented Jan 29, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@nx-cloud
Copy link

nx-cloud bot commented Jan 29, 2026

View your CI Pipeline Execution ↗ for commit b514c43

Command Status Duration Result
nx run-many --target typecheck ✅ Succeeded 10s View ↗
nx run-many --target build ✅ Succeeded <1s View ↗
nx lint ✅ Succeeded 21s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-29 23:25:09 UTC

@kentcdodds kentcdodds marked this pull request as ready for review January 29, 2026 22:32
- Check for s+p+p element existence before immediately clicking s+p to allow s+p+p shortcut to work
- Remove redundant waitingForSecondP reset as spSequence.clear() already handles it via onClear callback

Co-authored-by: me <[email protected]>
@cursor
Copy link

cursor bot commented Jan 29, 2026

Bugbot Autofix resolved both of the 2 bugs found in the latest run.

  • ✅ Fixed: Reset shortcut unreachable when set button exists
    • Added check for s+p+p element existence before immediately clicking s+p, allowing the second p to be processed when both shortcuts are available.
  • ✅ Fixed: Redundant state reset after clear already resets it
    • Removed redundant waitingForSecondP assignment since spSequence.clear() already resets it via the onClear callback.

- Fix s+p shortcut not triggering when s+p+p element exists and timeout expires
- Remove redundant state setting when no target element exists
- Add fallback to trigger s+p action in onClear when waiting for second p times out

Co-authored-by: me <[email protected]>
@cursor
Copy link

cursor bot commented Jan 29, 2026

Bugbot Autofix resolved both bugs found in the latest run.

  • ✅ Fixed: s+p shortcut broken when s+p+p element exists
    • Added fallback logic in onClear callback to trigger s+p action when timeout expires while waiting for second p.
  • ✅ Fixed: Redundant state set when no target element exists
    • Removed pointless waitingForSecondP state setting and replaced with simple sequence clear when no s+p+p element exists.

- Reset waitingForSecondP flag before clearing sequence to prevent onClear callback from triggering unintended s+p action
- Fix inconsistent indentation in s+p handler (lines 260-267 now properly use 3 tabs)

Co-authored-by: me <[email protected]>
@cursor
Copy link

cursor bot commented Jan 29, 2026

Bugbot Autofix resolved 2 of the 2 bugs found in the latest run.

  • ✅ Fixed: Double click triggered on s+p+p shortcut
    • Added reset of waitingForSecondP flag to false before calling spSequence.clear() to prevent the onClear callback from triggering the unintended s+p action.
  • ✅ Fixed: Inconsistent indentation makes code structure unclear
    • Corrected indentation from 2 tabs to 3 tabs for lines 260-267 to match the surrounding code inside the if (e.key === 'p') block.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

The g+s keyboard action doesn't exist in the codebase - removed the unused references that were causing confusion.

Co-authored-by: me <[email protected]>
@kentcdodds kentcdodds merged commit cd79850 into main Jan 30, 2026
10 checks passed
@kentcdodds kentcdodds deleted the cursor/spp-playground-shortcut-a83b branch January 30, 2026 00:06
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.

3 participants