Add unread indicators to chat sidebar sessions #47

Open
opened 2026-08-23 09:32:56 +00:00 by kayg · 0 comments
Owner

Ask

Expose server-derived unread state on chat-sidebar rows. The server derives unread from a last_read_at watermark and PATCH accepts unread; presentation is undecided, with a pulsing dot suggested as one option.

Files and APIs

  • Sources/HermternalCore/Net/RestClient.swift: session-list decoding and PATCH /api/sessions/{id} unread updates.
  • Sources/HermternalCore/Models/ChatModels.swift: session unread and last_read_at state.
  • Sources/Hermternal/AppModel.swift: read-state and refresh routing.
  • Sources/Hermternal/Views/SidebarView.swift: row indicator presentation.

Acceptance

  • Sidebar session data reflects the server's unread value derived from its last_read_at watermark.
  • Marking a chat read or unread uses PATCH /api/sessions/{id} with the unread field and survives refresh.
  • An unread row has a clear, accessible indicator that does not rely on color alone; the final presentation is decided as part of this work rather than assumed to be a pulsing dot.
  • Opening or otherwise reading a chat updates only that chat's state and does not change unrelated rows.
  • Failed read-state updates preserve the prior indicator and report an actionable error.
## Ask Expose server-derived unread state on chat-sidebar rows. The server derives `unread` from a `last_read_at` watermark and `PATCH` accepts `unread`; presentation is undecided, with a pulsing dot suggested as one option. ## Files and APIs - `Sources/HermternalCore/Net/RestClient.swift`: session-list decoding and `PATCH /api/sessions/{id}` unread updates. - `Sources/HermternalCore/Models/ChatModels.swift`: session unread and `last_read_at` state. - `Sources/Hermternal/AppModel.swift`: read-state and refresh routing. - `Sources/Hermternal/Views/SidebarView.swift`: row indicator presentation. ## Acceptance - Sidebar session data reflects the server's `unread` value derived from its `last_read_at` watermark. - Marking a chat read or unread uses `PATCH /api/sessions/{id}` with the `unread` field and survives refresh. - An unread row has a clear, accessible indicator that does not rely on color alone; the final presentation is decided as part of this work rather than assumed to be a pulsing dot. - Opening or otherwise reading a chat updates only that chat's state and does not change unrelated rows. - Failed read-state updates preserve the prior indicator and report an actionable error.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/hermternal-apple#47
No description provided.