Skip to content

Unify desktop keyboard shortcuts and help / 统一桌面快捷键设置与帮助#4515

Merged
esengine merged 1 commit into
esengine:main-v2from
SivanCola:feature/unified-keyboard-shortcuts
Jun 16, 2026
Merged

Unify desktop keyboard shortcuts and help / 统一桌面快捷键设置与帮助#4515
esengine merged 1 commit into
esengine:main-v2from
SivanCola:feature/unified-keyboard-shortcuts

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • Unify desktop keyboard shortcuts around the existing keyboardShortcuts registry instead of adding a second shortcuts library.
  • Add a Settings > Shortcuts page for recording, resetting, and conflict-checking desktop shortcut bindings.
  • Add a ?/topic-bar keyboard shortcuts sheet generated from the same registry, plus a skip-to-composer accessibility link.
  • Route command palette, settings, new session, close tab, shell toggle, text-size, help, and composer YOLO shortcuts through the shared matcher.
  • Document the desktop shortcut settings and help sheet in the English and Simplified Chinese guides.

Related PRs

Authorship note: @ttmouse is the primary author of the shortcut settings direction in #4202. @HUQIANTAO is the primary author of the shortcuts cheatsheet/a11y direction in #3125. @SivanCola contributed as a collaborator by integrating both directions on the latest main-v2, resolving the source-of-truth conflict, adding tests/docs, and verifying the final state.

Cache impact

  • Desktop UI-only change. It does not alter provider request serialization, model-visible prompts, tool schemas, or stable cache-prefix content.

Verification

  • pnpm --dir desktop/frontend exec tsx src/__tests__/keyboard-shortcuts.test.ts
  • pnpm --dir desktop/frontend check:css
  • pnpm --dir desktop/frontend typecheck
  • pnpm --dir desktop/frontend build
  • Browser DOM checks: help button opens the shortcut sheet with 10 registry rows; Settings opens via shortcut and the Shortcuts page renders 10 recordable rows.

@SivanCola SivanCola requested a review from esengine as a code owner June 15, 2026 11:07
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c889b906e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +293 to +295
return SHORTCUT_DEFINITIONS.find((definition) => {
if (definition.action === action) return false;
return sameCombo(resolvedShortcutCombo(definition.action, platform), combo);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include shortcut aliases when rejecting conflicts

When a user records the plus-key variant (Cmd/Ctrl+Shift+=, which arrives as key: "+") for another action, this only compares against each action's resolved primary combo and misses the textSize.increase aliases declared above. The settings page will accept that binding even though the docs promise conflicts are rejected, and pressing it will run both the chosen action and the text-size increase handler.

Useful? React with 👍 / 👎.

Comment on lines +310 to +312
if (isShortcutRecorderTarget(event.target)) return;
if (!definition.allowInEditable && isEditableTarget(event.target)) return;
if (!matchesShortcut(event, action, platform)) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve global shortcuts while the composer is focused

Because the composer textarea is the normal focused element while using the app, this early return suppresses every advertised global shortcut whose definition does not opt into allowInEditable, including close tab, shell toggle, text-size changes, settings, and the ? help sheet. These were previously document-level handlers without an editable-target filter, and the guide still lists them as global shortcuts, so from the main composing flow Cmd/Ctrl+W or Cmd/Ctrl+ +/-/0 now silently do nothing.

Useful? React with 👍 / 👎.

Comment on lines +65 to +69
action: "settings.open",
section: "global",
labelKey: "shortcuts.action.settings",
descriptionKey: "shortcuts.desc.settings",
defaults: modCombo(","),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the macOS menu accelerator in sync

On macOS the native File > Settings menu in desktop/menu.go still registers keys.CmdOrCtrl(",") and emits app:open-settings. If a user rebinds Open settings away from Cmd+, or assigns Cmd+, to another action after that, the old native accelerator still opens Settings outside this registry, so the Shortcuts page does not actually make this binding customizable on macOS and can allow one key to trigger two actions.

Useful? React with 👍 / 👎.

Comment on lines +94 to +97
aliases: {
darwin: [{ key: "+", meta: true, shift: true }],
windows: [{ key: "+", ctrl: true, shift: true }],
linux: [{ key: "+", ctrl: true, shift: true }],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept unshifted plus for text-size increase

This alias only matches key: "+" when Shift is also pressed, while the previous handler accepted e.key === "+" regardless of Shift. On keyboards that emit an unshifted plus, such as Ctrl/Cmd plus the numpad +, the event is { key: "+", shiftKey: false }, so it matches neither the = default nor this alias and the documented Ctrl/Cmd++ text-size shortcut stops working.

Useful? React with 👍 / 👎.

@esengine esengine merged commit 2b6b130 into esengine:main-v2 Jun 16, 2026
14 checks passed
Li-Charles-One pushed a commit to Li-Charles-One/DeepSeek-Reasonix that referenced this pull request Jun 16, 2026
Remove the 'display: none' rule for .sidebar__new that was hiding
the button. This rule was added assuming AppChrome component would
handle the new chat button, but since we skipped esengine#4515 (AppChrome
integration), the original sidebar button needs to remain visible.
Li-Charles-One pushed a commit to Li-Charles-One/DeepSeek-Reasonix that referenced this pull request Jun 16, 2026
- App.tsx: kept custom sidebar structure (rejected AppChrome from esengine#4515)
- Composer.tsx: kept custom input layout and Send icon
- ContextPanel.tsx: kept usage bar (replaced donut), kept formatCacheHitRate
- context-panel-breakdown.test.ts: aligned with ContextPanel changes
Li-Charles-One pushed a commit to Li-Charles-One/DeepSeek-Reasonix that referenced this pull request Jun 16, 2026
- App.tsx: kept custom sidebar structure (rejected AppChrome from esengine#4515)
- Composer.tsx: kept custom input layout and Send icon
- ContextPanel.tsx: kept usage bar (replaced donut), kept formatCacheHitRate
- context-panel-breakdown.test.ts: aligned with ContextPanel changes
Li-Charles-One pushed a commit to Li-Charles-One/DeepSeek-Reasonix that referenced this pull request Jun 16, 2026
- App.tsx: kept custom sidebar structure (rejected AppChrome from esengine#4515)
- Composer.tsx: kept custom input layout and Send icon
- ContextPanel.tsx: kept usage bar (replaced donut), kept formatCacheHitRate
- context-panel-breakdown.test.ts: aligned with ContextPanel changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants