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

39 lines
2.3 KiB
Markdown

# 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.
Accepted category choices register their writes synchronously in the shared
per-key queue. They are not canceled on disposal: old A, accepted old B,
replacement load, and newer C execute in that order. Thus a normal recreation
restores B, while a newer replacement choice C still wins. Production stores
coordinate all instances by actual preference key; injected stores are
coordinated by store identity. Restoration still checks mounted/revision before
changing the UI. No widget-local deferred write chain can enqueue old B late.
The queue is shared with tab-location persistence through
`core/storage/ordered_local_storage.dart` (companion prerequisite `f6e1ede6`).
Recreation regressions cover both no-new-choice (B restored) and a new choice
(C wins), plus a production two-instance store read after accepted queued
writes. All existing topic retention, scope and delayed-load checks remain.
Final durability follow-up: 28 focused tests passed (`/tmp/memwatch/out.13xC9z`),
including the shared queue tests; analyzer clean (`flutter-analyze.NUqNw2`).