mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #90] [MERGED] feat: persist user settings server-side across devices #4456
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4456
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/90
Author: @LukaTheHero
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/16/2026
Merged by: @LukaTheHero
Base:
main← Head:Persistent-settings📝 Commits (1)
dd8b7f6feat: persist user settings server-side across devices📊 Changes
11 files changed (+263 additions, -0 deletions)
View changed files
📝
packages/client/src/App.tsx(+2 -0)➕
packages/client/src/hooks/use-settings-sync.ts(+115 -0)📝
packages/client/src/stores/ui.store.ts(+51 -0)📝
packages/server/src/db/migrate.ts(+5 -0)➕
packages/server/src/db/schema/app-settings.ts(+10 -0)📝
packages/server/src/db/schema/index.ts(+1 -0)➕
packages/server/src/routes/app-settings.routes.ts(+29 -0)📝
packages/server/src/routes/index.ts(+2 -0)➕
packages/server/src/services/storage/app-settings.storage.ts(+30 -0)📝
packages/shared/src/index.ts(+1 -0)➕
packages/shared/src/schemas/app-settings.schema.ts(+17 -0)📄 Description
Summary
User settings were previously stored only in browser
localStorage, so every browser and device saw its own independent preferences. This PR moves them to a server-backed key/value table so they follow the user across browsers and devices until explicitly edited.app_settings (key, value, updated_at)table with a singleuirow holding the serialized preference blobGET/PUT /api/app-settings/:key(allowlisted toui)useSettingsSync()(wired inApp.tsx) that on mount fetches the server blob and overlays it onto the Zustand UI store, then debounces (1s) and pushes any subsequent changes back to the serverlocalStorageis kept as a fast-boot cache — the server is authoritative on mountlocalStoragesettings are pushed to the server the first time the app loads after this changeWhat's now persistent across devices/browsers
Defined in
pickSyncedSettingsinpackages/client/src/stores/ui.store.ts:General tab
Appearance tab
Advanced tab
Other preferences
Explicitly NOT synced (stays device-local)
custom_themestableuserStatus(auto-idle) — computed from inactivity per-devicehasMigratedCustomThemesToServer— per-device migration flagKnown tradeoffs
partialize(localStorage) andpickSyncedSettings(server) or they won't sync.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.