[codex] Update online data sync settings UI#15
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the “Storage & sync” settings UX to present a user-facing “Data sync” section (hiding implementation details like “PowerSync”), and extends sync settings to support multiple custom servers with discovery-based configuration and legacy preference migration.
Changes:
- Reworks sync settings storage to support multiple custom servers, discovery fetching, server switching/removal, and migration from legacy single-server preferences.
- Updates profile “Storage & sync” UI to a consolidated “Data sync” section including server management, status, reconnect, cache clearing, and file storage display.
- Updates controller logic and widget tests to match the new labels and flows.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/test/providers/sync_settings_provider_test.dart | Updates/extends provider tests for multi-server behavior, discovery, dedupe, removal, and legacy migration. |
| app/test/pages/profile_storage_sync_test.dart | Adjusts profile page widget tests for “Data sync” UI and adds coverage for server management UI + file storage label. |
| app/lib/providers/sync_settings_provider.dart | Implements multi custom-server persistence, discovery fetching, selection/removal, legacy migration, and storage/quota labeling. |
| app/lib/powersync/storage_sync_controller.dart | Renames/reshapes labels for the new “Data sync” UI and adds file storage label support. |
| app/lib/pages/profile_page.dart | Replaces prior sync/media UI blocks with a consolidated “Data sync” card + manage servers sheet and updated actions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+140
to
+142
| int? get fileStorageQuotaBytes { | ||
| return activeCustomServer?.fileStorageQuotaBytes ?? officialFileStorageQuotaBytes; | ||
| } |
Comment on lines
+266
to
269
| _saveCustomServers([server]); | ||
| if (_prefs.getString(_legacyKeyServerType) == SyncServerType.custom.name) { | ||
| _setActiveServerId(server.id); | ||
| } |
Comment on lines
310
to
+314
| final withScheme = trimmed.contains('://') ? trimmed : 'http://$trimmed'; | ||
| final uri = Uri.tryParse(withScheme); | ||
|
|
||
| if (uri == null || !uri.hasScheme || uri.host.isEmpty) { | ||
| throw ArgumentError.value(value, 'value', 'Expected a valid server URL'); | ||
| throw SyncSettingsException('Expected a valid server URL'); |
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.
Summary
Dependency
Validation
flutter analyzeflutter test test/providers/sync_settings_provider_test.dart test/pages/profile_storage_sync_test.dartflutter test