-
Notifications
You must be signed in to change notification settings - Fork 67
DROID-3692 Space settings | Fix | Different number of members on Space settings screen and Members screen #2450
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-3692 Space settings | Fix | Different number of members on Space settings screen and Members screen #2450
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
This PR fixes the discrepancy in member counts shown on the Space Settings screen versus the Members screen by filtering space members based on their status and the current user’s ownership.
- Owner users now see members with statuses ACTIVE, JOINING, or REMOVING.
- Non-owner users see only members with status ACTIVE.
- Updated the
spaceMemberCount
calculation accordingly.
Comments suppressed due to low confidence (2)
presentation/src/main/java/com/anyproto/anytype/presentation/spaces/SpaceSettingsViewModel.kt:193
- Add unit tests to cover both owner and non-owner paths in the member count logic, ensuring correct counts for ACTIVE, JOINING, and REMOVING statuses.
if (permission?.isOwner() == true) {
presentation/src/main/java/com/anytypeio/anytype/presentation/spaces/SpaceSettingsViewModel.kt:196
- [nitpick] Extract the status lists (e.g., OWNER_VISIBLE_STATUSES and MEMBER_VISIBLE_STATUSES) into constants or a helper function to avoid duplicating the filter logic.
spaceMembers.members.filter {
presentation/src/main/java/com/anytypeio/anytype/presentation/spaces/SpaceSettingsViewModel.kt
Outdated
Show resolved
Hide resolved
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
This PR fixes the discrepancy in the reported number of space members between the Space settings and Members screens by updating the logic that processes space members.
- Added GetAccount dependency and retrieval logic for better conversion in member count computations
- Updated the member count calculation to use the toView mapping with account and permission data
- Updated dependency injection in the DI module to provide the GetAccount use case
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
presentation/src/main/java/com/anytypeio/anytype/presentation/spaces/SpaceSettingsViewModel.kt | Updated dependency injection; integrated account retrieval; changed member count calculation using toView conversion |
app/src/main/java/com/anytypeio/anytype/di/feature/spaces/SpaceSettingsDI.kt | Added provider for GetAccount use case |
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?