Repository navigation
Active Sessions: button to open a new Inspector tab with the full URL - #3106
Conversation
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>
There was a problem hiding this comment.
🟢 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,noreferrerto 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
|
Copilot review loop closed: round 1 came back clean, with no inline comments, no headline findings and no suppressed comments. |
|
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. |
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()), withnoopener,noreferrer.noopenermatters here: without it, the browser gives the new tab a copy of this tab's sessionStorage, which holds the per-tab session state.ActiveSessionsModal: newonOpenNewTabprop, and a New tab button with a tooltip next to Refresh in the header.App.tsx: passesopenNewInspectorTabto the modal asonOpenNewTab.window.opencall, a click test for the modal button, and the story's args updated.Screenshots
These come from the Storybook
WithSessionsstory at 1280×900. The large session ages come from the story's fixed timestamps, not from this change.Verification
npm run formatandnpm run local:gateboth pass.🤖 Generated with Claude Code