Skip to content

fix(terminal): honor explicit Actions link-click choice over legacy disabled flag - #25591

Closed
drakeo338 wants to merge 4 commits into
stablyai:mainfrom
drakeo338:claude/25576-fix
Closed

drakeo338 wants to merge 4 commits into
stablyai:mainfrom
drakeo338:claude/25576-fix

Conversation

@drakeo338

Copy link
Copy Markdown
Contributor

ELI5

Picking "Actions" for plain-click on terminal links now sticks, even if an old setting had turned the popover off.

What Changed

terminalLinkClickBehaviorFor fell back to the legacy terminalLinkActionPopoverEnabled: false flag when the behavior was actions, so it resolved to none and the control snapped back to "Leave to terminal". An explicit actions choice now wins, and picking Actions in settings also writes the legacy flag as enabled.

Why

The explicit setting should override the legacy flag; the legacy flag is only meant for profiles that never chose.

Linked Issue

Fixes #25576.

Visual Proof

N/A, settings logic fix covered by unit tests; no screenshots taken.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

The new and updated tests fail on the old code and pass now (9 passed). Lint, typecheck and build were not run locally.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and 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

Renderer settings logic only; no platform, SSH or path impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…n settings

The resolver falls back to terminalLinkActionPopoverEnabled for 'actions' so
profiles that disabled the popover keep leave-to-terminal after the default
merge adds terminalLinkClickBehavior: 'actions'. Drop the resolver early
return and have the settings control re-enable the legacy flag instead.

Fixes stablyai#25576
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 76202598-97fb-450c-b4bd-389dd48e61fb
📥 Commits

Reviewing files that changed from the base of the PR and between e49903c and 3ee2771.

📒 Files selected for processing (1)
  • src/main/persistence/loading-store/normalize-loaded-global-settings.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

When Actions is selected for plain-click behavior, the setting update now also enables terminalLinkActionPopoverEnabled. Other selections update only terminalLinkClickBehavior. Added tests cover both updates and verify that a legacy profile with the popover disabled and no stored click behavior normalizes to none.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to 3ee27

New Actions selections now enable the popover, but users whose profiles already store Actions alongside a false legacy flag still get no action popover and see the setting as “Leave to terminal” until they reselect it. This is a bounded but unresolved gap in the behavior this PR targets.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 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 identifies the terminal link-click behavior fix and the legacy disabled flag involved.
Description check ✅ Passed The description explains the user-facing issue, the change, its rationale, and the linked issue. It reports automated tests and notes that lint, typecheck, and build were not run. The visual-proof sec…
Linked Issues check ✅ Passed Issue #25576 requires the Actions choice to remain selected when the legacy flag is false. The settings control now writes terminalLinkActionPopoverEnabled: true when the user selects actions. The…
Out of Scope Changes check ✅ Passed The settings update and its tests address issue #25576. The normalization test checks that profiles with only the legacy flag retain their prior behavior. The available change summary shows no unrelat…
  • Fix all pre-merge checks with AI
  • Autopilot · 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61005557-4d8b-41a8-aa9b-bce3b8ce6dba
📥 Commits

Reviewing files that changed from the base of the PR and between d173514 and be69f0a.

📒 Files selected for processing (3)
  • src/main/persistence/loading-store/normalize-loaded-global-settings.test.ts
  • src/renderer/src/components/settings/BrowserTerminalLinkActionsSetting.test.tsx
  • src/renderer/src/components/settings/BrowserTerminalLinkActionsSetting.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog 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.

ℹ️ No blocking issues — one rollout tradeoff and a couple of nits worth a look.

Reviewed changes

  • BrowserTerminalLinkActionsSetting.tsx — plain-click onChange now co-writes terminalLinkActionPopoverEnabled: true when actions is chosen, so the control stops snapping back to "Leave to terminal". The resolver is deliberately left unchanged.
  • BrowserTerminalLinkActionsSetting.test.tsx — new component test pinning the co-write, and asserting the other two choices leave the legacy flag alone. This test fails on the pre-fix write path, so it is real coverage.
  • normalize-loaded-global-settings.test.ts — new integration test that a legacy popover-disabled profile still resolves to none after the default merge, plus a helper tweak that deletes undefined overrides so they model a key that was never stored.
  • Commit ed468e1fde added an actions early return to the resolver; commit be69f0a97f reverted it in favor of the write-side fix.

I traced the design choice in the second commit and it holds: normalizeLoadedGlobalSettings spreads defaults.settings (which now carries terminalLinkClickBehavior: 'actions') before the persisted settings, so a legacy profile with no stored behavior arrives at the resolver as explicit 'actions'. A resolver early return would hand those profiles the popover back, so keeping the legacy flag consulted for 'actions' and fixing at the write site is the correct shape. The change also covers the native-chat path, which shares the resolver for explicit behaviors.

ℹ️ Profiles already in the broken state still need a manual re-selection

The fix only changes the write path, so a profile that already persisted { terminalLinkClickBehavior: 'actions', terminalLinkActionPopoverEnabled: false } from the affected build still resolves to none on load. After upgrading, Settings still shows "Leave to terminal" until the user clicks Actions again; at that point it now sticks. If auto-healing that cohort is desired, the only place that can tell "explicit actions from the broken build" apart from "legacy profile that got the default" is a one-shot normalization that inspects the raw persisted key before the default merge. Otherwise this is a reasonable tradeoff.

Technical details
# Existing affected profiles are not migrated

## Affected sites
- `src/main/persistence/loading-store/normalize-loaded-global-settings.ts:58` — `...defaults.settings` merges `terminalLinkClickBehavior: 'actions'` before the persisted settings, so the resolver cannot distinguish explicit `actions` from the legacy default after load.
- `src/renderer/src/components/terminal-pane/terminal-link-click-behavior.ts:18` — returns `'none'` for `{ actions, terminalLinkActionPopoverEnabled: false }`.
- `src/renderer/src/components/settings/BrowserTerminalLinkActionsSetting.tsx:96` — write-side fix in scope.

## Required outcome
- Decide whether the cohort already stuck on "Leave to terminal" should be healed automatically on upgrade, or whether re-selecting Actions (now working) is the accepted remedy.

## Suggested approach (optional)
- A one-shot normalization could read the raw `parsed.settings.terminalLinkClickBehavior === 'actions'` together with `terminalLinkActionPopoverEnabled === false` before the default merge and set the legacy flag `true`. This is only safe because the broken build is what persisted the explicit `'actions'` alongside the legacy `false`.

## Open questions for the human
- Is the manual re-selection acceptable, or do you want the load-time migration?

ℹ️ Nitpicks

  • BrowserTerminalLinkActionsSetting.tsx:100 — the comment says "Clear it so the control does not snap back", but the code sets the legacy flag to true rather than clearing it. "Re-enable it" reads truer to what the line does.
  • The PR title and body say the explicit actions choice now wins over the legacy flag, but the resolver is intentionally unchanged — the win happens at the settings write. Aligning the title with the commit message ("write the legacy popover flag when Actions is picked") would keep the next reader from expecting a resolver change.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

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 <[email protected]>
@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#25576) has been resolved on main by #26853 (56d25b00bd). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 2026
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

2 participants