Skip to content

fix(desktop): Cmd+T opens the new-tab menu from a focused browser page - #39769

Merged
juliusmarminge merged 2 commits into
mainfrom
factory/issue-39744
Nov 20, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
factory/issue-39744

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

With a webpage focused in the desktop Browser panel, Cmd+T (Ctrl+T on Windows/Linux) did nothing, because the page swallows the keypress and the app never asked the desktop shell to forward that shortcut. Cmd+T now opens the right panel's new-tab menu the same way it does when the app's own UI has focus.

  • ReopenClosedViewShortcut now registers rightPanel.new for forwarding from a focused page, with rightPanelOpen in the forwarding context so the default mod+t binding qualifies.
  • RightPanelTabs opens its add-surface menu when the desktop app delivers the forwarded rightPanel.new action. It opens the menu directly rather than focusing the + button first, so the composer's refocus-on-window-focus behaviour cannot close it.

Fixes #39744

Reproduction on main

Commit df09ced (origin/main). Ran the desktop app with T3CODE_DEV_SEED=0 headless-desktop vp run dev:desktop (Linux/Xvfb, so mod = Ctrl) and drove it with real X input (xdotool). Finished onboarding, added a scratch local-folder project, opened the right panel and chose Browser, then opened a local test page (python http.server on localhost:8765). Control: clicked the chat column (app UI focused) and pressed Ctrl+T, which opened the right panel's new-tab menu (Browser/Terminal/Files/...), one [role=menu] in the DOM. Bug: clicked inside the page (document.activeElement = WEBVIEW) and pressed Ctrl+T: no menu opened (0 [role=menu]) and nothing changed. Then pressed Ctrl+W with the page still focused: the browser tab closed, so forwarding works for rightPanel.close (#39340) but not for rightPanel.new. Failing test: the existing 'forwards address-bar focus, zoom, ...' case in apps/web/src/components/ReopenClosedViewShortcut.browser.test.tsx, extended to expect rightPanel.new in the forwarded shortcuts, fails on main.

Evidence

Real Electron desktop on Linux/Xvfb, light theme, 1500×900, fresh isolated state on each commit. Add a local project, open Browser and the synthetic page. Verify Ctrl+T opens the menu with app focus; dismiss it, click inside the webpage, then press Ctrl+T again. Base leaves the menu closed; head opens it. Ctrl+W closes the focused browser tab on both commits.

Before After
df09ced768 180aaf5c39
Before: Ctrl+T with webpage focus leaves menu closed After: Ctrl+T with webpage focus opens new-tab menu
Before recording After recording

Reproduction driver, setup, synthetic page, and focus/menu observations.

Not shown:

  • macOS Cmd+T and Windows Ctrl+T were not run; this proof uses the reported Linux desktop reproduction.

Tests

  • vp test run src/components/ReopenClosedViewShortcut.browser.test.tsx src/components/RightPanelTabs.browser.test.tsx (apps/web): 10 passed, including the extended forwarding test that failed on main
  • vp run check:changed: format, lint, knip, typecheck (2 packages), tests beside changes and react compiler all pass
  • Manual, desktop app on Xvfb with xdotool input: page focused + Ctrl+T opened the menu in 8/8 trials; arrow keys move the highlight; Escape returns focus to the page; Ctrl+T with app UI focused still opens the menu
  • CI on 180aaf5: all 7 required checks passed; Test Web 2 was still running at handoff

Not in this change

  • ChatView's shouldRefocusComposerOnWindowFocus refocuses the composer whenever a plain button holds focus on window focus, which can steal focus from other controls focused right after leaving a guest page.
  • rightPanel.new is not added to the desktop Manager's host.focus() list; it proved unnecessary because the menu popup's DOM focus already moves keyboard focus out of the guest.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits November 20, 2026 14:16
…9744)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A focused page in the Browser panel swallows app keydowns, and the desktop
app only forwards chords the web app registers. rightPanel.new was not
registered, and its when-clause needs rightPanelOpen, so Cmd+T did nothing.

Forward rightPanel.new and handle its menu action in RightPanelTabs. The
forwarded path opens the menu without focusing the trigger first, so the
window-focus composer refocus cannot close it before the popup takes focus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The desktop preview now forwards rightPanel.new and marks the right panel as open in the shortcut context. RightPanelTabs opens the add-surface menu for the forwarded action when unblocked.

Changes: Right-panel new-surface shortcut

Layer / File(s) Summary
Forward the new-panel shortcut
apps/web/src/components/ReopenClosedViewShortcut.tsx, apps/web/src/components/ReopenClosedViewShortcut.browser.test.tsx
The forwarded-command list now includes rightPanel.new. The preview shortcut context sets rightPanelOpen to true, and the test expects the new command.
Handle the forwarded menu action
apps/web/src/components/RightPanelTabs.tsx, apps/web/src/components/RightPanelTabs.browser.test.tsx
RightPanelTabs uses a shared blocking check for the keyboard shortcut and desktop menu action. When an unblocked rightPanel.new action arrives, it opens the add-surface menu without focusing its trigger. Cleanup removes the bridge subscription. The test mock adds onMenuAction.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

Possibly related PRs

  • pingdotgg/t3code#39340 — This PR adds rightPanel.close to the forwarded-command list that this change extends with rightPanel.new.
  • pingdotgg/t3code#39753 — This PR also forwards rightPanel.new from a focused page and opens the right-panel add menu.

Suggested reviewers: t3dotgg, bil0000, macroscopeapp

Merge Risk: Minimal · up to 180aa

Cmd+T or Ctrl+T now opens the right panel's new-tab menu when a desktop Browser page has focus. The change is small and easy to revert, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: Cmd+T opens the right panel's new-tab menu when a Browser page has focus. It uses the conventional commit form and matches the raw summary, which registers rightPanel.new f…
Linked Issues check Passed Issue #39744 requires Cmd+T to open the right panel's new-tab menu when a desktop Browser page has focus. The reviewed head meets this requirement in the code summary. (1) ReopenClosedViewShortcut.tsx…
Out of Scope Changes check Passed All changed files relate to the linked objective. ReopenClosedViewShortcut.tsx and its browser test cover the forwarding of rightPanel.new. RightPanelTabs.tsx covers the menu-open handling and the sha…
Description check Passed The description follows the repository template closely. It has a Problem section that explains the Cmd+T failure on a focused Browser page, a Change section that covers both the forwarding registrati…
Full details: Title check

Explanation

The title names the change: Cmd+T opens the right panel's new-tab menu when a Browser page has focus. It uses the conventional commit form and matches the raw summary, which registers rightPanel.new for forwarding and handles it in RightPanelTabs. The title is specific and concise.

Full details: Linked Issues check

Explanation

Issue #39744 requires Cmd+T to open the right panel's new-tab menu when a desktop Browser page has focus. The reviewed head meets this requirement in the code summary. (1) ReopenClosedViewShortcut.tsx adds rightPanel.new to PREVIEW_FORWARDED_COMMANDS and sets rightPanelOpen to true in the desktop preview shortcut context, so the default mod+t binding is forwarded from a focused page. This mirrors the rightPanel.close forwarding gap fixed by #39340. (2) RightPanelTabs.tsx subscribes to desktop menu actions and, when rightPanel.new arrives, opens the add-surface menu directly. The shortcut handler uses the same addSurfaceMenuBlocked check. (3) The updated browser test expects rightPanel.new in the forwarded set. Limits: the RightPanelTabs.tsx diff could not be read (blob unavailable, and the file read was truncated), so the handler is confirmed only from the summary. The desktop-side delivery of the forwarded action as a menu action is inferred from the existing #39340 mechanism. Manual Xvfb results (8/8 trials) come from the author, not from independent verification.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the linked objective. ReopenClosedViewShortcut.tsx and its browser test cover the forwarding of rightPanel.new. RightPanelTabs.tsx covers the menu-open handling and the shared launcher-blocking check used by the shortcut path. The RightPanelTabs.browser.test.tsx change adds a no-op onMenuAction mock to the existing trackpad() helper, which supports the new subscription and leaves existing assertions unchanged. The PR description lists composer refocus and the desktop Manager host.focus() list as excluded. These exclusions are not changes, so they are not out of scope. No unrelated change was found in the summary.

Full details: Description check

Explanation

The description follows the repository template closely. It has a Problem section that explains the Cmd+T failure on a focused Browser page, a Change section that covers both the forwarding registration and the menu-opening behavior, and a Scope section that links issue #39744 as the bug report. Verification is detailed: it lists focused test commands with results, a manual reproduction on main with commit hashes, before/after screenshots and recordings, and a list of what was not checked (macOS and Windows). It also names the models that did the work, as the template asks. The description is thorough and mostly complete. The only gap is that Scope does not say why a fix needs no issue, but a linked issue exists, so this is not required.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 97e7834 and 180aaf5.

Files selected for processing: 4

  • apps/web/src/components/ReopenClosedViewShortcut.browser.test.tsx
  • apps/web/src/components/ReopenClosedViewShortcut.tsx
  • apps/web/src/components/RightPanelTabs.browser.test.tsx
  • apps/web/src/components/RightPanelTabs.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@juliusmarminge
juliusmarminge merged commit 966e422 into main Nov 20, 2026
40 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-39744 branch November 20, 2026 15:06
juliusmarminge added a commit that referenced this pull request Nov 20, 2026
Main's #39769 now forwards Cmd/Ctrl+T from a focused browser page and
opens the + menu without focusing its trigger. Take main's RightPanelTabs
and preview Manager; this branch keeps only the composer refocus guard
for a control whose popup is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HNRow pushed a commit to HNRow/r3code that referenced this pull request Nov 20, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 20, 2026
**v0.1.12-nightly.20261120.5009** · 30 changes from 9 contributors

- **Secret cards.** Enter multiple secret values in one card and show or hide masked values on the web.
- **Shared Antigravity skills.** Use Antigravity skills registered in shared or external directories.
- **Thread failure reasons.** See why the latest thread run failed when checking it from the command line.
- **Draft pull requests.** Create draft pull requests directly without briefly announcing them as ready for review or starting unnecessary CI runs.
- **Azure DevOps Bugs.** Read and edit Bug descriptions stored in Repro Steps from Issues.
- **Stable file previews.** Keep HTML previews and attachments open while agents work, without losing form input to unnecessary reloads.
- **T3 Connect port forwarding.** Forward ports to your machine when connected to another machine through T3 Connect.

### Plus 21 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(server): Claude gateway cooldown survives an untyped SDK rejection by @juliusmarminge in pingdotgg/t3code#39695
* fix(release): Windows resource monitor starts without the Visual C++ runtime by @jieyuexing in pingdotgg/t3code#39683
* fix(server): turn authorship works on Git before 2.36 by @juliusmarminge in pingdotgg/t3code#39702
* fix(mobile): new thread says the host has no model instead of asking to connect by @juliusmarminge in pingdotgg/t3code#39713
* fix(antigravity): keep truncated command text valid Unicode by @Lucenx9 in pingdotgg/t3code#39697
* fix(antigravity): honor the saved thinking level in text generation by @Lucenx9 in pingdotgg/t3code#39720
* fix(azure-devops): read and edit a Bug's text in Repro Steps by @juliusmarminge in pingdotgg/t3code#39738
* fix(web): stop reloading unchanged file previews during agent commands by @juliusmarminge in pingdotgg/t3code#39736
* fix(server): a released provider session ends its tool call nodes too by @jieyuexing in pingdotgg/t3code#39734
* fix(server): watch_pull_request says a merge or close wakes the agent by @juliusmarminge in pingdotgg/t3code#39739
* fix(server): replace the device hub when emulator camera support changes by @juliusmarminge in pingdotgg/t3code#39764
* fix(desktop): Cmd+T opens the new-tab menu from a focused browser page by @juliusmarminge in pingdotgg/t3code#39769
* fix(server): port refusals survive T3 Connect's relay by @juliusmarminge in pingdotgg/t3code#39763
* fix(server): Antigravity links and discovers skills from skills.json by @mameli in pingdotgg/t3code#39765
* fix(desktop): WSL backend honors T3CODE_HOME from the distro's login shell by @juliusmarminge in pingdotgg/t3code#39771
* fix(server): pull_request_create opens a draft PR as a draft on GitHub and Azure by @juliusmarminge in pingdotgg/t3code#39772
* fix(server): Antigravity wake runs accept steers again by @juliusmarminge in pingdotgg/t3code#39767
* fix(server): keep DeepSeek ACP probes out of session history by @crisxuan in pingdotgg/t3code#39733
* fix(server): idle threads compact while a delegated task runs by @juliusmarminge in pingdotgg/t3code#39766
* fix(mobile): a settings row an older environment left mixed can be set off by @not-compromised in pingdotgg/t3code#39755
* feat: secret cards get a show/hide toggle and multi-value fields by @gabrielelpidio in pingdotgg/t3code#31257
* fix(ssh): a slow remote server keeps its SSH forward on reconnect by @juliusmarminge in pingdotgg/t3code#39802
* fix(antigravity): a scheduled wake keeps its run open instead of looking finished by @juliusmarminge in pingdotgg/t3code#39806
* fix(ssh): reconnect stops waiting on a remote server that is shutting down by @juliusmarminge in pingdotgg/t3code#39807
* fix(web): open PDF attachments no longer reload while the agent works by @juliusmarminge in pingdotgg/t3code#39815
* perf(linear): overlap issue details and viewer reads by @Adamulek123 in pingdotgg/t3code#39801
* fix(linear): scope issue numbers to the named team by @Adamulek123 in pingdotgg/t3code#39809
* fix(gitlab): pull_request_create opens a draft MR as a draft by @aravhawk in pingdotgg/t3code#39817
* fix(web): scrolling a PR description no longer moves focus to the condensed header by @juliusmarminge in pingdotgg/t3code#39840
* feat(cli): thread show reports why the latest run failed by @juliusmarminge in pingdotgg/t3code#39849

## New Contributors
* @mameli made their first contribution in pingdotgg/t3code#39765
* @crisxuan made their first contribution in pingdotgg/t3code#39733

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261120.4994...v0.1.12-nightly.20261120.5009

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261120.5009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cmd+T does nothing when an in-app browser page has focus

1 participant