Repository navigation
Add initial Alt ribbon keytips and legacy shortcuts (#33) - #43
Conversation
justinjohn0306
left a comment
There was a problem hiding this comment.
Review of PR #43 against Issue #49 symptoms
Issue #49 reports that "keyboard shortcut hints do not display when pressing alt" and describes four expected behaviors from Excel:
Coverage Analysis
✅ (a) Alt shows tab indicators (H/N/P/Q)
Covered. PR #43 implements KeyTips state machine that activates on Alt/F10 and paints keytips. The README shows keytips appear on the Home tab ("H"), and the code registers it via keytip(app, ui, "H", ...) in ribbon.rs:170. The implementation handles the Alt press/release toggle (lines 59-68 in keytips.rs).
However, PR #43 only implements the Home ("H") tab fully. The README explicitly states: "This is initial support for these Home and legacy paths; other ribbon commands and full mouse-free navigation remain to be implemented." So Insert ("N"), Page Layout ("P"), and other tabs mentioned in #49 are not yet implemented — their keytips won't appear.
✅ (b) Second Alt toggles indicators off
Covered. keytips.rs:31-34 implements toggle() which clears prefix if active or sets it to Some("") if off. The Alt key handler at line 65-67 calls self.toggle() when alt_armed is true on release. Test escape_backs_out_without_clearing_copy_and_f10_toggles_off at keytips.rs:221-223 confirms F10 toggles off, and the same logic applies to Alt.
⚠️ (c) Alt+N reveals sub-menu indicators (V for Pivot Table, T for Table)
Partially covered. PR #43 implements the mechanism for sub-menu keytips: after selecting a tab the prefix becomes "H", and Home's controls register nested keytips like "HAL" (Align Left), "HVS" (Paste Special), "HOI" (AutoFit). The keytip() helper paints hints only when app.keytips.prefix() matches the sequence prefix (line 250), so multi-level navigation works.
However, Insert tab ("N") is not implemented — it's not in the match next.as_str() cases in keytips.rs:95-106. The example in #49 (Alt+N → V/T for Pivot Table/Table) won't work because PR #43 has no code for Insert ribbon items. The framework is ready; the Insert tab's keytips are simply deferred.
❌ (d) Alt+Q search bar missing
Not covered. PR #43 does not implement Alt+Q search. There's no "Q" case in the keytip matching logic, no search bar UI, and the README makes no mention of it. Issue #49's comment "the alt + q search bar is also missing altogether" is still true after PR #43.
Summary
PR #43 addresses the core Alt keytip system (#49 symptoms a, b, and the multi-level mechanism for c), but only populates the Home tab and three legacy paths (E, O, OC → Home menus). The Insert tab example from #49 (Alt+N → V/T) and the Alt+Q search are explicitly deferred as "to be implemented."
For issue #49 to be fully resolved:
- Other ribbon tabs (Insert "N", Page Layout "P", Data "A", etc.) need their keytips and commands registered
- Alt+Q search bar needs implementation (both the search UI and the "Q" keytip)
PR #43's own description acknowledges this: "other ribbon paths remain unimplemented." It's a solid foundation for #49, not a complete resolution. The issue should remain open with PR #43 noted as "partial — Home tab done, other tabs + Alt+Q search deferred."
Test Coverage
PR #43 includes 306 lines of integration tests (crates/ui-egui/tests/keytips.rs) covering Alt/F10 toggle, sequences (H A L/C/R alignment, H V S Paste Special, H O I AutoFit, legacy E S / O C A), Escape back-out, dialog mnemonics, key-hold behavior, mouse/focus cancellation, and text input safety. The tests use egui_kittest to inject real egui::Event::Key and verify state + executed commands. High confidence the Home paths work as designed.
Additional Notes
- The implementation respects Excel's exact keytip letters where documented (H=Home, public docs)
- Clean-room constraint satisfied: uses public keytip mappings, no copied icons/assets
- No crash risk: no
unwrap()/expect()in the keytips code,get()for lookups - UI correctly preserves keyboard focus on the grid while keytips are painted overlays
Recommendation: Label #49 as "partially fixed by #43" and track the remaining work (Insert/Data/View/etc. tabs + Alt+Q search) in a follow-up issue or keep #49 open with a checklist.
ribbon_keys ran ui.ribbonTab every frame while the prefix was E/O/OC, forcing the Home tab continuously. Run it once on the prefix change and add a regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged into If you haven't already, please come join us on Discord: https://discord.gg/artcraft — we'd love to have you around. |
…rmats) Interface, formula language and regional format work as in Excel: function names, booleans, errors and format-code letters follow the formula language (the interface language by default, or en-US); separators, dates, months and currency follow the regional format. Workbooks, XLSX, the journal and programmatic params stay canonical (English names, `,` arguments, `.` decimal), so a file opens the same in every language. Local text only crosses the engine boundary as `*Local` fields. Languages: en-US, pt-BR, pt-PT, es-ES, fr-FR, de-DE, it-IT, ru-RU, ja-JP, ko-KR, zh-CN, zh-TW (Japanese, Korean and Chinese keep English function names, as Excel does). - locale (new, L0): language and region data in TOML, validated by build.rs (missing keys, duplicate local names, colliding separators, canonical en-US), CLDR-style negotiation of OS and browser tags. - formula: tokenize/parse/print per dialect; one function catalog with file prefixes replaces the four hand-kept lists (_xlfn., _xludf. for canonical names typed in a localized dialect, _xlpm. for LET/LAMBDA parameters). In ru-RU `:` separates array-constant rows: inside braces a number followed by `:` is a number, since array constants hold no references. - core, numfmt, functions, calc: regional input parsing and text-to-number coercion, localized number-format codes and display, TEXT/FIXED/DOLLAR, VALUE/DATEVALUE/NUMBERVALUE, criteria, CELL/INFO keywords, DBCS *B functions. - l10n (new, L4): Fluent messages for all 12 languages, same keys and arguments as en-US; `cargo xtask locales` reports coverage and runs in ci. - engine: locale prefs, app.setLocale / app.getInternational / app.languages, file.options (catalog: 259 / 290), inputLocal / formulaLocal / valueLocal / numberFormatLocal / refersToLocal, stable EngineError codes, regional CSV, app-created content in the interface language. - ui-egui and apps: translated UI and native menus, local formula editing with autocomplete and argument hints, Options > Language (live switch), localized shortcuts where Excel localizes them, IME, CJK font fallback (font bytes validated before egui sees them), system locale detection, localStorage prefs on the web, CLI --locale, MCP local params. Built on upstream work: - Interface languages (storytold#31, storytold#82, storytold#104): the hand-written table in crates/ui-egui/src/i18n.rs is folded into the Fluent catalog; every upstream language stays, Russian is the 12th (function names voted from Microsoft's ru-RU pages, checked against independent tables, with aliases such as УСЛОВИЯ and ЕСЛИНД). The View-tab picker runs app.language.set and shares the preference with Options > Language; ui.json language codes migrate once to prefs.json unless they are what old builds detected from the system. Text box editing (storytold#84) and key tips (storytold#43) keep working, with translated captions; key tip letters stay English in every language. - Spanish formulas (storytold#98) are folded into this design: names follow the interface language and separators the region, so FormulaLocale, UiState.language and docs/formula-input.md are superseded. Its name-precedence rule is kept and generalized: defined names, table names and LET/LAMBDA bindings win over localized function names and booleans (parse_local_with/print_local_with, Workbook::knows_name) in cell input, *Local params, display, find/replace, CF, validation, names, FORMULATEXT and INDIRECT. A built-in whose local spelling a name took is written with its file prefix (_xlfn.SUM, _xlfn.FALSE()). The journal re-reads *Local params against the workbook as the command found it. storytold#98's UI tests are ported. - Progress docs (storytold#189): localization re-measured (~10% -> ~50% ready). - storytold#57/storytold#159: compare_numbers and MIN() with no arguments use the regional coercion. storytold#148: precedents of ranges ending in a function. storytold#127: the every-line delimiter rule applies to the regional CSV sniffer, whose fallback is the region's list separator. storytold#156: legacy array braces around the localized formula. storytold#149: table.resize writes the names it chooses into the header cells and numbers repeated headers like insert.table. storytold#105: cell-picture strings in all 12 languages. - Restored upstream behaviour: imported ODS/XLSB files are titled "<name> (imported).xlsx"; the import message shows 5 warnings plus a count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rmats) Interface, formula language and regional format work as in Excel: function names, booleans, errors and format-code letters follow the formula language (the interface language by default, or en-US); separators, dates, months and currency follow the regional format. Workbooks, XLSX, the journal and programmatic params stay canonical (English names, `,` arguments, `.` decimal), so a file opens the same in every language. Local text only crosses the engine boundary as `*Local` fields. Languages: en-US, pt-BR, pt-PT, es-ES, fr-FR, de-DE, it-IT, ru-RU, ja-JP, ko-KR, zh-CN, zh-TW (Japanese, Korean and Chinese keep English function names, as Excel does). - locale (new, L0): language and region data in TOML, validated by build.rs (missing keys, duplicate local names, colliding separators, canonical en-US), CLDR-style negotiation of OS and browser tags. - formula: tokenize/parse/print per dialect; one function catalog with file prefixes replaces the four hand-kept lists (_xlfn., _xludf. for canonical names typed in a localized dialect, _xlpm. for LET/LAMBDA parameters). In ru-RU `:` separates array-constant rows: inside braces a number followed by `:` is a number, since array constants hold no references. - core, numfmt, functions, calc: regional input parsing and text-to-number coercion, localized number-format codes and display, TEXT/FIXED/DOLLAR, VALUE/DATEVALUE/NUMBERVALUE, criteria, CELL/INFO keywords, DBCS *B functions. - l10n (new, L4): Fluent messages for all 12 languages, same keys and arguments as en-US; `cargo xtask locales` reports coverage and runs in ci. - engine: locale prefs, app.setLocale / app.getInternational / app.languages, file.options (catalog: 259 / 290), inputLocal / formulaLocal / valueLocal / numberFormatLocal / refersToLocal, stable EngineError codes, regional CSV, app-created content in the interface language. - ui-egui and apps: translated UI and native menus, local formula editing with autocomplete and argument hints, Options > Language (live switch), localized shortcuts where Excel localizes them, IME, CJK font fallback (font bytes validated before egui sees them), system locale detection, localStorage prefs on the web, CLI --locale, MCP local params. Built on upstream work: - Interface languages (storytold#31, storytold#82, storytold#104): the hand-written table in crates/ui-egui/src/i18n.rs is folded into the Fluent catalog; every upstream language stays, Russian is the 12th (function names voted from Microsoft's ru-RU pages, checked against independent tables, with aliases such as УСЛОВИЯ and ЕСЛИНД). The View-tab picker runs app.language.set and shares the preference with Options > Language; ui.json language codes migrate once to prefs.json unless they are what old builds detected from the system. Text box editing (storytold#84) and key tips (storytold#43) keep working, with translated captions; key tip letters stay English in every language. - Spanish formulas (storytold#98) are folded into this design: names follow the interface language and separators the region, so FormulaLocale, UiState.language and docs/formula-input.md are superseded. Its name-precedence rule is kept and generalized: defined names, table names and LET/LAMBDA bindings win over localized function names and booleans (parse_local_with/print_local_with, Workbook::knows_name) in cell input, *Local params, display, find/replace, CF, validation, names, FORMULATEXT and INDIRECT. A built-in whose local spelling a name took is written with its file prefix (_xlfn.SUM, _xlfn.FALSE()). The journal re-reads *Local params against the workbook as the command found it. storytold#98's UI tests are ported. - Progress docs (storytold#189): localization re-measured (~10% -> ~50% ready). - storytold#57/storytold#159: compare_numbers and MIN() with no arguments use the regional coercion. storytold#148: precedents of ranges ending in a function. storytold#127: the every-line delimiter rule applies to the regional CSV sniffer, whose fallback is the region's list separator. storytold#156: legacy array braces around the localized formula. storytold#149: table.resize writes the names it chooses into the header cells and numbers repeated headers like insert.table. storytold#105: cell-picture strings in all 12 languages. - Restored upstream behaviour: imported ODS/XLSB files are titled "<name> (imported).xlsx"; the import message shows 5 warnings plus a count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rmats) Interface, formula language and regional format work as in Excel: function names, booleans, errors and format-code letters follow the formula language (the interface language by default, or en-US); separators, dates, months and currency follow the regional format. Workbooks, XLSX, the journal and programmatic params stay canonical (English names, `,` arguments, `.` decimal), so a file opens the same in every language. Local text only crosses the engine boundary as `*Local` fields. Languages: en-US, pt-BR, pt-PT, es-ES, fr-FR, de-DE, it-IT, ru-RU, ja-JP, ko-KR, zh-CN, zh-TW (Japanese, Korean and Chinese keep English function names, as Excel does). - locale (new, L0): language and region data in TOML, validated by build.rs (missing keys, duplicate local names, colliding separators, canonical en-US), CLDR-style negotiation of OS and browser tags. Only en-US must list every function: one another language doesn't list yet keeps its English spelling there, so adding a worksheet function needs English data only. - formula: tokenize/parse/print per dialect; one function catalog with file prefixes replaces the four hand-kept lists (_xlfn., _xludf. for canonical names typed in a localized dialect, _xlpm. for LET/LAMBDA parameters). In ru-RU `:` separates array-constant rows: inside braces a number followed by `:` is a number, since array constants hold no references. - core, numfmt, functions, calc: regional input parsing and text-to-number coercion, localized number-format codes and display, TEXT/FIXED/DOLLAR, VALUE/DATEVALUE/NUMBERVALUE, criteria, CELL/INFO keywords, DBCS *B functions. - l10n (new, L4): Fluent messages for all 12 languages, same keys and arguments as en-US (function descriptions may fall back to en-US); `cargo xtask locales` reports coverage, lists untranslated function names and descriptions as warnings, and runs in ci. - engine: locale prefs, app.setLocale / app.getInternational / app.languages, file.options (catalog: 259 / 290), inputLocal / formulaLocal / valueLocal / numberFormatLocal / refersToLocal, stable EngineError codes, regional CSV, app-created content in the interface language. - ui-egui and apps: translated UI and native menus, local formula editing with autocomplete and argument hints, Options > Language (live switch), localized shortcuts where Excel localizes them, IME, CJK font fallback (font bytes validated before egui sees them), system locale detection, localStorage prefs on the web, CLI --locale, MCP local params. Built on upstream work: - Interface languages (storytold#31, storytold#82, storytold#104): the hand-written table in crates/ui-egui/src/i18n.rs is folded into the Fluent catalog; every upstream language stays, Russian is the 12th (function names voted from Microsoft's ru-RU pages, checked against independent tables, with aliases such as УСЛОВИЯ and ЕСЛИНД). The View-tab picker runs app.language.set and shares the preference with Options > Language; ui.json language codes migrate once to prefs.json unless they are what old builds detected from the system. Text box editing (storytold#84) and key tips (storytold#43) keep working, with translated captions; key tip letters stay English in every language. - Spanish formulas (storytold#98) are folded into this design: names follow the interface language and separators the region, so FormulaLocale, UiState.language and docs/formula-input.md are superseded. Its name-precedence rule is kept and generalized: defined names, table names and LET/LAMBDA bindings win over localized function names and booleans (parse_local_with/print_local_with, Workbook::knows_name) in cell input, *Local params, display, find/replace, CF, validation, names, FORMULATEXT and INDIRECT. A built-in whose local spelling a name took is written with its file prefix (_xlfn.SUM, _xlfn.FALSE()). The journal re-reads *Local params against the workbook as the command found it. storytold#98's UI tests are ported. - Progress docs (storytold#189): localization re-measured (~10% -> ~50% ready). - storytold#57/storytold#159: compare_numbers and MIN() with no arguments use the regional coercion. storytold#148: precedents of ranges ending in a function. storytold#127: the every-line delimiter rule applies to the regional CSV sniffer, whose fallback is the region's list separator. storytold#156: legacy array braces around the localized formula. storytold#149: table.resize writes the names it chooses into the header cells and numbers repeated headers like insert.table. storytold#105: cell-picture strings in all 12 languages. - Restored upstream behaviour: imported ODS/XLSB files are titled "<name> (imported).xlsx"; the import message shows 5 warnings plus a count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Typing the sequential shortcuts from #33 currently starts a cell edit. This adds a transient keytip mode that consumes those keystrokes before any editor sees them and runs the existing commands.
Part of #33. This is initial support for the issue's concrete examples; the broader mouse-free navigation request should remain open.
Validation:
cargo xtask cistops on the pre-existingcore/date.rs:100Clippy finding. Targeted UI Clippy reports six existing findings informula_bar.rsandgrid.rs; no lint suppressions or unrelated fixes included.Scope limits: other ribbon paths remain unimplemented. Browser/desktop menus may reserve Alt or F10. This invokes the existing AutoFit command; it does not fix the separate header-double-click problem in #42.