Skip to content

fix(desktop): keep the retired page open action when healing page links - #8154

Open
isaacchacko wants to merge 1 commit into
ParadevAI:mainfrom
isaacchacko:fix/migrate-page-open-action
Open

isaacchacko wants to merge 1 commit into
ParadevAI:mainfrom
isaacchacko:fix/migrate-page-open-action

Conversation

@isaacchacko

@isaacchacko isaacchacko commented Oct 4, 2026 •

Copy link
Copy Markdown

What & why

Fixes #8153.

#7962 replaced the single pageOpenAction preference with a pageLinks tier map, but nothing migrated the stored value. healV2UserPreferences fills pageLinks from defaults, so anyone who had customized "Pages" under Browser settings lost it when they updated to 1.33 or later. The old value sits in localStorage and nothing reads it.

Now, when a stored row has pageOpenAction and no pageLinks, the old action becomes the cmd-click tier of pageLinks. Before #7962 every terminal click on a page link ran pageOpenAction whatever the modifier. I kept it on cmd-click only, because binding plain click would change what an ordinary click does on every page link. If the old value was the default pane, the result equals today's default. Once pageLinks is stored, heal ignores the legacy field.

This can't help users who changed any preference after updating. That write persisted pageLinks with defaults.

How I tested it

  • Three cases in schema.test.ts: the legacy value carries over, it's ignored once pageLinks exists, and an unknown value falls back to defaults. The first fails without the fix.
  • bun test on the file passes (46). biome check on both files and bun run typecheck in apps/desktop are clean.
  • I hit this myself. After updating, my localStorage row still had "pageOpenAction": "external" and no pageLinks.

No UI change, so no screenshots.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs

🤖 Generated with Claude Code


Summary by cubic

Fixes #8153, where users who customized the "Pages" open action before 1.33 lost that setting on update because healV2UserPreferences never migrated the retired pageOpenAction preference.

Bug Fixes

  • When a stored row has pageOpenAction and no pageLinks, the old action becomes the cmd-click tier of pageLinks, leaving plain-click behavior unchanged.
  • Unknown legacy values fall back to defaults.
  • Legacy value is ignored once pageLinks is stored.

Written for commit 2d30c9a. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Existing page-opening preferences are now retained during settings updates. Legacy preferences without saved page-link settings continue using their prior valid action for metadata pages, while other page types use current defaults.
    • Preferences with saved page-link settings remain intact, and unrecognized legacy actions fall back to the default settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e71ad292-600a-4c35-8fc3-7506d2d1bbc3
📥 Commits

Reviewing files that changed from the base of the PR and between 01dff43 and 2d30c9a.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.test.ts
  • apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.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

The preference healer now migrates a valid legacy pageOpenAction value to the meta tier when pageLinks is absent. It also merges stored pageLinks tiers with current defaults. Tests cover migration, preservation of stored tiers, and fallback for an unknown action.

Changes

Page links preference migration

Layer / File(s) Summary
Migrate legacy page-link preferences
apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.ts, apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.test.ts
When pageLinks is absent and pageOpenAction is a valid link action, the healer assigns it to the meta tier and uses defaults for other tiers. It merges stored tiers with defaults otherwise. Tests cover migration, preservation of stored tiers, and an unknown action.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: kitenite

Merge Risk: ⚪ Minimal · up to 2d30c

The migration carries valid retired settings into the new page-link tiers, and the suspected click-behavior regression was not present in the applicable legacy code. No actionable merge risk is established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 2d30c

This is a narrowly scoped preference migration that preserves explicit current settings and uses existing link-opening controls. No introduced security failure was established, but concurrent-write recovery and complete URL-validation behavior remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed exposure is confined to desktop page-link interactions using an organization-scoped local preference row with a valid legacy action and no truthy current map. For legacy external values, Cmd/Ctrl-click can newly invoke the existing operating-system URL opener relative to base behavior.

Trust Boundaries and Controls

  • observed — Link URLs reaching the existing external-opening procedure remain subject to isSafeExternalUrl before shell.openExternal. The PR does not modify this procedure. The guard call was inspected, but its implementation was not recovered from capped source searches, so complete scheme-validation assurance remains a coverage gap.

Resilience and Maintainability Implications

  • observed — The existing read wrapper contains healer failures per entry instead of allowing one entry to invalidate all parsed rows. This failure-containment mechanism and the persistence configuration are unchanged by the migration.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #8153 requires the customized Page-link cmd-click action to survive an app update. healV2UserPreferences migrates a valid legacy pageOpenAction to pageLinks.meta when pageLinks is absent…
Out of Scope Changes check ✅ Passed The changes are limited to preference healing and tests for the legacy Page-link setting in issue #8153. No unrelated changes appear in the PR diff.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Title check ✅ Passed The title uses conventional commit format and clearly summarizes the migration of the retired page-open action during page-link healing.
Description check ✅ Passed The description includes the required What & why, How I tested it, and Checklist sections. It explains the change, its limits, the tests run, and checklist status.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • 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.

@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Migrates a retired user preference setting to a new format.

The PR appears safe to merge; no actionable issue was identified.

Summary

The PR carries a stored pageOpenAction into the cmd-click tier when pageLinks is absent, and adds tests for migration, precedence, and invalid legacy values.

Reviews (1) · Last reviewed commit: "fix(desktop): keep the retired page open..."

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.

Settings: Page links cmd+click preference reset after app update

1 participant