Add "Open in new tab" functionality for split content - #5613
Open
jbecke wants to merge 1 commit into
Open
Conversation
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
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdded 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)
✅ Passed checks (3 passed)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 URLcontentUrlSegments()fromlayoutManager.tsfor URL generationContext menu integration:
sidebar.tsx)sidebar.tsx)channels-recent-widget.tsx)favorites-section.tsx)target: 'new-tab'Comprehensive test coverage:
splitContentUrl.test.tswith tests for:Implementation Details
/appprefix (matchingbuildSimpleEntityUrl) rather thanROUTER_BASE, since native builds route on/but address the web app by its real originhttps://claude.ai/code/session_01FEJ1xLDEYYkroABTfVt6nx