Files
pipelines/app/notes/settings-topic-navigation.md
T

2.1 KiB

Restored Settings category

SettingsScreen.navigationScope opts the application's Settings page into server-scoped category persistence. The app owner supplies the same logical server storage scope used by its other navigation state. Standalone Settings previews and fixtures keep the default null scope and do not touch preferences.

The selected category is saved by enum name under the scoped pipelines.next.settingsTopic.v1 key. Missing, malformed or unreadable values use Appearance. A delayed restore cannot replace a newer user selection, and writes are serialized so an older slow write cannot win after a newer choice. Existing lazy pages stay mounted with their draft and scroll state. No unsaved fields, dialogs or popup state are stored.

Checks: 23 focused Settings tabs/topic-restore/screen tests passed (/tmp/memwatch/out.EFYNIh), including Material and Cupertino recreation, server isolation, malformed input, opt-out behavior, delayed restoration and write ordering. Existing retained-page draft/scroll tests also pass. Analyzer clean (flutter-analyze.q5b4VU). Manager owns the full-app integration wiring, rendered tab-switch/relaunch capture and delivery. No deployment, server restart or device testing was performed in this lane.

Replacement ownership is also guarded: a disposed widget or changed scope skips queued saves before they start, and the production store rechecks its owner inside the shared per-key storage queue. A replacement Settings page reads after any already-started write from the previous owner, then saves its newer choice last. The queue is shared with tab-location persistence through core/storage/ordered_local_storage.dart (companion prerequisite f6e1ede6).

The follow-up passed 27 tests including the shared queue tests (/tmp/memwatch/out.a86IS6) and clean analysis (2CMlDH). The new recreation regression blocks old choice A, queues old choice B, disposes the widget, chooses C in its replacement, then releases A: B never writes and C remains selected/persisted. A production-store test also verifies reads wait for pending writes and an invalidated queued save is skipped inside the operation.