Skip to content

DROID-3736 Space settings | Mute, unmute for chat notifications #2558

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

Merged
merged 16 commits into from
Jun 23, 2025

Conversation

konstantiniiv
Copy link
Collaborator

@konstantiniiv konstantiniiv commented Jun 19, 2025


  • I understand that contributing to this repository will require me to agree with the CLA

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

@konstantiniiv konstantiniiv self-assigned this Jun 19, 2025
@konstantiniiv konstantiniiv changed the title DROID-3736 Space settings | Mute&unmute for space notifications DROID-3736 Space settings | Mute, unmute for space notifications Jun 19, 2025
@konstantiniiv konstantiniiv changed the title DROID-3736 Space settings | Mute, unmute for space notifications DROID-3736 Space settings | Mute, unmute for chat notifications Jun 19, 2025
…from-middle

# Conflicts:
#	core-models/src/main/java/com/anytypeio/anytype/core_models/Relations.kt
#	domain/src/main/java/com/anytypeio/anytype/domain/multiplayer/SpaceViewSubscriptionContainer.kt
#	gradle/libs.versions.toml
#	middleware/src/main/java/com/anytypeio/anytype/middleware/interactor/events/PushKeyMiddlewareChannel.kt
@konstantiniiv konstantiniiv marked this pull request as ready for review June 23, 2025 09:29
@konstantiniiv konstantiniiv requested a review from uburoiubu as a code owner June 23, 2025 09:29
@konstantiniiv konstantiniiv requested a review from Copilot June 23, 2025 09:29
Copy link
Contributor

@Copilot Copilot AI left a 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 introduces mute/unmute functionality for chat notifications and refactors related notification handling across presentation, middleware, and domain layers.

  • Updates the UI and event models to include a target space identifier (targetSpaceId) for notification settings.
  • Implements backend integration for setting the space notification mode and adjusts data mappings accordingly.
  • Updates build configurations and dependency injections to support the new notification flow.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
presentation/src/main/java/com/anytypeio/anytype/presentation/spaces/UiState.kt Adds targetSpaceId property and refactors Notifications item to a data object.
presentation/src/main/java/com/anytypeio/anytype/presentation/spaces/UiEvent.kt Adds targetSpaceId to notification setting events.
presentation/src/main/java/com/anytypeio/anytype/presentation/spaces/SpaceSettingsViewModel.kt Injects new use case and passes targetSpaceId in notification state updates.
middleware/src/main/java/com/anytypeio/anytype/middleware/service/MiddlewareServiceImplementation.kt Introduces setSpaceMode API with generic exception handling.
middleware/src/main/java/com/anytypeio/anytype/middleware/mappers/ToMiddlewareModelMappers.kt Adds mapping from NotificationState to middleware model.
feature-ui-settings/* Updates previews, preference sheet, and notifications item UI to incorporate targetSpaceId.
domain/, data/, core-models/, app/ Adjusts interfaces, repositories, and DI to support new notification mode functionality.
Comments suppressed due to low confidence (3)

middleware/src/main/java/com/anytypeio/anytype/middleware/service/MiddlewareServiceImplementation.kt:2678

  • Consider throwing a more specific exception (e.g., NotificationModeUpdateException) instead of a generic Exception to improve error handling clarity.
            throw Exception(error.description)

core-models/src/main/java/com/anytypeio/anytype/core_models/ObjectWrapper.kt:378

  • Ensure the fallback to NotificationState.ALL is aligned with backend expectations if the space notification mode property is missing; consider documenting this behavior for clarity.
                ?.let { code ->

presentation/src/main/java/com/anytypeio/anytype/presentation/spaces/SpaceSettingsViewModel.kt:281

  • [nitpick] Since targetSpaceId is a key parameter for notification updates, confirm that using isNullOrEmpty() is appropriate for the Id type and document any assumptions regarding its format.
                    if (!targetSpaceId.isNullOrEmpty()) {

@konstantiniiv konstantiniiv merged commit 026f2d8 into main Jun 23, 2025
3 checks passed
@konstantiniiv konstantiniiv deleted the droid-3736-integrate-mute-unmute-from-middle branch June 23, 2025 10:24
@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant