[PR #3087] [CLOSED] [RFC] introduce the concept of synced preferences #4672

Closed
opened 2026-02-28 20:59:27 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3087
Author: @MatissJanis
Created: 7/17/2024
Status: Closed

Base: masterHead: matiss/synced-prefs


📝 Commits (2)

  • 96b1834 introduce the concept of synced preferences
  • b9bf878 Merge branch 'master' into matiss/synced-prefs

📊 Changes

11 files changed (+82 additions, -4 deletions)

View changed files

📝 packages/desktop-client/src/components/budget/index.tsx (+3 -1)
📝 packages/desktop-client/src/components/mobile/budget/index.tsx (+2 -1)
📝 packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx (+2 -1)
packages/desktop-client/src/hooks/useSyncedBudgetPref.ts (+43 -0)
packages/loot-core/migrations/1721071985001_create_prefs_table.sql (+7 -0)
📝 packages/loot-core/src/server/aql/schema/index.ts (+4 -0)
📝 packages/loot-core/src/server/main.ts (+2 -0)
packages/loot-core/src/server/preferences/app.ts (+10 -0)
packages/loot-core/src/server/preferences/types/handlers.d.ts (+3 -0)
📝 packages/loot-core/src/types/handlers.d.ts (+2 -0)
📝 packages/loot-core/src/types/prefs.d.ts (+4 -1)

📄 Description

Introducing the concept of - synced preferences. Looking to sanity check myself before investing in building out the feature more and before porting local prefs over to use synced prefs.

Why do we need this? Currently we have local & global preferences. For those unaware what they are - quick recap.

local preferences - these initially come from the metadata.json file that every budget had. The user can later override the defaults and they are persisted in local storage (meaning they are device-specific). If a user clears local storage - we reset back to the original metadata.json file

global preferences - basically just local storage; preferences that are applicable across budget files (but not cross-device)

So again: why create synced prefs? The problem with local prefs is that whenever you export your budget - a new metadata.json file is produced with your current local pref state. For example: if you switch the budget back to year 2020 and export - the active month will be persisted as "2020". Whenever you open up the budget file - the active month will be "2020". Each time you clear your cache (or use a different device) - again you will get the year "2020". That is annoying.

Ok, but why not just remove the prefs when exporting? That could be done. But arguably that would be quite annoying as well. Imagine - you configured your number format to use "1 000.33" format. And perhaps changed the language to "DE" (thinking about the future). But each time you import your budget - all these configs get reset back to their original state.


So.. I'm looking for a sanity-check.

  1. Do you think we should have "synced preferences" (prefs that sync across device)?
  2. Do you think most (if not all) prefs should use these new synced prefs instead of local prefs?
  3. Any other thoughts?

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/3087 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 7/17/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `matiss/synced-prefs` --- ### 📝 Commits (2) - [`96b1834`](https://github.com/actualbudget/actual/commit/96b1834c692bb5add4eba03ef71f703d40803727) :sparkles: introduce the concept of synced preferences - [`b9bf878`](https://github.com/actualbudget/actual/commit/b9bf878ceda05f11af561353306ca1a9614ca019) Merge branch 'master' into matiss/synced-prefs ### 📊 Changes **11 files changed** (+82 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/budget/index.tsx` (+3 -1) 📝 `packages/desktop-client/src/components/mobile/budget/index.tsx` (+2 -1) 📝 `packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx` (+2 -1) ➕ `packages/desktop-client/src/hooks/useSyncedBudgetPref.ts` (+43 -0) ➕ `packages/loot-core/migrations/1721071985001_create_prefs_table.sql` (+7 -0) 📝 `packages/loot-core/src/server/aql/schema/index.ts` (+4 -0) 📝 `packages/loot-core/src/server/main.ts` (+2 -0) ➕ `packages/loot-core/src/server/preferences/app.ts` (+10 -0) ➕ `packages/loot-core/src/server/preferences/types/handlers.d.ts` (+3 -0) 📝 `packages/loot-core/src/types/handlers.d.ts` (+2 -0) 📝 `packages/loot-core/src/types/prefs.d.ts` (+4 -1) </details> ### 📄 Description Introducing the concept of - synced preferences. Looking to sanity check myself before investing in building out the feature more and before porting local prefs over to use synced prefs. **Why do we need this?** Currently we have local & global preferences. For those unaware what they are - quick recap. local preferences - these initially come from the `metadata.json` file that every budget had. The user can later override the defaults and they are persisted in local storage (meaning they are device-specific). If a user clears local storage - we reset back to the original `metadata.json` file global preferences - basically just local storage; preferences that are applicable across budget files (but not cross-device) **So again: why create synced prefs?** The problem with local prefs is that whenever you export your budget - a new `metadata.json` file is produced with your current local pref state. For example: if you switch the budget back to year 2020 and export - the active month will be persisted as "2020". Whenever you open up the budget file - the active month will be "2020". Each time you clear your cache (or use a different device) - again you will get the year "2020". _That is annoying_. **Ok, but why not just remove the prefs when exporting?** That could be done. But arguably that would be quite annoying as well. Imagine - you configured your number format to use "1 000.33" format. And perhaps changed the language to "DE" (thinking about the future). But each time you import your budget - all these configs get reset back to their original state. --- So.. I'm looking for a sanity-check. 1. Do you think we should have "synced preferences" (prefs that sync across device)? 2. Do you think _most_ (if not all) prefs should use these new synced prefs instead of local prefs? 3. Any other thoughts? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:59:27 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4672