feat(android): unread indicators in the channel list (beta blocker 3/5)#596
Merged
Conversation
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>
170afad to
1aadce9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third of the five Android-beta blockers. The server's
GET /api/guilds/{id}/channelsendpoint already returnsunread_count/last_message_id/last_read_message_id, but the AndroidChannelmodel dropped those fields and nothing rendered unread state.Channelmodel: parseunreadCount/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.handleMessageNewcallsguildRepository.onMessageReceived()(GuildRepository injected — no dependency cycle).HomeViewModel.onChannelSelectedmarks a text channel active/read on open.ChannelList: unread channels get a countBadge(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