Persist exact tab locations including Settings under Pipelines

This commit is contained in:
2026-11-08 01:04:00 +00:00
parent d6006bb1f8
commit 151d99fbb6
10 changed files with 778 additions and 25 deletions
+39
View File
@@ -0,0 +1,39 @@
# Persistent tab locations
Settings, Templates and Schedules belong to the Pipelines tab. Selecting another
main tab and returning restores that tab's last canonical route, including
Settings. Same-tab selection preserves the current location; explicit Back
still exits Settings. The existing Chats retap-to-workspace behavior remains.
The owning tab's return route is separate from each mounted body's runtime
route, so visiting Settings does not clear a hidden Pipelines detail/editor.
Settings State stays mounted when switching tabs. Restored Templates/Schedules
always retain Settings as their parent.
A scoped SharedPreferences snapshot records per-tab routes and the last active
tab. Logical server identity is the scope; an endpoint is used only when there
is no identity. Ordinary `/` / native-default launches can restore the active
location; explicit launch URLs, including `/pipelines`, take priority. Pipeline
versions/stages, run visits/filters and chat IDs survive canonical serialization;
run decision actions are omitted from durable storage.
Storage loading never saves a partial default map. User-touched slots win over
a slow load, untouched slots merge, and writes serialize so the final move wins.
Unreadable history remains untouched, write failures do not poison subsequent
saves, and disposing the app cancels late read-back persistence. Navigation
stays responsive throughout.
Focused acceptance: 40 tests passed across tab locations, full-app navigation,
router, Settings Back and existing Chats retap (`/tmp/memwatch/out.A1UrLy`).
The subsequent disposal regression and navigation cases passed (16 cases,
`/tmp/memwatch/out.eUiZcl`), bringing distinct covered cases to 41.
Analyzer clean (`flutter-analyze.Klkp0D`). Full-app tests cover both native hosts,
exact Pipelines → Settings → Chat → Pipelines restoration with identical
Settings State, explicit Back, preserved hidden Pipelines selection, actual app
recreation via SharedPreferences, explicit URL priority and delayed load races.
This change persists route locations; arbitrary dialogs, unsaved editor content
and scroll offsets are not serialized by this store. Their existing mounted
state remains intact within a session. Settings inner-topic persistence is a
separate companion change. Manager-owned integrated browser capture/build and
publication are still required; this lane did not deploy or restart anything.