Repository navigation
fix(browser): open in-app links as a tab in the clicked pane's group - #265
Merged
Merged
Conversation
…plit Clicking an http(s) link that routes into the in-app browser (the Checks panel's PR id, a terminal link, a chat link) split a new pane beside the clicked one, which shrank the agent or terminal the link came from. Auto-placement now targets the clicked pane's own tab group: the page joins it as a sibling tab, and the focused group wins when the click has no source tab. A pane already showing a browser still attracts the page, so the existing reuse and recency rules are unchanged, and "Open in this group" keeps meaning something because a visible browser elsewhere still wins. The split path was the only producer of `selectBrowserLinkDestination`'s `split` field, so the field and its threading through the local and runtime open helpers are gone rather than left unreachable.
Review follow-ups on the same-group placement: - drop the two fork rationale comments the ratchet counts in upstream-owned files (6060 vs a 6058 baseline); the behaviour is in the PR body instead - delete `OpenWorkspaceBrowserTabRequest.split`, which nothing set once the split placement went away, so the runtime path can no longer inherit a caller split - assert the clicked group still shows its terminal on a background open and on an open that navigated away, the property the split used to guarantee - say "the clicked pane's group, or the focused pane's for a sidebar link" in the docs, since a Checks-panel link has no source pane
This was referenced Nov 1, 2026
nplez1
added a commit
that referenced
this pull request
Nov 1, 2026
…ent reds (#268) * fix(agent-session): read lstart in UTC, and fix the stale link-placement reds The unit gate is red on main for six cases, none of them in a file #265 touched, so its own suite never saw them. Five are stale placement assertions. #265 moved an in-app link from a new split pane into the clicked pane's own tab group; `file-preview-link-open` (four cases) and `NativeChatInlineVisual.link-placement` still asserted the split: a new group beside the source, and the source tab left showing. They now assert what #265 made true — the page joins the clicked group and takes it over, no group is added, and the layout is untouched — matching how #265 rewrote `browser-link-open-layout-owner` and `http-link-source-placement`. The sixth is a real bug in the darwin start-time probe, not a stale test. `ps -o lstart=` prints local wall clock, and the hour a DST fall-back repeats resolves to the earlier offset: on 2026-11-01 a process started at 01:37 PST read back an hour early, so the probe's own tolerance check failed. `lstart` is now requested with TZ=UTC — which `runPsInProcess` also formats for — and parsed as UTC, so a start time is one instant whatever the zone. The new test pins the repeated-hour string, which a local read cannot satisfy. Why this matters beyond the test: `readProcessStartTimeMs` decides whether an agent-session owner or a spawned provider process is still the same process. An hour of error there is an hour of misidentification, twice a year. * fix(test): assert the placement the tests describe Round 1 (Opus, high) raised nothing blocking and two one-hunk minors. The folder-workspace case asserted an active group its own seed had already set, so it could not fail and nothing proved the "activates its browser" half of its title. Both rewritten tests also said the page "joins as a sibling tab and takes it over" without asserting either: they now pin the group's activeTabId to the page and the source tab's survival in tabOrder, so a replacement would fail where only a move would not. Two nits as well: the titles that still said "beside", and the pairing of the UTC printer with the UTC parser, which only the live darwin test covered. * fix(test): keep the zone test cross-platform, and pin the reported group The delta round caught the new test failing off darwin: `psLocaleEnvironment` pins the en_US locale only on darwin, so `LC_ALL` is unset on the Linux nightly. The locale assertion is now darwin-only; the zone assertion, which is the point, holds everywhere. The detected-preview case also pins the group its outcome reports, which the rewritten store assertion had stopped covering.
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.
Why
Clicking a link that routes into the in-app browser — the Checks panel's PR id, a terminal link, a chat link — split a new pane beside the clicked one, so the agent or terminal the link came from got narrower instead of staying put. The page now opens as a sibling tab in the clicked pane's tab group.
Reported as: "I would rather it open as a new tab of the focused tab group instead of a new tab group like that."
What changed
selectBrowserLinkDestination(browser-link-destination.ts) — the path a Checks-panel click takes (openHttpLink→openWorkspaceBrowserTabForLink→openClientWorkspaceBrowserLink) — returnedsplit: { sourceGroupId, splitDirection: 'right' }whenever the source group had an active tab. It now returns that group asgroupId.resolveHttpLinkBrowserPlacement(http-link-browser-placement.ts) — the same rule for the direct local open and the remote prepare path — same change.selectBrowserLinkDestination'ssplitfield had no other producer, so the field and its threading (browser-link-open.ts,prepareRuntimeBrowserLink,workspace-browser-tab-open.ts) are deleted rather than left unreachable, together with the now-deadOpenWorkspaceBrowserTabRequest.split.resolveWebRuntimeBrowserClientTargetGroupkeeps its ownsplit, which the tab-bar split command still uses.Notes
openLinksInAppInBackground) still does not steal focus: the tab joins the clicked group without becoming its active tab. Asserted in three tests, since the split used to make that impossible to get wrong.openFileInBrowserTab— the link path for a terminal click on an HTML file — now opens as a tab too, for the same reason. OnlyopenFilePreviewToSide(file-preview.ts:276) still splits: "preview this file in a browser pane" is a different intent, and its split keeps the editor visible.afterTabId); it appends to the group's order. Reviewer MINOR, recorded here rather than changed.local/check-upstream-file-comments.mjsto 6060 against a 6058 baseline (a PR-gate-1 red). Both were removed; the rationale lives in this body instead.The branch was rebased onto the current
nplez1/maintip (c08b45fc6f0) after the review, to be a descendant of it.git range-diffshows both commits byte-identical, so the reviewed hunks are unchanged.Verification
pnpm tcclean at R2 and on the rebased revision (0bf26f8);pnpm tc:webclean;pnpm run check:code-quality:changedclean.orca-queue node local/gate-lint.mjs→ PASS @0bf26f8e77c, 44 green, 0 failing.local/open-pr.mjsneeds no cached unit-gate verdict here.Reviewed by Opus 5.5, high: R1 clean (3 MINOR, 3 NIT), delta clean on R2