Repository navigation
fix(keyboard): Ctrl with the numpad's + inserts rows, columns or cells, as in Excel - #2769
Conversation
…s, as in Excel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QJaF5jevKidVoJcnTyBFub
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shortcut handling and coverage crates/ui-egui/src/ribbon/shortcuts.rs, crates/ui-egui/tests/it/whole_line_shortcuts.rs, docs/ui-parity.md |
The handler accepts unshifted Key::Plus while Key::Equals still requires Shift. Tests cover row insertion and confirm that unshifted Ctrl+= leaves the selected row unchanged. The parity document lists Ctrl+numpad-plus as an insertion shortcut. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers: aiongg
Merge Risk: 
Minimal · up to 0688e
-
The shortcut change appears mergeable after normal checks. A physical-numpad check remains useful but is not an established blocker.
Pre-merge checks: 
5
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Landed in main (75f7056). Thank you for the contribution, @RomanLis91! If you haven't already, come join us on Discord: https://discord.gg/artcraft |
Change
In Excel, Ctrl with the numpad's + does the same as Ctrl+Shift+=: with whole rows or columns selected it inserts them, otherwise it opens the Insert dialog. In GridCraft it did nothing.
The cause is that egui-winit reports NumpadAdd as
Key::Pluswithout Shift, andribbon::shortcutonly matchedKey::Plus | Key::Equalswhen Shift was held. NowKey::Plusmatches with or without Shift.Key::Equalsstill needs Shift, so Ctrl+= stays unbound.Reading the code, this probably also reaches layouts whose main block types + without Shift (Nordic, or a German keyboard with Cmd on a Mac), where Ctrl with that key now inserts too. German Excel uses Strg++ for Insert too (#1440's table), so I kept that, but I have not tried a non-US layout. This implements the numpad item of #1440. #1385 is related: its
us_keymaps a typed + to Shift+=, but it does not cover the numpad'sKey::Plus.crates/ui-egui/src/ribbon/shortcuts.rs: the guard is nowshift || key == Key::Plus.crates/ui-egui/tests/it/whole_line_shortcuts.rs:numpad_plus_inserts_without_shift(whole row 2 selected, Ctrl+Plus with no Shift inserts a row) andunshifted_equals_inserts_nothing.docs/ui-parity.md: the shortcut row, the timestamp line and a revision history line.Testing
cargo test -p gridcraft-ui-egui --test it -- whole_line keyboard_shortcuts: 18 passed.if shift,numpad_plus_inserts_without_shiftfails and the other tests pass, so the new test does catch the bug.cargo fmt --all -- --checkis clean.cargo clippy -p gridcraft-ui-egui --all-targetsreports no lint warnings.cargo xtask ci, or a manual check with a physical numpad in a built app.🤖 Generated with Claude Code
https://claude.ai/code/session_01QJaF5jevKidVoJcnTyBFub
Summary by CodeRabbit