Problem
All user preferences set in the Settings modal — including theme, color mode (light/dark),
cellar view (cards/list/grid/table), and filter defaults — are stored exclusively in
localStorage. This means they are lost whenever the user clears browser cache or cookies,
or switches to a different browser/device.
This is particularly noticeable for multi-user setups, where each user expects their own
persistent preferences.
Context
This issue became apparent while working on PR #17, which adds a "Show out-of-stock wines"
persistent toggle. The toggle was implemented using localStorage following the same pattern
as the existing preferences — only to discover that the root problem is shared across all
settings.
Suggested solution
Implement a server-side user_preferences table in the SQLite database, keyed by username.
Add GET/POST endpoints (e.g. /api/preferences) to load and save preferences per user.
On page load, fetch preferences from the server and use them as the source of truth instead
of localStorage.
This would make all existing preferences (and future ones) truly persistent across browsers,
devices, and cache clears.
Affected preferences
Problem
All user preferences set in the Settings modal — including theme, color mode (light/dark),
cellar view (cards/list/grid/table), and filter defaults — are stored exclusively in
localStorage. This means they are lost whenever the user clears browser cache or cookies,or switches to a different browser/device.
This is particularly noticeable for multi-user setups, where each user expects their own
persistent preferences.
Context
This issue became apparent while working on PR #17, which adds a "Show out-of-stock wines"
persistent toggle. The toggle was implemented using
localStoragefollowing the same patternas the existing preferences — only to discover that the root problem is shared across all
settings.
Suggested solution
Implement a server-side
user_preferencestable in the SQLite database, keyed by username.Add GET/POST endpoints (e.g.
/api/preferences) to load and save preferences per user.On page load, fetch preferences from the server and use them as the source of truth instead
of
localStorage.This would make all existing preferences (and future ones) truly persistent across browsers,
devices, and cache clears.
Affected preferences