Skip to content

Paste Special: every option has its Excel access key (fixes #1482) - #3240

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
hectorviov:fix/paste-special-access-keys
Nov 3, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
hectorviov:fix/paste-special-access-keys

Conversation

@hectorviov

@hectorviov hectorviov commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1482

What

GridCraft's Paste Special dialog knew only five letter shortcuts: F, V, T, C and E. Excel has an access key for every option. crates/ui-egui/src/dialogs/paste.rs now has one table that maps each letter to what it does:

Group Keys
Paste A All, F Formulas, V Values, T Formats, C Comments and notes, N Validation, X All except borders, W Column widths, R Formulas and number formats, U Values and number formats
Operation O None, D Add, S Subtract, M Multiply, I Divide
Check boxes B Skip blanks, E Transpose (each press flips the box)
Button L Paste Link, which pastes at once like the button

Enter still pastes with the chosen options. The rules for when a letter counts are unchanged: no Ctrl/Cmd, not while a text box has focus, and AltGr / Option keep typing characters.

Comparison

Key in Paste Special GridCraft main (178f3eb) GridCraft with this PR Excel
F, V, T, C, E work work work
A, N, X, W, R, U, O, D, S, M, I, B nothing choose / flip their option choose / flip their option
L nothing pastes the link, dialog closes Paste Link

The Excel letters are the ones in the issue's screenshot of the Windows dialog, plus A (All) and O (None), which Excel underlines too. Excel for Mac's Paste Special has no access keys, so I couldn't observe them there.

Tests

  • paste_special_dialog::every_option_has_its_excel_access_key (ui-egui, real key events): each new letter sets its option, B toggles twice, then V and Enter pastes the values multiplied, and L pastes a link at once. It fails on main at the first new key (N).
  • The existing Paste Special tests pass unchanged. cargo xtask ci passes.

Anything a reviewer should look at first

  • I didn't add "(N)"-style suffixes to the new options' labels, as "Formulas (F)" has. Those labels ("Validation", "Column widths", …) are translated in 7 interface catalogs, and new label strings would drop the translations. If you'd like the letters shown, an underline drawn for the access key would avoid that.
  • docs/ui-parity.md gets a change note and a revision row.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Paste Special now supports keyboard access keys for its paste options and operations, including Skip blanks, Transpose, and Paste Link.
    • Use the available keys to select paste settings, toggle Skip blanks, or apply Paste Link directly from the dialog.

Paste Special only knew the letters F, V, T, C and E. Excel gives every
option one: A (All), N (Validation), X (All except borders), W (Column
widths), R (Formulas and number formats), U (Values and number formats);
O, D, S, M, I for the operations; B for Skip blanks; and L for the
Paste Link button, which pastes at once. One table now maps each letter
to what it does; Enter still pastes with the chosen options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Paste Special now supports Excel access keys for paste options, operations, Skip blanks, Transpose, and Paste Link. The dialog maps keys to selections or toggles, and handles Paste Link using its existing settings.

Changes: Paste Special keyboard access

Layer / File(s) Summary
Map and handle access keys
crates/ui-egui/src/dialogs/paste.rs, crates/ui-egui/tests/it/paste_special_dialog.rs, docs/ui-parity.md
The shortcut handler maps access keys to paste option selections and checkbox toggles. The Paste Link key queues an action that the dialog consumes to apply its existing Link settings. Integration tests cover key selection, toggling, and submission. The parity document records the access keys.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: aiongg, prxnvt

Merge Risk: Minimal · up to c35ab

Paste Special gains keyboard access keys. No merge-blocking issue was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding Excel access keys for every supported Paste Special option. The issue reference is relevant.
Linked Issues check Passed Directly linked issue #1482 asks for Excel access keys in Paste Special for N (Validation), W (Column widths), X (All except borders), R (Formulas and number formats), U (Values and number formats), M…
Out of Scope Changes check Passed All changes relate to #1482. paste.rs adds the access-key table, the Paste Link handling and the key-to-action dispatch that replaces the old match. It also keeps the existing modifier and text-focus …
Full details: Linked Issues check

Explanation

Directly linked issue #1482 asks for Excel access keys in Paste Special for N (Validation), W (Column widths), X (All except borders), R (Formulas and number formats), U (Values and number formats), M (Multiply), I (Divide), D (Add), S (Subtract), B (Skip blanks) and L (Paste link). The reviewed head implements each of these in mnemonic_action in crates/ui-egui/src/dialogs/paste.rs: N, W, X, R, U map to what values; D, S, M, I, O map to operation values; B toggles skipBlanks; L sets PASTE_LINK_NOW, which the Paste Link button branch reads and pastes at once. The existing F, V, T, C, E keys keep their behavior. The issue also lists H (All using source theme), but the issue states that feature is not implemented yet, so no H requirement applies to this PR. The added test every_option_has_its_excel_access_key covers the new keys with key events, per the PR description. I did not run the test. The PR also adds A and O, which the issue does not list, and this does not conflict with the issue requirements.

Full details: Out of Scope Changes check

Explanation

All changes relate to #1482. paste.rs adds the access-key table, the Paste Link handling and the key-to-action dispatch that replaces the old match. It also keeps the existing modifier and text-focus filters. The ui-egui integration test covers the new keys. docs/ui-parity.md gets a dated change note and revision row that describe the same access-key set. The refactor of the existing T/V/F/C/E handling into the shared table is needed to add the new keys and keeps the old behavior. No unrelated functional change appears in the diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/go/security/ssrf-http-newrequest-tainted-url-go.yml

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.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 178f3eb and c35ab0f.

Files selected for processing: 3
  • crates/ui-egui/src/dialogs/paste.rs
  • crates/ui-egui/tests/it/paste_special_dialog.rs
  • docs/ui-parity.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.

@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 85f09f0 into storytold:main Nov 3, 2026
1 check passed
@echelon

echelon commented Nov 3, 2026

Copy link
Copy Markdown
Member

Merged — thank you @hectorviov for the contribution!

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.

Missing keyboard shortcuts in Paste Special dialog

3 participants