Use the visible chat list to choose an added pane

This commit is contained in:
2026-11-06 22:14:17 +00:00
parent af1c9eb98c
commit 778b368f03
11 changed files with 524 additions and 35 deletions
+21
View File
@@ -0,0 +1,21 @@
# Add-pane picker uses the normal chat list
The Add chat pane chooser now uses the same `ChatSessionsBody` and native chat rows as the sidebar, in a native selection sheet with a local search field. Harness avatars, title/recency, recorded model and directory, starred grouping, unread/activity state and colour identity are preserved. A row's selection-only mode suppresses mutation menus and long-press colour actions; ordinary sidebar rows retain all actions.
Candidates come from `chatSessionsShown(controller.sessions, query: '', isOpen: sidebarFolds.isOpen)` and exclude chats already in a pane. The controller already applies device-local hidden IDs. The embedded sidebar intentionally has no search field, so there is no separate sidebar query to copy. Picker-local search uses the existing title/directory filter and can only narrow the sidebar-visible set; it cannot reveal hidden or folded rows. The sheet observes the shared controller/folds and revalidates a picked row against the current visible set before opening it. Its own fold state does not change the sidebar's folds.
Loading, read errors with Retry, no matching search and no other visible chats remain distinct. Opening the picker does not fetch a second list or mutate a chat.
Checks: bounded analysis of changed Dart paths was clean. `tool/memwatch/full.sh 'test/features/chat/conversation/chat_add_pane_picker_test.dart test/features/chat/chat_split_integration_test.dart test/features/chat/ui/sessions --no-pub'` passed 139 tests, peak 1683 MB, 16s (`/tmp/memwatch/out.qD6td3`). Coverage compares actual picker row IDs with the sidebar helper, hidden/folded/already-open exclusions, row/metadata reuse, absent action menus, search exclusion, live hide/fold updates, unfolded closed rows, loading/error/empty states, no duplicate list request and existing split-pane behavior. The first fixture used an indefinitely animating running badge with `pumpAndSettle`; changing that test datum to a recorded background-task badge fixed the test-only timeout. A lazy offscreen closed row test now scrolls it into view before asserting its rendering.
Full-app fixture web build including Wasm dry run passed. Browser captures use only loopback fixture data (`chats=5&colors=1&activity=1`); no real chat, device or shared service is touched. Publication is the manager's step.
Rendered captures inspected at both requested widths and both native hosts:
- Material dark, 560x1000: `/private/tmp/pane-picker-material-560-final/01-picker.png`.
- Cupertino dark, 560x1000: `/private/tmp/pane-picker-cupertino-560-final/01-picker.png`.
- Cupertino light, 880x1000: `/private/tmp/pane-picker-cupertino-880-final/01-picker.png`.
- Material light, 880x1000: `/private/tmp/pane-picker-material-880-final/01-picker.png`.
- Material light folded visibility proof, 880x1000: `/private/tmp/pane-picker-material-880-folded/01-picker.png`. The sidebar's Starred group is folded; the picker contains exactly its two visible Chats rows, preserving the same row presentation while excluding every folded chat and the already-open chat.
Every cited PNG was inspected. Capture-owned browsers and loopback servers exited normally. No Safari or physical-device acceptance is claimed. No deployment was performed by this change.