Skip to content

fix: persist ui language across browser reloads#834

Open
rezawr wants to merge 27 commits into
refactoringhq:mainfrom
rezawr:main
Open

fix: persist ui language across browser reloads#834
rezawr wants to merge 27 commits into
refactoringhq:mainfrom
rezawr:main

Conversation

@rezawr

@rezawr rezawr commented Jun 8, 2026

Copy link
Copy Markdown

Fixes #828 — UI language choice was not being persisted across browser reloads.

Changes

  • src/mock-tauri/mock-handlers.ts — hydrate the mock Settings from localStorage on module load, and write through to localStorage on every save_settings call. try/catch guards so a private-mode / quota failure degrades to in-memory only instead of throwing.
  • src/components/SettingsPanel.tsx + SettingsFooter.tsxhandleSave is now async: it awaits the onSave promise, then closes the panel. The Close and Save buttons are disabled while a save is in flight, so the panel can't be dismissed mid-write.
  • src/mock-tauri/mock-handlers.coverage.test.ts — new regression test: writes ui_language: 'it-IT', reloads the handlers module, asserts the language is still 'it-IT'.
  • src/mock-tauri/mock-handlers.more.test.tslocalStorage.clear() in beforeEach so the new persistence doesn't leak between tests.
  • src/components/SettingsPanel.test.tsx — new test pinning the async-save contract: onClose is not called until the save promise resolves, and the Save button is disabled in the meantime.

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.

UI language setting is not persistent - practically useless

1 participant