fix(desktop): keep the retired page open action when healing page links
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 oncepageLinksexists, and an unknown value falls back to defaults. The first fails without the fix. bun teston the file passes (46).biome checkon both files andbun run typecheckin apps/desktop are clean.- I hit this myself. After updating, my localStorage row still had
"pageOpenAction": "external"and nopageLinks.
No UI change, so no screenshots.
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (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
pageOpenActionand nopageLinks, the old action becomes the cmd-click tier ofpageLinks, leaving plain-click behavior unchanged. - Unknown legacy values fall back to defaults.
- Legacy value is ignored once
pageLinksis stored.
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.