Repository navigation
fix(tui): uppercase Shift + any lowercase letter, not only ASCII - #588
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: LargeModGames/spotatui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughShift-modified lowercase characters now convert to uppercase when the uppercase mapping contains exactly one character. Tests cover ASCII and non-ASCII letters, multi-character uppercase mappings, and already-uppercase input. ChangesShift key conversion
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to Shift-modified lowercase Unicode letters can use their single-character uppercase bindings, while multi-character mappings remain unchanged. No actionable merge risk remains beyond normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 3 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The SHIFT arm of the crossterm key conversion only uppercased ASCII letters, so on terminals that send Shift+ö as `ö` with SHIFT held, an `Ö` binding never fired. Uppercase any lowercase letter whose uppercase is a single char, keep `ß` (uppercase `SS`) as is, and add the first tests for key.rs. Fixes LargeModGames#553 Co-Authored-By: Claude Opus 5.5 <[email protected]>
37535eb to
74e63f5
Compare
Summary
Fixes #553. The SHIFT arm of
impl From<event::KeyEvent> for Keyonly uppercased ASCII letters. It now uppercases any lowercase letter whose uppercase is a single char, so Shift+ögivesÖand Shift+égivesÉ.ß(uppercaseSS) staysß.Adds the first tests for
key.rs, with the cases from the issue:ö+ SHIFT givesÖ,é+ SHIFT givesÉß+ SHIFT staysßp+ SHIFT still givesPÖ+ SHIFT staysÖtest_attribute_totalgoes from 2291 to 2295. Rebased on top of #587, which touched the same two lines intools/gates.countand the[Unreleased]changelog.Testing
cargo fmt --all -- --check: cleancargo clippy --no-default-features --features telemetry,tui -- -D warnings: cleancargo test --no-default-features --features telemetry,tui: 1266 passed, 0 failed (after the rebase)cargo test --no-default-features --features telemetry,tui shift_with_a_lowercase: 1 passedshift_with_a_lowercase_non_ascii_letter_gives_its_uppercase_charfails and the other three pass.Additional notes
I tried to reproduce this on a real terminal: Ghostty 1.3.1 on macOS, with the same keyboard enhancement flags spotatui pushes (the probe reported the protocol as on). With a US (ABC) layout, in the English input mode:
Char('P')with SHIFT, notChar('p')with SHIFTChar('É')with no modifierswith ALT rather thanßSo I couldn't hit the lowercase-plus-SHIFT case on Ghostty with a US layout. It may still show up on other terminals (#141) or on layouts with a physical ö key, which I don't have. The fix doesn't change anything for the events above.
I wrote this with an AI coding assistant and reviewed the change myself.
🤖 Generated with Claude Code