feat(desktop): open right-pane tools from the main + menu

Merged
SA
4d ago
+68-2

What & why

Feedback: with the right pane system on, the main area tab group's + menu lost Browser, Changes and Desktop, which made the right pane hard to discover.

The + menu now has an "Open in right pane" section, after a separator and a muted label. It lists the same options as the right pane's New Tab (getRightPaneOptions): Browser, Changes, Files, Pages, plus Desktop (sandbox only) and Mobile (mobile-pane flag only). Each item adds a tab to the right pane and opens the pane. Changes reuses openChanges, so it focuses an existing Changes tab instead of opening a second one.

Terminal is left out of the section: it already leads the menu, and its shortcut opens in the main area. With the right pane off, the menu is unchanged.

The "Open in right pane" string was already translated in every locale, so the catalogs don't change.

How I tested it

  • bun run typecheck (desktop) passes; biome is clean on the changed files; the 72 tests under the workspace components/ folder pass; check:i18n reports nothing missing.
  • Rendered the real AddTabMenu in the running dev app (CDP) with the props page.tsx passes when the right pane is on, and checked the layout:
Terminal                Ctrl+Shift+T
Chat                    Ctrl+Alt+Shift+J
──────────────────────
Open in right pane
Browser                 Ctrl+Alt+Shift+B
Changes                 Ctrl+Alt+Shift+G
Files
Pages
Desktop
Mobile
──────────────────────
✓ Show Scripts Bar
  • Not tested: clicking the items from a real workspace tab bar. The cloud sandbox's dev app couldn't open any workspace (the local relay was unreachable).

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Adds an "Open in right pane" section to the main area's + menu so right-pane tools are discoverable when the right pane is enabled.

  • Reuses the existing getRightPaneOptions list, so the main menu matches the right pane's New Tab: Browser, Changes, Files, Pages, and Desktop/Mobile where applicable.
  • Excludes Terminal, since it already leads the menu and its shortcut targets the main area.
  • Changes reuses openChanges, focusing an existing Changes tab instead of opening a duplicate.
  • Leaves the menu unchanged when the right pane is off.

Summary by CodeRabbit

  • New Features
    • The Add Tab menu now includes an “Open in right pane” section when right-pane options are available.
    • Choose an option to open changes or another supported view in the right pane. Available options adjust to workspace settings.
    • Option labels are localized, and hotkeys are displayed when available.