-
Notifications
You must be signed in to change notification settings - Fork 67
Droid 3622 add counters to space chat widget #2449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Droid 3622 add counters to space chat widget #2449
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds unread message and mention counters to the Space Chat widget, including model, view, and UI updates for real-time updates.
- Introduces
Widget.Chat
and updates parsing to include chat widgets - Implements
SpaceChatWidgetContainer
usingChatPreviewContainer
to feed counter flows - Updates composable and Home screen to render unread counts and fallback on errors
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/WidgetView.kt | Converted SpaceChat to data class with counter fields |
presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/Widget.kt | Added Widget.Chat type and parsing logic |
presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/SpaceChatWidgetContainer.kt | Wired flow mapping from previews to WidgetView.SpaceChat |
domain/src/main/java/com/anytypeio/anytype/domain/chats/ChatPreviewContainer.kt | Exposed observePreview API for chat previews |
app/src/main/java/com/anytypeio/anytype/ui/widgets/types/SpaceChatWidget.kt | Updated composable to display unread counts and icon |
presentation/src/main/java/com/anytypeio/anytype/presentation/home/HomeScreenViewModel.kt | Injected ChatPreviewContainer and mapped Widget.Chat |
app/src/main/java/com/anytypeio/anytype/ui/home/HomeScreen.kt | Passed counter props and updated click handler for chat widget |
presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/DataViewListWidgetContainer.kt | Excluded Widget.Chat from incompatible widget throws |
feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Toolbars.kt | Added fallback for empty chat title |
core-ui/src/main/res/drawable/ic_widget_chat.xml | Added new chat widget icon asset |
app/src/main/java/com/anytypeio/anytype/di/feature/home/HomescreenDI.kt | Registered ChatPreviewContainer in DI |
Comments suppressed due to low confidence (4)
app/src/main/java/com/anytypeio/anytype/ui/widgets/types/SpaceChatWidget.kt:64
- Update the contentDescription to describe the chat icon (e.g., "Chat widget icon") for proper accessibility.
contentDescription = "All content icon",
app/src/main/java/com/anytypeio/anytype/ui/widgets/types/SpaceChatWidget.kt:39
- [nitpick] Parameter name
unReadMessageCount
is inconsistent; rename tounreadMessageCount
to follow camelCase convention.
unReadMessageCount: Int = 0,
app/src/main/java/com/anytypeio/anytype/ui/widgets/types/SpaceChatWidget.kt:40
- [nitpick] Parameter name
unReadMentionCount
is inconsistent; rename tounreadMentionCount
to follow camelCase convention.
unReadMentionCount: Int = 0
presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/SpaceChatWidgetContainer.kt:17
- [nitpick] The new counter mapping and error fallback in
SpaceChatWidgetContainer
lack unit tests. Consider adding tests to cover both successful flows and error scenarios.
override val view: Flow<WidgetView> = flow {
Description
What type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?