Repository navigation
Open open new link should not navigate away from current link - #18873
AmethystLiang merged 10 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe change separates foreground and background clicked-link routing for main frames and iframes. Popup handling now propagates tab activation state through the manager, preload API, and renderer IPC bridge. In-Orca popup notices are suppressed. Context-menu and remote-link tab creation now avoids activation. Browser tabs display loading icons. Unit and end-to-end tests cover foreground, background, modifier, middle-click, iframe, and Shift+middle-click behavior. Merge Risk: ⚪ Minimal · up to Link-opening gestures now preserve the current tab for background opens while retaining foreground behavior for Shift+middle-click. The implementation and associated test coverage indicate no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkResolution Complete each required section with implementation details, rationale, and testing results. Add a valid linked issue after “Fixes #”. Attach before-and-after visual proof or write “N/A” with a reason. Report manual and automated testing, complete applicable checkboxes, and document cross-platform, SSH, security, compatibility, and performance considerations. ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve merge conflicts 💡
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 |
There was a problem hiding this comment.
ℹ️ No critical issues — one test-reliability rough edge inline.
Reviewed changes
- Foreground vs background clicked-link routing —
browser-clicked-link-routing.tsnow carries distinctforeground/backgroundframe names and routes modifier-click and middle-click to the background while Shift+modifier/Shift+middle stays foreground, matching Chrome. activatepassthrough to the renderer —openLinkInOrcaTabtakes an optionalactivateflag, forwarded overbrowser:open-link-in-orca-taband mapped ontocreateBrowserTab({ activate })(defaulting to foreground), withbackground-tabdisposition routed to background.- Tests — unit coverage for frame-name selection in both the isolated-world and iframe paths plus the renderer bridge, and an expanded e2e spec asserting overlay opacity for background vs foreground tabs.
The production change is sound: the foreground/background frame-name mapping, the disposition !== 'background-tab' fallback, and the activate ?? true renderer default are all consistent and backward-compatible (the IPC field is optional and defaults to foreground). The one concern is in the new e2e helper, noted inline.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
3d87958 to
098cbe4
Compare
There was a problem hiding this comment.
ℹ️ No critical issues — one test-coverage gap inline.
Reviewed changes
- Silenced
opened-in-orcapopup toasts —formatPopupNoticenow returnsnullfor links opened in Orca tabs, and both consumers (useBrowserClientHostedPopupNotices,useBrowserPageResourceNotices) skip a null notice, so only external and blocked popup outcomes still surface. - Background context-menu opens — "Open Link In Orca Browser" now opens in the background via
activate: false(local pane) andfocusOnCreate: false(remote pane throughopenWorkspaceBrowserTab). - e2e hardening — introduced
waitForTabIdByExactTitle(exact-title match) shared by both tab assertions, addressing the prior substring-match concern, and expanded the spec to cover context-menu, frame, and Shift+middle-click gestures.
The delta is sound: the popup-notice silencing is consistent across both consumers, and the background-activation flags align with the createBrowserTab/openWorkspaceBrowserTab contracts (focusOnCreate: false maps to activate: false). The one remaining concern is test coverage, noted inline.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Commit 2927c4b bundles five files outside this PR's scope — a CI workflow, three docs files, and package.json — likely from a stray git add -A or a formatter run with different settings. They should be dropped before merge.
Reviewed changes
- Animated loading spinners —
BrowserFavicongained aloadingprop that renders a spinningLoader2in place of the favicon, andBrowserTab/ClientHostedBrowserTabreplaced their blue loading dot with it. - Main-frame
target=_blanke2e coverage — the link server was extracted totests/e2e/helpers/browser-link-server.ts, and the spec now asserts a plain main-frametarget=_blankclick opens "Blank target destination" while the source tab keeps its "Source page" content, closing the coverage gap from the prior review. - Full gesture matrix — the spec now distinguishes foreground (plain / Shift) from background (modifier / middle / context-menu) opens across the main frame and iframe.
⚠️ Unrelated files bundled into the test commit
Four of the five files are formatting-only churn, but the package.json change removes a flag main deliberately added — and does so in the wrong direction.
Technical details
# Remove unrelated files from the PR
## Affected sites
- `package.json` — drops `--disable-warning=MODULE_TYPELESS_PACKAGE_JSON` from `bench:terminal-partial-escape-tail`. `main` currently carries two copies of that key (a pre-existing duplicate: one flagged, one plain); the correct cleanup keeps the flagged line and removes the plain duplicate, not the reverse.
- `.github/workflows/cloud-deploy-relay-production-director.yml` — `description` value re-quoted `"…"` → `'…'`.
- `docs/reference/windows-edr-posture.md`, `docs/site/content/docs/install.mdx`, `docs/site/content/docs/remote-servers.mdx` — emphasis flipped `*…*` → `_…_` and tables re-wrapped. `main` uses `*…*`, so this reverts `main`'s markdown convention.
## Required outcome
- Drop all five files from the PR so only the spinner and browser-link changes remain. If the `package.json` duplicate-key cleanup is wanted, do it separately and keep `--disable-warning=MODULE_TYPELESS_PACKAGE_JSON`.
## Open questions for the human
- Were these introduced by a stray `pnpm format` / `git add -A`, or is the branch stale against `main`?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Localized clicked-link frame names — the foreground/background frame-name pair is now generated inside
installGuestPopupPolicy(which takes a singlerouteClickedLinksboolean) instead of being stored in the per-guestclickedLinkFrameNameByGuestId/clickedLinkFrameNamesByGuestIdstate maps, both of which are deleted. - Dropped four of the five unrelated files — the CI workflow and three docs files flagged in the prior review are gone.
- Hardened tests — popup-routing and lifecycle tests now assert
activate: falseon background routing and verify listener teardown by reading the injected script rather than peeking at the removed private maps.
The refactor is behavior-preserving: frame-name randomness, the foreground/background activate resolution in handleDidCreateWindow, and the one-use iframe token handling are all unchanged. The 48 touched unit tests pass locally.
One carried-forward note, not blocking: package.json still contains the unrelated bench:terminal-partial-escape-tail duplicate-key cleanup (it drops the --disable-warning=MODULE_TYPELESS_PACKAGE_JSON variant, keeping the plain duplicate). Against main this is behavior-neutral because JSON last-key-wins already resolved that key to the plain line, but it is the one leftover of the five files the prior review asked to drop, so consider removing it to keep the PR scoped.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Shift held for middle-click gestures —
clickBrowserLinknow synthesizes a realShiftkeyDown/keyUparound the click sequence instead of only passingmodifiers: ['shift']on the mouse events, so theShift+ middle-click e2e cases actually exercise the foreground routing path rather than resolvingshiftKeyas false and routing to the background.
The delta is a focused, test-only fix: without a held Shift key the isolated-world click listener never observes shiftKey, so the foreground assertions (expectBrowserTabActive) could only pass by accident. The keyDown/keyUp are wrapped in try/finally so a mid-sequence throw still releases the modifier. No production code changed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Dropped the duplicate main-frame shift+middle e2e gesture — removed the
#shift-middle-linkblock fromtests/e2e/browser-tab.spec.ts, leaving the#frame-shift-middle-linkforeground assertion in place. The main-frame shift+middle→foreground routing stays covered by theit.eachunit test inbrowser-clicked-link-routing.test.ts, and the isolated-world path remains e2e-covered via the modifier/middle/blank-link gestures.
ℹ️ Nitpicks
tests/e2e/helpers/browser-link-server.tsstill defines the now-unused#shift-middle-linkfixture and theShift middle destinationtitle branch (the/sourcehandler). Harmless, but worth removing so the fixture doesn't imply a main-frame shift+middle case that's no longer asserted.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
3c34743 to
2e6a8fa
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Favicon reload-spinner test correction —
browser-favicon.test.tsxreworked the two loading/reload tests to assert the new spinner behavior:shows a loading spinner throughout a reloadnow verifies the<img>is unmounted and amotion-safe:animate-spinelement is present during a reload, andshows the favicon when initial loading finishesdrops thefireEvent.error(container.querySelector('img')!)call that would have thrown (no<img>exists whileloadingrenders theLoader2).
The delta is test-only and correct: both tests now exercise the Loader2 spinner path introduced by the earlier spinner commit, and the removed fireEvent.error(null!) call was a latent throw rather than a real assertion. No production code changed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Links opened with modifier keys (Cmd/Ctrl+click) and middle-click now open in background tabs, matching Chrome's behavior. Shift+middle-click continues to open in the foreground tab. The routing system now tracks separate foreground and background frame names, with an `activate` flag controlling whether the new tab is brought to focus.
When opening links via context menu or other mechanisms that create background tabs, keep focus on the source tab rather than automatically switching to the newly opened tab. Set `activate: false` on tab creation to prevent unwanted navigation away from the current page.
Links that open in new Orca tabs are immediately visible to the user and don't warrant a toast notification. Only external popup opens now show notifications, reducing unnecessary clutter while still alerting the user to unexpected external window opens.
Replaces the small dot indicators with animated Loader2 icons that appear in place of the favicon while tabs are loading. Provides clearer, more prominent visual feedback during navigation.
Add a test case checking that plain main-frame target=_blank clicks open in a new tab without navigating the source tab away. Extract startBrowserLinkServer to a helper module and add the /blank-destination endpoint to support the new test case.
Remove the global clickedLinkFrameNamesByGuestId state map and generate frame names locally within installGuestPopupPolicy, improving state encapsulation and simplifying cleanup logic. Functionality unchanged.
Updated test expectations to reflect that the favicon component shows a loading spinner during reload instead of keeping the previous image mounted.
891eaee to
f20dce2
Compare
Keep the background-tab behavior introduced by stablyai#18873 when resolving the link context-menu and browser gesture test conflicts.
…ai#18873) * fix(browser): open modifier-click and middle-click links in background t Links opened with modifier keys (Cmd/Ctrl+click) and middle-click now open in background tabs, matching Chrome's behavior. Shift+middle-click continues to open in the foreground tab. The routing system now tracks separate foreground and background frame names, with an `activate` flag controlling whether the new tab is brought to focus. * fix(browser): don't navigate away when opening links in background tabs When opening links via context menu or other mechanisms that create background tabs, keep focus on the source tab rather than automatically switching to the newly opened tab. Set `activate: false` on tab creation to prevent unwanted navigation away from the current page. * fix(browser): silence popup notices for links opened in Orca tabs Links that open in new Orca tabs are immediately visible to the user and don't warrant a toast notification. Only external popup opens now show notifications, reducing unnecessary clutter while still alerting the user to unexpected external window opens. * Replace loading dots with animated spinner icons Replaces the small dot indicators with animated Loader2 icons that appear in place of the favicon while tabs are loading. Provides clearer, more prominent visual feedback during navigation. * test(browser-tab): verify target=_blank links don't navigate source tab Add a test case checking that plain main-frame target=_blank clicks open in a new tab without navigating the source tab away. Extract startBrowserLinkServer to a helper module and add the /blank-destination endpoint to support the new test case. * refactor(browser): localize clicked-link routing frame names Remove the global clickedLinkFrameNamesByGuestId state map and generate frame names locally within installGuestPopupPolicy, improving state encapsulation and simplifying cleanup logic. Functionality unchanged. * test(browser-tab): hold shift for middle-click gestures * test(browser-tab): drop duplicate shift-middle gesture * test(browser-favicon): verify spinner shown while favicon reloads Updated test expectations to reflect that the favicon component shows a loading spinner during reload instead of keeping the previous image mounted. * fix ci

ELI5
What Changed
Why
Linked Issue
Fixes #
Visual Proof
Testing
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)