Skip to content

fix(settings): reenable terminal link Actions after an old opt-out - #26853

Open
nwparker wants to merge 1 commit into
mainfrom
nwparker/obvious-terminal-link-preference-10-09
Open

nwparker wants to merge 1 commit into
mainfrom
nwparker/obvious-terminal-link-preference-10-09

Conversation

@nwparker

@nwparker nwparker commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 789 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29458 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12957 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16501
Prod 1003 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28639 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16491 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12148

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: false saw Actions snap back to "Leave to terminal", because the resolver falls back to the legacy switch when the new field reads actions (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 (true only for Actions) inside updateSettings. 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 for alwaysForceDeleteWorktrees writes, 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

Before selecting Actions

After — Actions stays selected after reload

Actions after reload

After — a real terminal URL opens the popover

Terminal URL Actions 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

  • Not applicable.

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

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • CI passes

@nwparker
nwparker marked this pull request as ready for review October 9, 2026 11:35
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

updateSettings now synchronizes the legacy terminal-link popover setting when an update explicitly sets click behavior to actions, open, or none. Added tests cover update notifications, persisted preferences after profile reopen, and end-to-end click behavior, including external navigation and child PTY mouse reports.


Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9d9f8

The supplied evidence establishes no issue that needs to be fixed before merging.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: re-enabling terminal link Actions after a legacy opt-out.
Description check Passed The description is complete and focused. It includes the user impact, implementation details, rationale, linked issue, visual proof, testing coverage, platform considerations, and checklist status. Th…
Linked Issues check Passed Issue #25576 requires an explicit Actions choice to override a stored terminalLinkActionPopoverEnabled: false value. updateSettings synchronizes the legacy flag on explicit `terminalLinkClickBehav…
Out of Scope Changes check Passed The changes stay within issue #25576. Synchronization for open and none preserves the related preference state, and the unit and E2E changes validate the terminal-link behavior. No unrelated produ…

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/e2e/terminal-link-click-ownership.spec.ts (1)

189-195: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Check PTY ownership after the modified click.

The earlier Leave to terminal click makes mouseLogPath nonempty. 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
📥 Commits

Reviewing files that changed from the base of the PR and between 049bf80 and 27c03fd.

📒 Files selected for processing (5)
  • src/main/persistence/applying-settings/settings-update-terminal-link-preference.test.ts
  • src/main/persistence/applying-settings/settings-update.ts
  • src/main/persistence/loading-store/durable-settings-write.test.ts
  • src/main/persistence/loading-store/profile-preferences.ts
  • 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; 0 remain after this review.

nwparker added a commit that referenced this pull request Oct 9, 2026
Records the retained adapted contribution from #25591 in replacement PR #26853.

Co-authored-by: drakeo338 <paranoyouz@gmail.com>
@nwparker
nwparker changed the base branch from main to nwparker/medium-settings-reply-risk-10-10 October 10, 2026 09:05
@nwparker nwparker changed the title fix(settings): reenable terminal link Actions after an old opt-out fix(settings): preserve terminal link choices across delayed saves Oct 10, 2026
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>
@nwparker
nwparker force-pushed the nwparker/obvious-terminal-link-preference-10-09 branch from cbea9a4 to 9d9f835 Compare October 11, 2026 00:45
@nwparker nwparker changed the title fix(settings): preserve terminal link choices across delayed saves fix(settings): reenable terminal link Actions after an old opt-out Oct 11, 2026
@nwparker
nwparker changed the base branch from nwparker/medium-settings-reply-risk-10-10 to main October 11, 2026 00:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔇 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.__store only 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 ControlOrMeta instead of manual platform detection.

The test selects Meta or Control with process.platform. Playwright maps ControlOrMeta to 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 ControlOrMeta modifier 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
📥 Commits

Reviewing files that changed from the base of the PR and between 0d9e02b and 9d9f835.

📒 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plain-click "Actions" setting can't be re-enabled when legacy terminalLinkActionPopoverEnabled is false

1 participant