Files
pipelines/android/app
alan bb486acc11 chat: mark new activity in the session list
With several operator sessions the list gave no sign of where a reply
arrived: an idle chat and one streaming a reply right now looked the same,
so the operator lost the conversation they were in.

Add a per-session read state that the session list derives from data it
already receives, and render it as a three-state activity badge:

- ChatSeenState (ui/chat/ChatSeen.kt) keeps a per-session recency watermark
  (the newest updated_at the operator has read) plus the ids that moved on
  while the app was open. It is persisted as one opaque JSON preference
  (SettingsRepository chat_seen, observed by AppViewModel.observeChatSeen),
  the same way ChatSessionOverrides is, so the marks survive a restart and
  not only a reconnect.
- ChatState.isUnseen marks a background session that carried a live mark
  (a pushed chat_event/permission frame) or, if never opened here, is newer
  than its stored watermark; first sight of a session is seeded to its
  current recency so a pre-existing chat is not reported as new. Opening,
  activating and closing a conversation reads it and clears the mark;
  history for the active chat advances the watermark to the newest server
  message. No server request is added.
- ChatFormat.sessionActivity(running, unseen) is the one pure derivation
  (streaming outranks finished-unseen, which outranks idle) and
  SessionActivityBadge renders it as Streaming/New/Open beside the
  unchanged kind chip and directory line. Most-recently-used order is
  untouched.

Tests (ChatActivityTest): unseen is marked, opening clears it including in
the persisted state, the derivation distinguishes streaming/finished-unseen/
idle, and the seen state survives an encode/decode into a fresh store.

Checked before commit: android/README.md was updated in this change with the
behaviour, tests and evidence. The packaged authoring skill references
(internal/author/skill/references/) describe the Pipelines server and its
chat_* protocol surface, neither of which changed - this is a client-side
derivation over existing frames - so none needed updating, and the
internal/author/install.go managed reference inventory is unchanged. No
repository template or root/topic doc describes the Android session list,
so none was stale.

android/ only; no dependency added; no run is started from the app.
2026-10-17 14:40:02 +01:00
..