fix: handle capital keybindings from enhanced keyboard events - #322
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughChangesShifted letter key handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR normalizes enhanced Shift+letter keyboard events so existing uppercase shortcuts work consistently in the main interface and nested browsers; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Normalize enhanced printable Shift+letter events at the start of
Model.handleKey, before global checks or delegation to overlay handlers, so every existingmsg.String()switch receives the same uppercase textual representation used by non-enhanced terminals. Use Bubble Tea's structured key fields to recognize an ASCII letter with an uppercaseShiftedCodeand no usable text, and preserve the original event for lowercase input, non-letter shifted keys, and combinations carrying Ctrl, Alt, or other non-Shift modifiers. Keep the existing shortcut switches and provider mapping unchanged; the normalization belongs at the shared production dispatch boundary rather than in each individual handler.Capital-letter shortcuts such as
YandNdo not fire for the reporter in MacTerm 1.20.9 withTERM=xterm-ghostty, although lowercase shortcuts and shifted shortcuts in another TUI work normally. The thread identifies the concrete mismatch: Bubble Tea's enhanced keyboard reporting can stringify a shifted letter asshift+y, while cliamp's dispatch switches match literal uppercase strings such asY. BecausehandleKeyforwards the original key message into overlay-specific handlers, the same representation mismatch can affect capital shortcuts in both the main player and nested browsers. The issue is open, unassigned, and has no referenced prior or competing pull request.Fixes #286
Screenshots / video
No user-visible surface changes in this PR, so there is nothing to show.
How to test
Checklist
make checkpassesdocs/andsite/index.htmlupdated for user-facing changesSummary by CodeRabbit