Skip to content

🤖 feat: keyboard shortcuts for the background processes strip - #5633

Merged
ThomasK33 merged 7 commits into
mainfrom
xum-5197-bg-strip-keybinds
Oct 4, 2026
Merged

ThomasK33 merged 7 commits into
mainfrom
xum-5197-bg-strip-keybinds

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Summary

The background processes strip now has keyboard shortcuts on desktop and in the VS Code webview. Ctrl/Cmd+Shift+J expands the strip and focuses its first row. Arrow keys move between rows, Enter opens the output viewer, Backspace terminates the process, and Esc (or the chord again) collapses the strip and returns focus to where it was. Desktop also gets a "Focus Background Processes" palette entry.

Fixes #5197

Implementation

  • All key handling lives in the shared BackgroundProcessesBanner, so desktop and the webview get the same shortcuts. The rows use a roving tabindex. Row keys go through ChatInputDecoration's new optional contentRef / onContentKeyDown props and call stopKeyboardPropagation, so Esc on a row does not also reach the window-level stream interrupt.
  • The chord listener is registered only while the strip has processes. With no processes the chord is not consumed (not preventDefaulted).
  • Focus follow-up: when the focused row's process leaves the list (terminated, exited or removed elsewhere), focus moves to a neighbouring row. When the last row goes, focus returns to its origin. After closing the output dialog opened with Enter, focus returns to the row (the dialog has no trigger for Radix to restore focus to). With no focus origin (palette activation), Esc leaves focus on the strip's toggle button.
  • The chord is ignored inside the command palette (cmdk root), which isDialogOpen() does not detect. The chord and the palette request are also ignored while the strip sits in an inert pane (desktop keeps the chat pane mounted under immersive review).
  • If the row's process leaves the list while its output dialog is open, closing the dialog focuses a neighbouring row.
  • The chord is left to the integrated terminal when it has focus.
  • Settings → Keybinds lists the global chord. The row keys are scoped (like modal-only keys), so they appear in the row tooltips and the docs instead.
  • New keybinds in keybinds.ts: FOCUS_BACKGROUND_PROCESSES, and the row-scoped BACKGROUND_PROCESS_NEXT/PREV/VIEW_OUTPUT/TERMINATE. Settings → Keybinds lists them in a new "Background processes" group, and docs/config/keybinds.mdx documents them (the webview has no palette or settings).
  • Shortcut hints appear in the row buttons' tooltips and are hidden at mobile widths.
  • No new Storybook story: the KeyboardFocusedRow story was removed in the last push because its play failed in CI at phone width. The six App.test cases cover its assertion (the chord focuses the first row) and more.

Decisions

  • Chord choice: VS Code forwards every webview keydown to the workbench (did-keydown in VS Code's webview pre/index.html), so the chord avoids VS Code's global bindings (Ctrl+Shift+B runs the build task). Electron uses Ctrl+Shift+R (force reload) and Ctrl+Shift+I (devtools). Ctrl/Cmd+Shift+J is free in Xum, and VS Code binds it only inside the search view.
  • Terminate is Backspace, not Delete: the macOS delete key reports Backspace. It acts only on a focused strip row, like the existing one-click Terminate button.

Validation

Test-first. Before the fix, the new App tests failed:

expect(await press(textarea, FOCUS_STRIP)).toBe(false);
Expected: false
Received: true
(fail) ... the shortcut focuses the strip; arrows move, Backspace terminates, Escape returns focus (#5197)
error: Unable to fire a "keydown" event - please provide a DOM element.
(fail) ... Enter on a focused row opens its output (#5197)

Round 1 of the normal review added three cases (natural exit, palette origin, palette open). Against the previous head, those tests failed (3 fail). Round 2 added two more (row removed while its dialog is open, inert pane). Against the previous head, those failed too (2 fail). Round 3 added the terminal case, which fails without the guard.

After the fix: bun test ./vscode/src/webview/App.test.tsx -t "#5197" 6 pass. The new palette test in sources.test.ts passes. Two mutation checks failed as expected: no refocus after removal, and no refocus after closing the dialog. bun test ./vscode/src/webview/webviewCss.test.ts (drift guard) passes.

CSS: no CSS files changed. The webview dist CSS asset count stays at 2 (xumChatView.css, katex/katex.min.css). The new utilities compile into the existing stylesheets, and the drift guard confirms the webview defines them.

Dogfood:

  1. VS Code webview bundle (env -C vscode node esbuild.config.js) served with a host stub at 300 px (narrow sidebar), 390 px and 900 px. With agent-browser I pressed the chord from the composer: row 0 was focused. ArrowDown went to row 1. Backspace sent workspace.backgroundBashes.terminate {processId: "bash_2"}. Enter opened the output viewer (getOutput calls). Esc closed it and focus returned to the row. A second Esc collapsed the strip and focused the textarea.
  2. Desktop (Storybook App story) at 1200 px and 390 px: the chord focused the first row. The palette entry "Focus Background Processes" (shown with its Ctrl+Shift+J hint) focused row 0.

Webview, 300 px sidebar, second row focused:

webview 300px

Webview, 390 px:

webview 390px

Webview, tooltip hint:

webview tooltip

Desktop, 1200 px:

desktop 1200px

Desktop, 390 px:

desktop 390px

Desktop palette entry:

desktop palette

Size: 472 changed lines (464+, 8-), tests included, 4 of them regenerated in builtInSkillContent.generated.ts from the docs change. The coordinator accepted up to 506.

Risks

Low. The chord listener exists only while processes are listed, and row keys act only when a strip row has focus. Mouse behavior is unchanged.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $2.45

@mintlify

mintlify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Mux 🟢 Ready View Preview Oct 4, 2026, 7:45 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T21:04:13.315034Z 58d4698 New commits
🔒 Security Review ✅ Completed 2026-10-04T21:01:35.624654Z 58d4698 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 8ac1707cfe

ℹ️ 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 thread src/browser/components/BackgroundProcessesBanner/BackgroundProcessesBanner.tsx Outdated

@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: d56b9d80e0

ℹ️ 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 thread src/browser/components/BackgroundProcessesBanner/BackgroundProcessesBanner.tsx Outdated

@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: 5b2e605bdf

ℹ️ 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".

@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: 5e03a59daf

ℹ️ 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".

@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: 58d46988eb

ℹ️ 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".

@ThomasK33

Copy link
Copy Markdown
Member Author

Readiness record


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit 3872563 Oct 4, 2026
60 of 63 checks passed
@ThomasK33
ThomasK33 deleted the xum-5197-bg-strip-keybinds branch October 4, 2026 21:25
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.

🤖 feat: keyboard shortcuts for the background processes strip (desktop and webview)

1 participant