Skip to content

Active Sessions: button to open a new Inspector tab with the full URL - #3106

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/feat/3105-new-inspector-tab
Nov 30, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/feat/3105-new-inspector-tab

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #3105

After an OAuth redirect, the address bar no longer has the launch query string, so a URL copied from that tab can't start another server. This PR doesn't try to keep the query string across the redirect. Instead, the Active Sessions modal gets a New tab button that opens a fresh Inspector tab on the full launch URL, so that tab runs its own session.

Changes

  • clients/web/src/lib/newInspectorTab.ts (new):
    • buildNewInspectorTabUrl(origin, token) builds the origin's root URL and adds ?MCP_INSPECTOR_API_TOKEN=… when auth is enabled.
    • openNewInspectorTab() opens that URL using the token this tab already recovered (getAuthToken()), with noopener,noreferrer. noopener matters here: without it, the browser gives the new tab a copy of this tab's sessionStorage, which holds the per-tab session state.
  • ActiveSessionsModal: new onOpenNewTab prop, and a New tab button with a tooltip next to Refresh in the header.
  • App.tsx: passes openNewInspectorTab to the modal as onOpenNewTab.
  • Tests: unit tests for the URL builder and the window.open call, a click test for the modal button, and the story's args updated.

Screenshots

These come from the Storybook WithSessions story at 1280×900. The large session ages come from the story's fixed timestamps, not from this change.

Active Sessions modal with the New tab button

New tab button tooltip

Verification

npm run format and npm run local:gate both pass.

🤖 Generated with Claude Code

After an OAuth redirect the address bar loses the launch query string, so
copying it into a new tab can't start another server. Rather than preserve
the query across the redirect, the Active Sessions modal gets a New tab
button that rebuilds the launch URL (origin + auth token) and opens it with
noopener, so the new tab gets its own sessionStorage and its own session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Nov 30, 2026
@cliffhall
cliffhall requested a balanced review from Copilot November 30, 2026 21:26

Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the new Inspector tab action in the Active Sessions modal.

No open issues 🎉

What changed in this PR

Adds a New tab action to the web Inspector’s Active Sessions modal for #3105, allowing users to open a fresh Inspector tab after OAuth removes the launch query string.

Changes:

  • Rebuilds the launch URL with the recovered auth token when present.
  • Opens the tab with noopener,noreferrer to avoid copying the current tab’s session storage.
  • Wires the modal action into the app and updates unit tests and Storybook arguments.
File Description
clients/​web/​src/​lib/​newInspectorTab.ts Builds the launch URL and opens an independent tab.
clients/​web/​src/​lib/​newInspectorTab.test.ts Tests URL construction and window-opening options.
clients/​web/​src/​components/​groups/​ActiveSessionsModal/​ActiveSessionsModal.tsx Adds the New tab button, tooltip, and callback prop.
clients/​web/​src/​components/​groups/​ActiveSessionsModal/​ActiveSessionsModal.test.tsx Tests that clicking New tab invokes the callback.
clients/​web/​src/​components/​groups/​ActiveSessionsModal/​ActiveSessionsModal.stories.tsx Supplies the new callback in story arguments.
clients/​web/​src/​App.tsx Connects the modal callback to the tab-opening helper.

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 came back clean, with no inline comments, no headline findings and no suppressed comments.

@cliffhall

Copy link
Copy Markdown
Member Author

Testing note: the New tab button opens the right URL, but connecting a server in the new tab hangs while the first tab is connected. The cause is not this PR: Chrome's 6-per-host connection limit is shared by all tabs, and each tab holds three SSE streams open. A second tab opened by hand fails the same way. Tracked in #3107.

@cliffhall
cliffhall merged commit a1d39d7 into v2/main Nov 30, 2026
12 checks passed
@cliffhall
cliffhall deleted the v2/feat/3105-new-inspector-tab branch November 30, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Active Sessions modal: button to open a new Inspector tab with the full URL

2 participants