chat: choose a new chat's directory and list only the operator's sessions

Starting a chat now asks where first, and the session list is the operator's
own chats alone, told apart by the server's own tag.

- The create flow is a normal pane of the chat stack, not a modal: it loads
  the server's chat_directories (home first, then the directories of previous
  operator sessions, most recently used first) into the shared ListRow, each
  with its full path, and starts on the operator's home
  (directoryChoices/defaultDirectoryChoice). Back, the app-bar back control,
  the footer Cancel and predictive back all leave it without creating
  anything. chat_create is always sent the chosen directory (HOME_DIRECTORY
  "~" for home, the absolute path for a recent), so a session is never
  created in the server's working directory; the server resolves or rejects
  it and its error is shown in the pane.
- The list renders ChatState.visibleSessions: exactly the server's
  chat_sessions (operator sessions only) with the operator's own local
  changes applied; the app adds no ownership guessing. Each row shows its
  directory and the kind chip derived from the server's tag
  (sessionTagLabel, "operator" -> "Operator"); another tag shows verbatim,
  an untagged session shows no chip.
- The brokered protocol exposes no chat rename or delete (no
  chat_rename/chat_delete type and no session endpoint), so both are
  device-local and persisted with the other settings
  (ChatSessionOverrides, KEY_CHAT_OVERRIDES): rename stores a local title
  that wins on later list loads, and "Remove from list" hides the row and
  closes its conversation with an Undo snackbar ("Removed from this list;
  the chat stays on the server."). Nothing is deleted on the server.
- Messages, streaming replies, tool chips, diff cards, approval cards, stop
  and the reconnect path are unchanged.

android/ only: no dependency added beyond the declared
material-icons-extended, no run is started from the app, and no Pipelines
server, Go source, installer or Docker file is touched.

Checks: the packaged authoring skill references need no update - the server
contract this builds on is already documented in
internal/author/skill/references/operations.md ("Brokered OpenCode chat",
committed with lane-chatsrv) and this change is app-side only, so nothing in
it became stale. There are no packaged templates in this repository. The
repository's topic doc for the client, android/README.md, is updated in this
change with the new flow, the honest local rename/removal and what remains
unverified.

Verified: gradle 8.11.1, JDK 17, --offline --no-daemon, from android/;
:app:testDebugUnitTest :app:assembleDebug -> BUILD SUCCESSFUL, 447 tests in
50 suites, 0 failures, 0 errors.
This commit is contained in:
2026-10-17 11:39:11 +01:00
parent 8564c2a676
commit 311a0156d6
14 changed files with 1038 additions and 42 deletions
+63
View File
@@ -5268,3 +5268,66 @@ measured grid at `wm size 2000x2244` — and that each card opens a Summary / Gr
language. The empty, loading, error and unparseable-source states were built from
the app's shared state components but could not be produced live without mutating
the operator's server.
## Operator chat sessions: choose the directory, list only your own (17 Oct 2026)
The Chat destination now starts a chat by asking where it should live, and its
list is the operator's own sessions only. Before this change "New chat" created a
session with no directory of its own choosing (it passed the workspace, so the
session landed wherever the server happened to be) and the list was whatever
`chat_sessions` returned with no way to tell an operator chat from anything
run-related. The server change this builds on (operator sessions tagged
`operator`, `chat_sessions` returning exactly those with their directory and
recency, and a `chat_directories` request) is already in this revision; nothing in
the Pipelines server, its Go source, the installer or the Docker files was
touched, no dependency was added beyond the already-declared
material-icons-extended, and no run is started from the app.
- **Starting a chat asks where first.** `ChatScreen`'s level-1 pane is now the
directory picker while a create is in flight: the server's
`chat_directories` reply (the operator's home first, then the directories of
previous operator sessions, most recently used first) rendered through the
shared `ListRow`, each with its full path, home shown as `Home (~)` with its
absolute path beneath it. It is a normal pane of the chat stack, so Back, the
app bar's back control, the footer's Cancel and the predictive-back gesture all
leave it without creating anything — not a modal dead end.
- **The directory is always sent.** The picker starts on the operator's home
(`directoryChoices`/`defaultDirectoryChoice`) and `chat_create` is sent the
chosen directory — `~` for home, the absolute path for a recent — so a session
is never created in the server's own working directory. The server resolves or
rejects it, and its error is shown in the pane.
- **The list is the server's, and says so.** The list renders
`ChatState.visibleSessions`: exactly the server's `chat_sessions` (operator
sessions only — the app never guesses which session belongs to a run) with the
operator's own local changes applied. Each row carries its directory and the
kind chip derived from the server's own tag (`sessionTagLabel`, `operator` →
`Operator`), so an operator chat is tellable at a glance.
- **Managing a session, honestly.** The brokered protocol has no rename and no
delete for a chat session (there is no `chat_rename`/`chat_delete` type and the
native session endpoint is not exposed), so both are the operator's own,
device-local changes, persisted with the other settings
(`SettingsRepository.chat_overrides`, `ChatSessionOverrides`): rename stores a
local title that wins over the server's on every later list load, and "Remove
from list" hides the row and closes its conversation while a snackbar reports
it as a local, undoable change ("Removed from this list; the chat stays on the
server.") with an Undo action. Nothing is deleted on the server, and a refresh
cannot bring a removed row back.
- **Everything else is unchanged.** Multi-chat drafts/scroll/running, streaming,
tool chips, diff cards, approval cards, stop and the reconnect path are
untouched; the picker only reuses the stack's second level the conversation
already used.
Tests (`app/src/test`): `ChatDirectoriesTest` (home first and the default, the
recents' order and their full-path create value, an empty/blank reply still
yielding home), `ChatSessionManagementTest` (the chip from the server's tag, the
create flow's home default and chosen directory, rename winning over the server
title and surviving a refresh, removal hiding until undone and leaving the
server's list intact, the override encode/decode round trip) and the new
`ChatProtocolTest` cases for the `tag` field and the `chat_directories`
request/reply.
Not verified in this pass: the on-device picker, the tagged list and a session
open in a chosen directory — the brief keeps implementation verification to the
build and the unit tests, and visual review owns the device. The chip, menu and
dialog are Compose UI, which this module has no unit harness for; they are
covered by compilation only.