Remember the last Files folder per chat

Persist each chat session's last navigated Files folder, restore it with bounded parent fallback, and forget it when the session closes. Add persistence coverage and capture-fixture support for the reviewed behavior.
This commit is contained in:
2026-11-12 22:56:52 +00:00
parent d19a14b9f9
commit 1928cfe51b
7 changed files with 277 additions and 4 deletions
+13
View File
@@ -0,0 +1,13 @@
# Files remembers the last folder
Implemented per-server/per-chat Files folder persistence with a bounded 200-entry SharedPreferences record. Successful directory navigation updates the record; startup restores it, validates it against the chat directory, and walks parent folders using `list_directory` when the saved folder is gone. Closing a chat removes its record. File previews and filters remain transient.
## Checks
- `tool/memwatch/full.sh 'test/features/chat/files/files_controller_persistence_test.dart test/features/chat/files/files_panel_test.dart test/features/chat/files/files_models_test.dart'`: 20 passed.
- `tool/analyze.sh`: clean.
- Browser/device captures were not run in this implementation stage.
The browser fixture supports `filesMissing=1` alongside `files=1`: after
seeding a remembered `assets` folder, reload with that flag to show the folder
request failing and the panel reopening at `/workspace/demo`.