feat: Enhance privacy settings and telemetry#308
Conversation
wel97459
commented
Mar 19, 2026
- Implemented telemetry options for contacts, allowing users to enable or disable telemetry data sharing.
- Introduced a clear chat option in the chat interface for better message management.
- Updated the telemetry screen to handle telemetry data for contacts, including battery level.
- Refactored contact settings to include telemetry options and improved UI for better user experience.
There was a problem hiding this comment.
Pull request overview
This PR enhances privacy/telemetry controls and adds chat management actions, expanding the existing MeshCore contact/chat UI to support telemetry permissions and “clear chat” operations.
Changes:
- Adds a new Privacy Settings dialog to configure telemetry sharing modes, advert location policy, and multi-ACK behavior.
- Extends telemetry to work with chat contacts (new telemetry request/response handling) and adds per-contact telemetry permission flags.
- Adds “Clear Chat” actions to 1:1 chats and channel chats, plus new contact settings options from the chat UI.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/screens/telemetry_screen.dart | Refactors telemetry to target generic contacts (incl. chat), updates frame parsing, and battery snapshot updates. |
| lib/screens/settings_screen.dart | Replaces privacy mode toggle with a richer privacy/telemetry settings dialog. |
| lib/screens/repeater_hub_screen.dart | Updates TelemetryScreen navigation to new contact parameter. |
| lib/screens/contacts_screen.dart | Switches favorite toggling to the new setContactFlags API. |
| lib/screens/chat_screen.dart | Adds a menu with contact info/settings/telemetry and clear-chat; refactors contact usage. |
| lib/screens/channel_chat_screen.dart | Adds a menu action to clear channel chat. |
| lib/models/contact.dart | Adds computed getters for telemetry permission flags. |
| lib/connector/meshcore_protocol.dart | Adds telemetry mode constants and a buildSendTelemetryReq frame builder. |
| lib/connector/meshcore_connector.dart | Adds telemetry mode getters/setter, introduces setContactFlags, and implements message clearing APIs. |
| lib/l10n/.arb, lib/l10n/app_localizations.dart, lib/l10n/app_localizations.dart | Adds new localization keys for privacy/contact/telemetry UI text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
meshcore-open/lib/connector/meshcore_connector.dart
Lines 2776 to 2777 in fa7f03f
setTelemetryModeBase() writes the location mode into bits 2-3 and the environment mode into bits 4-5 ((_telemetryModeEnv << 4) | (_telemetryModeLoc << 2) | _telemetryModeBase), but respCodeSelfInfo parses those two fields the other way around here. After any reconnect or refreshDeviceInfo(), the Privacy dialog will show location/env swapped, and saving again can push the wrong permission modes back to the device.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Implemented telemetry options for contacts, allowing users to enable or disable telemetry data sharing. - Introduced a clear chat option in the chat interface for better message management. - Updated the telemetry screen to handle telemetry data for contacts, including battery level. - Refactored contact settings to include telemetry options and improved UI for better user experience.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f780ac667
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ad9263cc4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (_telemetryModeEnv << 4) | | ||
| (_telemetryModeLoc << 2) | | ||
| _telemetryModeBase, |
There was a problem hiding this comment.
Encode location/environment telemetry bits in the same order
setTelemetryModeBase() packs location into bits 2-3 and env into bits 4-5 here, but _handleSelfInfo() in the same file decodes bits 2-3 into _telemetryModeEnv and bits 4-5 into _telemetryModeLoc (lib/connector/meshcore_connector.dart:2774-2777). That means the new privacy dialog will round-trip these two dropdowns incorrectly: after a save + refresh, location and environment modes come back swapped, and changing one can silently alter the other on-device.
Useful? React with 👍 / 👎.
| frame = buildSendTelemetryReq(widget.contact.publicKey); | ||
| } | ||
| await connector.sendFrame(frame); |
There was a problem hiding this comment.
Start a local timeout for chat telemetry requests
For chat contacts this path now sends CMD_SEND_TELEMETRY_REQ and returns without arming any fallback timer. The only timeout is created later in _setupMessageListener() after a RESP_CODE_SENT, so if a node rejects or does not support this deprecated command (docs/BLE_PROTOCOL.md:618-624) and answers with RESP_CODE_ERR/nothing instead, _isLoading never resets and the telemetry screen stays stuck spinning until it is closed.
Useful? React with 👍 / 👎.
| final contact = widget.contact; | ||
| bool smazEnabled = connector.isContactSmazEnabled(contact.publicKeyHex); | ||
| bool teleBaseEnabled = contact.teleBaseEnabled; | ||
| bool teleLocEnabled = contact.teleLocEnabled; | ||
| bool teleEnvEnabled = contact.teleEnvEnabled; |
There was a problem hiding this comment.
Resolve the latest contact before seeding the settings dialog
This dialog snapshots all three telemetry toggles from widget.contact, which is the stale contact object captured when the chat screen was opened. If the contact record is refreshed later (for example by a contact reload or a flag change from another screen), pressing Save still sends every toggle through setContactFlags(), so untouched permissions are reverted to the old values from that stale snapshot.
Useful? React with 👍 / 👎.
* feat: Enhance privacy settings and telemetry - Implemented telemetry options for contacts, allowing users to enable or disable telemetry data sharing. - Introduced a clear chat option in the chat interface for better message management. - Updated the telemetry screen to handle telemetry data for contacts, including battery level. - Refactored contact settings to include telemetry options and improved UI for better user experience. * feat: Refactor repeater resolution logic across multiple screens
* feat: Enhance privacy settings and telemetry - Implemented telemetry options for contacts, allowing users to enable or disable telemetry data sharing. - Introduced a clear chat option in the chat interface for better message management. - Updated the telemetry screen to handle telemetry data for contacts, including battery level. - Refactored contact settings to include telemetry options and improved UI for better user experience. * feat: Refactor repeater resolution logic across multiple screens