Repository navigation
Conversation
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The supplied evidence establishes no issue that needs to be fixed before merging. Pre-merge checks |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/terminal-link-click-ownership.spec.ts (1)
189-195: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCheck PTY ownership after the modified click.
The earlier Leave to terminal click makes
mouseLogPathnonempty. The external URL and popover assertions can therefore pass if the modified click also sends a mouse report to the terminal. Record the report count before the modified click and assert that it does not increase afterward.Suggested test assertion
await expectChildMouseReports(mouseLogPath) + const reportsBeforeModifiedClick = childMouseReportCount(mouseLogPath) const modifier = process.platform === 'darwin' ? 'Meta' : 'Control' ... await expect .poll(async () => (await readPanelNavigationObserver(electronApp)).externalUrls) .toEqual([LINK, LINK]) + await expect + .poll(() => childMouseReportCount(mouseLogPath)) + .toBe(reportsBeforeModifiedClick)
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1eb87c6a-5797-4b7c-a2cb-092becf3a5c3
📒 Files selected for processing (5)
src/main/persistence/applying-settings/settings-update-terminal-link-preference.test.tssrc/main/persistence/applying-settings/settings-update.tssrc/main/persistence/loading-store/durable-settings-write.test.tssrc/main/persistence/loading-store/profile-preferences.tstests/e2e/terminal-link-click-ownership.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
An explicit Actions, Open URL, or Leave to terminal choice now also writes the legacy terminalLinkActionPopoverEnabled switch, so an older opt-out no longer snaps the Actions selection back to Leave to terminal. Fixes #25576 Co-authored-by: drakeo338 <paranoyouz@gmail.com>
cbea9a4 to
9d9f835
Compare
There was a problem hiding this comment.
🔇 Additional comments (2)
tests/e2e/terminal-link-click-ownership.spec.ts (2)
125-162: Set Actions state through the store or assert the final state through the DOM only.The test uses
window.__storeonly for setup (the legacy opt-out) and asserts on the DOM. This follows the e2e guideline. No change is needed here.
199-202: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Use
ControlOrMetainstead of manual platform detection.The test selects
MetaorControlwithprocess.platform. Playwright mapsControlOrMetato the correct key on each OS. Use it to remove the branch.♻️ Proposed fix
- const modifier = process.platform === 'darwin' ? 'Meta' : 'Control' - await orcaPage.keyboard.down(modifier) + await orcaPage.keyboard.down('ControlOrMeta') await orcaPage.mouse.click(target.x, target.y) - await orcaPage.keyboard.up(modifier) + await orcaPage.keyboard.up('ControlOrMeta')Based on learnings: use the
ControlOrMetamodifier key in Playwright tests instead of manually detecting the platform.Source: Learnings
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
99649933-0e83-4d54-94bf-3277d2637589
📒 Files selected for processing (1)
tests/e2e/terminal-link-click-ownership.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
ELI5
Choosing Actions for terminal URL clicks now actually turns the popover back on for profiles that had opted out under the older on/off switch.
What Changed
Before: profiles with the legacy
terminalLinkActionPopoverEnabled: falsesaw Actions snap back to "Leave to terminal", because the resolver falls back to the legacy switch when the new field readsactions(which is also the stored default, so it can't tell an explicit choice from a default).After: an explicit Actions / Open URL / Leave to terminal write also sets the legacy switch (
trueonly for Actions) insideupdateSettings. Profiles that never touch the control keep their old opt-out.Why
Synchronizing on the explicit write is the only point where intent is unambiguous. A load-time migration can't distinguish a stored default from a real choice and would drop intentional opt-outs.
This PR was reduced from an earlier version that also reworked durable-save rollback ownership in
profile-preferences.ts. That path (updateSettingsAndFlush) is only used foralwaysForceDeleteWorktreeswrites, so it never affected this setting; it's dropped here and can be raised separately if needed.Linked Issue
Fixes #25576
Visual Proof
Before — Actions snaps back
After — Actions stays selected after reload
After — a real terminal URL opens the popover
Testing
Automated tests added/updated
settings-update-terminal-link-preference.test.ts: 6 cases (explicit writes for each choice, legacy-only writes, persistence across reopen). 4 fail without the fix, all pass with it.e2e
terminal-link-click-ownership.spec.ts: Actions re-enables after a legacy opt-out and survives reload; Open URL / Leave to terminal keep Cmd/Ctrl-click direct-open.pnpm tc:node, oxlint, oxfmt, and the changed-code quality gate pass locally (macOS).AI Disclosure
Review
Cross-platform: modified clicks use Meta on macOS, Control elsewhere. Applies to local, folder, and SSH terminals; no wire or remote changes.
Agent skill upstream boundary
Notes
Thanks to @Cyb3rN8 for #25576, @ggbdpq for investigating in #25596, and @drakeo338 for the explicit-write approach in #25591 (retained as
Co-authored-by).Checklist