Skip to content

feat(android): unread indicators in the channel list (beta blocker 3/5)#596

Merged
Detair merged 1 commit into
mainfrom
feature/android-unread
Jun 13, 2026
Merged

feat(android): unread indicators in the channel list (beta blocker 3/5)#596
Detair merged 1 commit into
mainfrom
feature/android-unread

Conversation

@Detair

@Detair Detair commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

Third of the five Android-beta blockers. The server's GET /api/guilds/{id}/channels endpoint already returns unread_count / last_message_id / last_read_message_id, but the Android Channel model dropped those fields and nothing rendered unread state.

  • Channel model: parse unreadCount / lastMessageId / lastReadMessageId (defaulted so non-guild channel responses still deserialize under the SnakeCase naming strategy).
  • GuildRepository: tracks the active (open) channel; onMessageReceived() bumps a channel's unread badge unless it's the one being read; setActiveChannel() clears it on open. Increment/clear are pure companion helpers with unit tests.
  • ChatRepository.handleMessageNew calls guildRepository.onMessageReceived() (GuildRepository injected — no dependency cycle).
  • HomeViewModel.onChannelSelected marks a text channel active/read on open.
  • ChannelList: unread channels get a count Badge (99+ cap) and a bolder, brighter name — matching the desktop treatment.

Tests

4 JUnit tests for the pure unread helpers (increment target-only, unknown-channel no-op, clear target-only, default-zero). CI's Android Build + testDebugUnitTest validate compilation + Hilt wiring (Android can't be built on the dev machine).

Android Beta milestone — 2 blockers remain: DM UI, reaction picker.

🤖 Generated with Claude Code

Third Android-beta blocker. The server's guild-channels endpoint already
returns unread_count / last_message_id / last_read_message_id, but the
Android Channel model dropped them and nothing rendered unread state.

- Channel model: parse unreadCount / lastMessageId / lastReadMessageId
  (defaulted so channel responses that omit them still deserialize under
  the SnakeCase naming strategy).
- GuildRepository: tracks the active (open) channel; onMessageReceived()
  bumps a channel's unread badge unless it's the one being read,
  setActiveChannel() clears it on open. Increment/clear extracted to pure
  companion helpers with unit tests.
- ChatRepository.handleMessageNew calls guildRepository.onMessageReceived
  (GuildRepository injected — no cycle).
- HomeViewModel.onChannelSelected marks a text channel active/read on open.
- ChannelList: unread channels get a count Badge (99+ cap) and a bolder,
  brighter name.

4 JUnit tests for the pure unread helpers. CI Android Build +
testDebugUnitTest validate (no local Kotlin build). 2 blockers remain
(DM UI, reaction picker).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Detair Detair force-pushed the feature/android-unread branch from 170afad to 1aadce9 Compare June 13, 2026 02:21
@Detair Detair merged commit e770e1e into main Jun 13, 2026
18 checks passed
@Detair Detair deleted the feature/android-unread branch June 13, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant