Skip to content

feat(windows): window-wide app accelerators (PRODUCT-SPEC §8) - #57

Open
turinglambdaai wants to merge 3 commits into
mainfrom
feat/windows-app-accelerators
Open

turinglambdaai wants to merge 3 commits into
mainfrom
feat/windows-app-accelerators

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Part of the v0.2.4 polish cycle (#55 audit).

Gap

Windows was the only host without the shared accelerator contract. PRODUCT-SPEC §8 promises Ctrl+1…4 / Ctrl+N / Ctrl+F / Ctrl+Shift+C (plus Ctrl+Shift+N / Ctrl+O) window-wide on every host; macOS ships the ⌘ menu commands and Linux the GTK accelerators, but Windows had no accelerator handling at all.

Implementation

  • KeyboardAccelerators installed on RootGrid in InstallAppAccelerators() — XamlRoot-scoped, so they fire window-wide without opening a menu (Windows has no View menu to attach them to).
  • Each accelerator reuses the exact command path of its on-screen control:
    • SwitchSmartView extracted from OnSmartTileClick (tiles and Ctrl+1…4 share it).
    • Ctrl+N commits any open inline editor, then focuses quick add; Ctrl+F focuses search.
    • Ctrl+Shift+C flips the completed toggle; ToggleShowCompleted applies the state only if the Checked/Unchecked event didn't already (no double reload).
    • Ctrl+Shift+N / Ctrl+O invoke the same handlers as the File menu rows, which now also show KeyboardAcceleratorTextOverride hints.
  • pch: winrt/Microsoft.UI.Input.h added.
  • README (en/zh) + UX-BENCHMARKS §1.2 status refreshed: batch ops + keyboard flow are now three-platform complete.

Verification

  • Windows host compile + packaged WinUI acceptance: CI (this is the macOS leg machine).
  • No contract changes; PRODUCT-SPEC §8 already specified this behavior.

Windows was the only host without the shared accelerator contract:
no Ctrl+1…4 view switching, no Ctrl+N quick-add focus, no Ctrl+F
search focus, no Ctrl+Shift+C completed toggle, and no database
shortcuts — §8 promises them window-wide on every host, and macOS
(⌘ menu commands) and Linux (GTK accelerators) already shipped.

Install KeyboardAccelerators on RootGrid (XamlRoot-wide scope) in
code: there is no View menu on Windows to attach them to, and each
accelerator reuses the exact code path of its on-screen control —
SwitchSmartView (extracted from the tile click handler), quick-add /
search focus, and the completed toggle without double-firing its
Checked handler. The two File-menu rows that exist carry
KeyboardAcceleratorTextOverride hints.

Also refresh the stale interaction status in README (both languages)
and UX-BENCHMARKS §1.2: batch operations and the keyboard flow landed
on all three hosts this cycle.
The WinUI 3 projection keeps KeyboardAccelerator and its invoked args
in Microsoft.UI.Xaml.Input (as in UWP's Windows.UI.Xaml.Input), not
Microsoft.UI.Input; CI caught the wrong namespace. The extra pch include
is dropped again.

This branch has not been deployed

No deployments
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.

1 participant