Skip to content

Fix sidebar toggle hotkey when editor input is focused#1944

Merged
sedson merged 1 commit intomainfrom
codex/fix-toggle-sidebar-shortcut-in-markdown-area
Mar 13, 2026
Merged

Fix sidebar toggle hotkey when editor input is focused#1944
sedson merged 1 commit intomainfrom
codex/fix-toggle-sidebar-shortcut-in-markdown-area

Conversation

@jbecke
Copy link
Copy Markdown
Contributor

@jbecke jbecke commented Mar 13, 2026

Motivation

  • The cmd+. sidebar toggle did not fire when focus was inside markdown/editable inputs, preventing quick sidebar toggling from editor contexts.

Description

  • Extracted hotkey registration into a registerSidebarHotkeys helper that accepts isSlim, onOpenChange, and openWithSplit to separate concerns and make behavior testable.
  • Updated the cmd+. registration to set runWithInputFocused: true so the toggle runs even when input/editable elements are focused.
  • Rewired AppSidebar to call registerSidebarHotkeys instead of inline registrations.
  • Added unit tests in js/app/packages/app/component/app-sidebar/sidebar.test.ts to assert the cmd+. registration includes runWithInputFocused: true and that the toggle handler reads the current slim state and calls onOpenChange accordingly.

Testing

  • Added a targeted unit test file packages/app/component/app-sidebar/sidebar.test.ts and attempted to run it with bun run test -- packages/app/component/app-sidebar/sidebar.test.ts -c packages/app, but the run failed in this environment due to dependency resolution (vitest fetch returned a 403 from the npm registry), so tests were not executed here.
  • Static inspection and localized manual verification of the registration code confirmed the runWithInputFocused flag is set and the toggle handler calls onOpenChange(isSlim()) as intended.

Codex Task

@github-actions
Copy link
Copy Markdown

@jbecke jbecke marked this pull request as ready for review March 13, 2026 18:35
@jbecke jbecke requested a review from a team as a code owner March 13, 2026 18:35
@sedson sedson merged commit 8675138 into main Mar 13, 2026
42 of 43 checks passed
@sedson sedson deleted the codex/fix-toggle-sidebar-shortcut-in-markdown-area branch March 13, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants