You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(e2e): fix paired HTML preview link spec after preview links began honoring in-app preference - #39190
A nightly end-to-end test clicks a link inside a previewed HTML file on a paired (remote) workspace and expects it to open in Orca's browser. It has failed every night since Oct 31 because the app changed on purpose and the test didn't.
Files
Added
Deleted
Net
Test
3
$\color{#1a7f37}{\Huge{\mathbf{+}}}$42
$\color{#cf222e}{\Huge{\mathbf{−}}}$39
$\color{#1a7f37}{\Huge{\mathbf{+}}}$3
Prod
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$10
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$10
What Changed
Before: after #33622, a confirmed preview link follows the user's "Open links in Orca" preference. That preference is off by default, so the link goes to the system browser, and the app no longer calls openBrowserProfileTabInActiveWorkspace, the store action the test was spying on. Nothing recorded the click and no tab opened, so the test timed out on "a confirmed preview link never opened an Orca browser tab".
After (test only):
The paired client turns on openLinksInApp before the link checks, which is the setting that now decides where the link goes.
The stale store spy (and its as never cast) is replaced by readClientBrowserPageUrls, which reads the URLs of the client's browser pages directly. So the test now checks where the link actually ends up, whichever opener created the tab.
Every assertion is at least as strong as before. With no input, and after Cancel, the client's page URLs must match the baseline exactly. After "Open link", a client page must be at https://example.com/from-preview, a new tab must exist, and the preview must still be open.
Adds a PR e2e route so that changes to doc-preview sources (src/**/doc-preview*, browser-pane/workspace-doc/*, and the inventory helper) run this spec, plus routing tests.
Why
The product change was deliberate: #33622 made preview links follow browser preferences and modifier keys, and unit tests cover the system-browser default. Turning the preference on is what a user who wants in-app links would do. Running the default path in e2e would launch a real system browser on CI and on dev machines. Spying on the new opener would tie the test to another internal function. Reading the resulting page URL tests what the user actually sees.
Linked Issue
Nightly e2e failures (runs 41223095376 through 42273799189).
Visual Proof
N/A: test-only change.
Testing
Local run gets through the whole preview, chip, close and reopen flow up to the native-focus step. That step is blocked under ORCA_BACKGROUND_LAUNCH by design, so the link-click section runs only on CI.
pnpm test config/scripts/workflow/source-routing/pr-e2e-gate-contract.test.mjs, pnpm tc, check:code-quality:changed
The changed spec is selected for this PR's e2e run.
Risk
Level: Low. Only test code and CI routing change. The new route adds this spec (about 4 minutes) to PRs that touch doc-preview sources.
Agent skill upstream boundary
Not applicable.
Notes
The link opens on the paired runtime because the source is runtime-owned, so this checks the remote path rather than a local-only one.
…nk preference
Since #33622 a confirmed HTML preview link honors openLinksInApp (default off,
so it opens the system browser) and no longer calls
openBrowserProfileTabInActiveWorkspace, so the spec's store spy never fired.
Opt the client into in-app links and observe the opened page URL directly.
Route doc-preview sources to the spec.
The changes add a source route for the paired HTML preview E2E spec, with contract tests for files that should and should not select it. The spec now uses client browser page URLs to check that genuine input and cancellation do not open a page, and that confirming a link opens the external URL. The inventory helper adds URL collection across workspaces and removes the prior link-routing instrumentation.
Merge Risk: Moderate · up to 4762b
The updated paired-preview test cannot complete its link checks under the required launch policy, and its URL checks can pass without proving the intended behavior. Resolve those test gaps before relying on the new routing and assertions for merge readiness.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly describes the paired HTML preview test fix.
Description check
The description covers the change, rationale, testing, and risk. It does not state the tested platforms or rollback plan. It also does not link an issue, which the template requires for outside contri…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description covers the change, rationale, testing, and risk. It does not state the tested platforms or rollback plan. It also does not link an issue, which the template requires for outside contributors.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving 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.
Distinguish a canceled open from the confirmed open.
If Cancel incorrectly starts an asynchronous open, the tab can appear after the single URL check. The later check can accept that tab as the confirmed open. Observe the Cancel case through an appropriate completion boundary before attributing a tab to confirmation.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 8742eba5-ecd4-461e-8276-27ade755bd3b
Commits
Reviewing files that changed from the base of the PR and between be3b87f and 4762b2c.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
On the paired-runtime path, the staged page already has EXTERNAL_LINK_URL. The assertion can pass before the create RPC fails and removes that page. Require successful materialization before accepting its URL.
printf'%s\n''--- home environment construction ---'
rg -n -F -e 'createElectronHomeIsolation' -e 'inheritedEnv' -e 'launchEnv' -- tests/e2e/helpers/electron-home-isolation.ts
nl -ba tests/e2e/helpers/electron-home-isolation.ts | sed -n '1,180p'printf'%s\n''--- intervening test control flow ---'
nl -ba tests/e2e/paired-remote-html-preview-local-render.spec.ts | sed -n '175,355p'printf'%s\n''--- fixture guards and launch ---'
nl -ba tests/e2e/helpers/orca-app.ts | sed -n '100,220p'
Repository: stablyai/orca
Length of output: 21013
Make the link test compatible with the background launch policy.
With ORCA_BACKGROUND_LAUNCH=1, the focus helper throws before the changed link assertions run. Removing that setting lets the helper reveal and focus the window, but this spec is not an approved exception. Exercise the link flow without violating the launch policy.
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
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.
ELI5
A nightly end-to-end test clicks a link inside a previewed HTML file on a paired (remote) workspace and expects it to open in Orca's browser. It has failed every night since Oct 31 because the app changed on purpose and the test didn't.
What Changed
Before: after #33622, a confirmed preview link follows the user's "Open links in Orca" preference. That preference is off by default, so the link goes to the system browser, and the app no longer calls
openBrowserProfileTabInActiveWorkspace, the store action the test was spying on. Nothing recorded the click and no tab opened, so the test timed out on "a confirmed preview link never opened an Orca browser tab".After (test only):
openLinksInAppbefore the link checks, which is the setting that now decides where the link goes.as nevercast) is replaced byreadClientBrowserPageUrls, which reads the URLs of the client's browser pages directly. So the test now checks where the link actually ends up, whichever opener created the tab.https://example.com/from-preview, a new tab must exist, and the preview must still be open.src/**/doc-preview*,browser-pane/workspace-doc/*, and the inventory helper) run this spec, plus routing tests.Why
The product change was deliberate: #33622 made preview links follow browser preferences and modifier keys, and unit tests cover the system-browser default. Turning the preference on is what a user who wants in-app links would do. Running the default path in e2e would launch a real system browser on CI and on dev machines. Spying on the new opener would tie the test to another internal function. Reading the resulting page URL tests what the user actually sees.
Linked Issue
Nightly e2e failures (runs 41223095376 through 42273799189).
Visual Proof
N/A: test-only change.
Testing
ORCA_BACKGROUND_LAUNCHby design, so the link-click section runs only on CI.pnpm test config/scripts/workflow/source-routing/pr-e2e-gate-contract.test.mjs,pnpm tc,check:code-quality:changedRisk
Level: Low. Only test code and CI routing change. The new route adds this spec (about 4 minutes) to PRs that touch doc-preview sources.
Agent skill upstream boundary
Notes
The link opens on the paired runtime because the source is runtime-owned, so this checks the remote path rather than a local-only one.