Skip to content

fix: align preview layout store key#1478

Merged
manojVivek merged 1 commit intoresponsively-org:mainfrom
Dailin521:codex/responsively-1458-preview-layout-key
Mar 23, 2026
Merged

fix: align preview layout store key#1478
manojVivek merged 1 commit intoresponsively-org:mainfrom
Dailin521:codex/responsively-1458-preview-layout-key

Conversation

@Dailin521
Copy link
Copy Markdown
Contributor

Summary

This fixes the persisted preview layout key mismatch reported in #1458.

Root cause

The electron-store schema defined the layout setting as ui.previewlayout, while the renderer reads and writes ui.previewLayout. Fresh installs therefore missed the schema default for the key the app actually uses, and existing users could lose their saved layout after the schema key is corrected unless the legacy key is migrated.

Changes

  • rename the schema key to ui.previewLayout so the default matches the renderer store access
  • add a migration that copies any existing ui.previewlayout value into ui.previewLayout and removes the legacy key
  • add a focused regression test for the migration path

Verification

  • npx vitest run src/store/migrations.test.ts
  • npx eslint src/store/index.ts src/store/migrations.ts src/store/migrations.test.ts
  • npx tsc --noEmit

Fixes #1458

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 23, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Collaborator

@manojVivek manojVivek left a comment

Choose a reason for hiding this comment

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

@Dailin521 Looking great, thank you so much for the contribution!

@manojVivek manojVivek merged commit 9f580e1 into responsively-org:main Mar 23, 2026
4 checks passed
@manojVivek
Copy link
Copy Markdown
Collaborator

@all-contributors Please add @Dailin521 for code.

@allcontributors
Copy link
Copy Markdown
Contributor

@manojVivek

I've put up a pull request to add @Dailin521! 🎉

@Dailin521 Dailin521 deleted the codex/responsively-1458-preview-layout-key branch March 31, 2026 02:32
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.

Inconsistent previewlayout key in electron-store schema

3 participants