Skip to content

Add "Open in new tab" functionality for split content - #5613

Open
jbecke wants to merge 1 commit into
mainfrom
claude/sidebar-open-new-tab-anupp2
Open

Add "Open in new tab" functionality for split content#5613
jbecke wants to merge 1 commit into
mainfrom
claude/sidebar-open-new-tab-anupp2

Conversation

@jbecke

@jbecke jbecke commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds the ability to open split layout content (components, channels, blocks, etc.) in a new browser tab. It introduces URL generation for split content and integrates the new tab action into context menus across the sidebar and favorites sections.

Key Changes

  • New utility functions in layoutUtils.ts:

    • splitContentUrl(): Generates absolute /app/<type>/<id> URLs for split content, with special handling for settings (includes active tab)
    • openSplitContentInNewTab(): Opens split content in a new tab using the generated URL
    • Exported contentUrlSegments() from layoutManager.ts for URL generation
  • Context menu integration:

    • Added "Open in new tab" menu item to sidebar dropdown links (sidebar.tsx)
    • Added "Open in new tab" menu item to sidebar open-in-split menus (sidebar.tsx)
    • Added "Open in new tab" menu item to channel rows (channels-recent-widget.tsx)
    • Added "Open in new tab" menu item to favorite rows (favorites-section.tsx)
    • All actions track analytics with target: 'new-tab'
  • Comprehensive test coverage:

    • Added splitContentUrl.test.ts with tests for:
      • Component addressing by ID
      • Block addressing by type and ID
      • Alias type resolution
      • Settings serialization with active tab

Implementation Details

  • URLs use the hardcoded /app prefix (matching buildSimpleEntityUrl) rather than ROUTER_BASE, since native builds route on / but address the web app by its real origin
  • Content params (e.g., prefiltered lists) are not persisted in URLs, so new tabs open views in their default state
  • In the native shell, the Macro-link interceptor routes these links into the current window instead of the system browser
  • Settings content includes the active tab in the URL to maintain tab state across new tabs

https://claude.ai/code/session_01FEJ1xLDEYYkroABTfVt6nx

Sidebar rows could open content in the current split, a new split, or
fullscreen — all within the same tab. Add an "Open in new tab" action that
opens the row's content as a `/app/<type>/<id>` link in a new browser tab,
where it loads as that tab's only split (fullscreen).

The action is shared by every left-sidebar right-click menu: the top-level
links and Email account rows (SidebarOpenInSplitMenu), the collapsed
workspace dropdown rows (SidebarDropdownLink), favorites, and recent
channels.

A URL carries only type/id pairs, so content params and the scoping the
menus' onOpened callbacks do (an Email row's inbox filter, a channel's
first unread message) don't survive into the new tab; it opens the view in
its default state. Inside the native shell, which has no tabs,
openExternalUrl's Macro-link interceptor routes the link into the current
window instead of the system browser.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEJ1xLDEYYkroABTfVt6nx
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 070e993b-7813-4771-803c-75bb1d958e0a

📥 Commits

Reviewing files that changed from the base of the PR and between 46a0106 and 9f4b63f.

📒 Files selected for processing (6)
  • apps/web/src/components/app/app-sidebar/sidebar.tsx
  • apps/web/src/components/app/split-layout/layoutManager.ts
  • apps/web/src/components/app/split-layout/layoutUtils.ts
  • apps/web/src/components/app/split-layout/tests/splitContentUrl.test.ts
  • apps/web/src/features/channel/sidebar/channels-recent-widget.tsx
  • apps/web/src/features/favorites/sidebar/favorites-section.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added an “Open in new tab” option to sidebar, channel, and favorite context menus.
    • Opening a channel in a new tab takes you directly to its latest message.
    • Added support for opening split content—including components, blocks, aliases, and settings—in a new browser tab.
  • Tests

    • Added coverage for generating new-tab links across supported content types.

Walkthrough

Added split-content URL helpers and tests for component, block, alias, and settings content. Added “Open in new tab” actions to sidebar links, split menus, recent channels, and favorites. These actions track the selected content and open it through the external URL handler. Split-menu new-tab actions do not invoke split-opening callbacks.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes the main change and is under 72 characters, but it does not follow the required Conventional Commits format. Use a Conventional Commits prefix, such as "feat: add open in new tab functionality for split content".
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the new-tab functionality, URL utilities, context-menu integration, analytics, and test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants