feat(console-ui): global shortcuts, help dialog & overlay stack (#4) - #6
Open
wuxs wants to merge 2 commits into
Open
feat(console-ui): global shortcuts, help dialog & overlay stack (#4)#6wuxs wants to merge 2 commits into
wuxs wants to merge 2 commits into
Conversation
Issue #4 — unified, testable keyboard interaction for the console UI. Shortcut system (src/shortcuts): - Single-source registry with stable id/action/category, platform-aware modifiers (Cmd/Option on mac, Ctrl/Alt elsewhere) and code-based matching - Default bindings: ? and Ctrl|Cmd+/ (help), Ctrl|Cmd+Alt+D/M/F/W (show desktop / minimize / maximize / close), Alt+1..9 (focus dock app) - Disabled in editable contexts (input/textarea/select/contenteditable/ role=textbox/.xterm/data-shortcut-scope); key repeat ignored; preventDefault only on a matched, enabled action Overlay stack (src/overlays/OverlayProvider): - Layered Escape closes only the top dismissible layer - Focus trap, initial focus, focus restore on close, backdrop dismiss - Modal layers set background inert + aria-hidden and lock body scroll (ref-counted for nesting); replaces per-component global keydown listeners Help dialog (src/components/ShortcutHelpDialog): role=dialog/aria-modal, opens via ? or Ctrl|Cmd+/, grouped by category, renders platform-correct modifiers from the same registry. Migrations: AuthModal, AuditLog detail drawer and AppMgmtDrawer confirmation layers now ride the shared overlay stack. Shared test base (S0): Vitest + jsdom + Testing Library + user-event + Playwright; adds test:unit/test:e2e scripts and eslint test globals. Closes #4 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
Collaborator
Author
|
已补充 Android 平板外接物理键盘兼容修复(commit
验证:
已知限制:跨域 iframe 内按键仍无法冒泡到父页面;Android 外接键盘真实键位需在设备端复验。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
实现 Issue #4:为 Console UI 增加统一、可发现、可测试的全局快捷键系统。
src/shortcuts/shortcuts.js):单一数据源,稳定 id/action/category;平台感知 modifier(mac ⌘/Option、其他 Ctrl/Alt);基于KeyboardEvent.code匹配。?与Ctrl|⌘+/(帮助)、Ctrl|⌘+Alt+D/M/F/W(显示桌面/最小化/最大化/关闭)、Alt+1..9(按 Dock 顺序聚焦)。event.repeat忽略;仅命中且 enabled 时preventDefault()。src/overlays/OverlayProvider.jsx):分层 Escape 只关最顶层 dismissible 层;焦点陷阱/初始焦点/关闭恢复;modal 层把背景inert+aria-hidden并锁滚动(引用计数支持嵌套);取代各组件全局 keydown。ShortcutHelpDialog.jsx):role=dialog/aria-modal,按 通用/导航/窗口 分组,从同一注册表渲染平台 modifier;?或Ctrl|⌘+/打开。test:unit/test:e2e脚本与 eslint test globals。门禁(基于 origin/main
5ca8107)npm run buildnpm run test:unitnpm run lint关联
Closes #4
🤖 Generated with Claude Code