Skip to content

feat(windows): show Ctrl+1..9 shortcut hints while Ctrl is held in QuickLauncher - #7590

Merged
M4n5ter merged 3 commits into
apache:mainfrom
ARE404:feat/windows-launcher-ctrl-hints
Dec 4, 2026
Merged

M4n5ter merged 3 commits into
apache:mainfrom
ARE404:feat/windows-launcher-ctrl-hints

Conversation

@ARE404

@ARE404 ARE404 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Summary

On Windows, hold Ctrl by itself in QuickLauncher to reveal Ctrl+1 through Ctrl+9 hints for the numbered results. Other modifiers suppress the hints, including AltGr. The macOS Cmd path is unchanged.

The Win32 path handles generic, left and right modifier virtual keys symmetrically. It resets or resynchronizes hint state across WM_CANCELMODE, WM_ENTERMENULOOP, WM_EXITMENULOOP, WM_ACTIVATE (WA_INACTIVE), WM_KILLFOCUS and WM_SETFOCUS. The window keeps consuming modifier updates even while the launcher is hidden, so reopening it does not replay stale HostInbox events.

Verification

  • Windows Rust checks passed; 470 frontend tests passed.
  • Added launcher regression tests for modifier combinations and hint visibility.
  • macOS and Linux were not compiled locally; cross-platform build verification is left to CI.

AI use

  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka assisted with PR preparation and submission.

Checklist

  • Tests cover the change and fail without it (regression coverage added; no pre-fix failure claimed here)
  • Format, typecheck and the affected suites pass locally (verified scope listed above)

Does this PR entail a breaking change or persisted-data migration?

  • No

Does this PR entail a change in behavior?

  • Yes — described under Summary above

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English

The Win32 modifier tracking in nsh-platform-windows and direct2d.rs looks solid (symmetric left/right VK handling, AltGr resampling via GetAsyncKeyState, menu/focus/hide resets, and edge deduplication). One cleanup suggestion:

Unify macCommandHeld and windowsCommandHeld into one watcher in QuickLauncher.tsx

  • products/maka/workbench/app/QuickLauncher.tsx currently splits into two parallel paths: an outer persistent watchLauncherCommand on Windows passed via windowsCommandHeld, and an inner macCommandHeld inside <Launcher> on macOS.
  • Looking at products/maka/desktop-shell/src/appkit.rs (FlagsChanged local monitor) and HostInbox, macOS also emits quickLauncher.commandChanged while QuickLauncher is hidden or unmounted (e.g. during reading() / conversing() / editor()), so it has the exact same stale HostInbox replay issue.
  • Keeping a single outer watchLauncherCommand for platform.os === 'macos' || platform.os === 'windows' and passing one commandHeld accessor into <Launcher> removes the dual-track code and fixes macOS HostInbox buildup at the same time.
简体中文

nsh-platform-windows 和 direct2d.rs 这套 Win32 修饰键跟踪写得很扎实(左右键对称、GetAsyncKeyState 处理 AltGr、菜单/焦点/隐藏重置以及边沿去重都很到位)。只有一个简化建议:

建议在 QuickLauncher.tsx 中把 macCommandHeld 和 windowsCommandHeld 合并为单轨

  • 目前 products/maka/workbench/app/QuickLauncher.tsx 留了两套平行路径:Windows 在外层 QuickLauncher 常驻订阅 watchLauncherCommand 再通过 windowsCommandHeld 传给 <Launcher>,macOS 则留在 <Launcher> 内部单独维护 macCommandHeld。
  • 对照 products/maka/desktop-shell/src/appkit.rs(FlagsChanged 本地监听)和 HostInbox,macOS 在 QuickLauncher 隐藏或 <Launcher> 卸载(reading() / conversing() / editor())期间同样会持续发送 quickLauncher.commandChanged,存在一样的 HostInbox 积压回放问题。
  • 直接在外层对 platform.os === 'macos' || platform.os === 'windows' 统一挂一个 watchLauncherCommand、只传一个 commandHeld 给 <Launcher>,既能去掉双轨逻辑,也能顺手修掉 macOS 的事件积压。

@ARE404

ARE404 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, @M4n5ter. In 3368e0d, macOS and Windows now share one outer watchLauncherCommand. It keeps consuming modifier events while the launcher is hidden, so neither platform replays stale events on reopen. All 471/471 Workbench frontend tests passed.

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English

LGTM — unified single-track watchLauncherCommand across macOS and Windows looks clean.

简体中文

LGTM —— macOS 和 Windows 统一为单轨 watchLauncherCommand 后很干净。

@M4n5ter
M4n5ter merged commit 41608e4 into apache:main Dec 4, 2026
1 check passed
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.

2 participants