feat: sync settings across devices via Matrix account data#409
Closed
Just-Insane wants to merge 1 commit intodevfrom
Closed
feat: sync settings across devices via Matrix account data#409Just-Insane wants to merge 1 commit intodevfrom
Just-Insane wants to merge 1 commit intodevfrom
Conversation
- Add SableSettings account data event type (moe.sable.app.settings) - Add settingsSyncEnabled setting (default off, device-local) - serializeForSync/deserializeFromSync utilities with versioned schema - Echo-token loop prevention: own uploads don't re-apply on echo - Debounced (2 s) upload on settings change - JSON export (browser download) and import (file picker) - SettingsSyncSection in General settings with sync toggle, status, and export/import buttons - 39 new tests covering utilities and hook behaviour
Contributor
Deploying with
|
| Status | Preview URL | Commit | Alias | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! | https://pr-409-sable.raspy-dream-bb1d.workers.dev | 1e07701 | pr-409 |
Fri, 20 Mar 2026 03:26:32 GMT |
Contributor
Author
|
Tests well, can change settings and see them syncing to account data, uploading and downloading the files also works and overwrites settings as expected. An example settings export file is below: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #402
What
Adds opt-in settings synchronisation across devices using Matrix account data (
moe.sable.app.settings), plus a JSON export/import fallback for users who prefer manual control.How it works
usePushNotifications,useInAppNotifications,useSystemNotifications,pageZoom,isPeopleDrawer,isWidgetDrawer,memberSortFilterIndex,developerTools,settingsSyncEnabledJSON export / import
Available regardless of whether sync is enabled. Export triggers a browser download; import opens a file picker and merges the selected file into current settings (same schema validation as the sync path).
Files changed
src/types/matrix/accountData.tsSableSettings = 'moe.sable.app.settings'enum valuesrc/app/state/settings.tssettingsSyncEnabled: boolean(defaultfalse)src/app/utils/settingsSync.tssrc/app/hooks/useSettingsSync.tssrc/app/pages/client/ClientNonUIFeatures.tsxSettingsSyncFeaturefor session lifetimesrc/app/features/settings/general/General.tsxSettingsSyncSectionUIsrc/app/utils/settingsSync.test.tssrc/app/hooks/useSettingsSync.test.tsxType of change
AI assistance level
Checklist: