Skip to content

feat: Add mute node functionality#4181

Merged
jamesarich merged 9 commits into
mainfrom
feat/mute_node
Jan 10, 2026
Merged

feat: Add mute node functionality#4181
jamesarich merged 9 commits into
mainfrom
feat/mute_node

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This introduces the ability to mute notifications on a per-node basis. Introduced in meshtastic/protobufs#838

Changes include:

  • A new is_muted flag is added to the Node database entity.
  • The Node Detail screen now features a "Mute notifications" switch in the actions card.
  • The Node List context menu includes an option to mute/unmute nodes.
  • Notifications for messages, waypoints, and reactions are suppressed if the sending node is muted.
  • A Capabilities class has been created to centralize firmware version checks for feature availability.
  • The NodeDetailViewModel is refactored to delegate actions to new dedicated NodeManagementActions and NodeRequestActions classes.

This commit introduces the ability to mute nodes.

- Add `isMuted` boolean property to the `Node` data class and `NodeEntity`.
- Update the database schema to version 31 to include the `is_muted` column in the `nodes` table.
- Implement the UI for muting/unmuting nodes in `DeviceActions` and the node list context menu, including new icons and string resources.
- Add `Mute` action to `ServiceAction` and handle it in `MeshActionHandler` to send the corresponding admin message.
- Wire up the mute functionality in `NodeDetailViewModel` and `NodeListViewModel`.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This change introduces the ability to mute all notifications from a specific node.

- Adds `isMuted` flag to `NodeInfo` in the database.
- Checks `nodeMuted` status in `MeshDataHandler` before showing notifications for new messages or replies.
- Displays a "mute" icon in the node list UI for muted nodes.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Refactors several composables within the node feature to improve readability and maintainability.

- Extracts `DeviceActionsContent` from `DeviceActions` to separate logic from the card container.
- Splits the `ContextMenu` in `NodeListScreen` into individual `MenuItem` composables (`FavoriteMenuItem`, `IgnoreMenuItem`, etc.).
- Breaks down `NodeStatusIcons` into smaller, more focused composables like `ThisNodeStatusBadge` and `StatusBadge`.
- Removes the `@Suppress("LongMethod")` and `@Suppress("LongParameterList")` annotations where the refactoring has resolved the underlying issue.
- Renames a parameter in `NodeDetailViewModel.requestPosition` for clarity.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
…ations

This commit refactors the `NodeDetailViewModel` by extracting node management and request logic into separate, reusable `NodeManagementActions` and `NodeRequestActions` classes. This improves separation of concerns and testability within the node detail feature.

Additionally, it introduces a `isSilent` parameter to waypoint notifications, allowing them to be delivered without sound or vibration.

Specific changes:
- Create `NodeDetailActions`, `NodeManagementActions`, and `NodeRequestActions` to handle business logic.
- Update `NodeDetailViewModel` to delegate calls to the new action classes.
- Refactor `DeviceActions` and `NodeStatusIcons` Composables for better structure and clarity.
- Add an `isSilent` flag to `updateWaypointNotification` and related calls to control notification behavior.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit refactors the string resources related to muting and unmuting nodes to improve clarity and consistency.

Key changes:
- Renamed `mute_always` to `mute_notifications` for better user understanding.
- Added new confirmation strings `mute_add` and `mute_remove` to provide more context in dialogs.
- Updated the mute status strings for better formatting with multiple arguments.
- Removed the unused `formatAgo` and `onEditorAction` extension functions.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Introduces a `Capabilities` class to determine feature availability based on the node's firmware version. This allows for conditionally rendering UI elements and enabling/disabling functionality.

- Add `Capabilities.kt` to define feature flags like `canMuteNode` and `canRequestNeighborInfo`.
- Integrate `Capabilities` into the `Node.kt` data model.
- Conditionally show the "Mute notifications" option in `DeviceActions.kt` and `NodeListScreen.kt` based on `canMuteNode`.
- Conditionally show the "Request neighbors" chip in `RemoteDeviceActions.kt` based on `canRequestNeighborInfo`.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit centralizes various firmware version checks into the `Capabilities` class. By doing this, we avoid hardcoding firmware version strings throughout the codebase and provide a single, consistent way to check for feature support based on the device's firmware version.

The following capabilities have been added:
- `canToggleTelemetryEnabled` (>= 2.7.12)
- `canToggleUnmessageable` (>= 2.6.9)
- `supportsQrCodeSharing` (>= 2.6.8)

These new properties are now used in the Telemetry, User, and Node settings screens, as well as in the messaging and contact sharing logic, replacing the previous direct version comparisons.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Adds unit tests for the `Capabilities` class.

This ensures that the version-based capability checks behave as expected and correctly handle null or invalid firmware versions.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@github-actions github-actions Bot added enhancement New feature or request needs-review labels Jan 10, 2026
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@codecov

codecov Bot commented Jan 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (63318bf) to head (76e55c4).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4181   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          3       3           
  Lines         23      23           
  Branches       7       7           
=====================================
  Misses        23      23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Jan 10, 2026
Merged via the queue into main with commit a67b519 Jan 10, 2026
6 checks passed
@jamesarich jamesarich deleted the feat/mute_node branch January 10, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant