Add a signal readout for the nearest repeater. With improvements to app bar and other UI polish.#200
Add a signal readout for the nearest repeater. With improvements to app bar and other UI polish.#200
Conversation
- Added error handling and logging to the Cayenne LPP parsing methods to manage malformed data gracefully. - Improved the structure of the parsing logic for better readability and maintainability. - Updated the Contact model to include error handling during frame parsing. - Refactored Channels, Contacts, Map, and Neighbours screens to utilize a new AppBarTitle widget for consistent app bar design. - Enhanced the BatteryIndicator widget to display SNR information for direct repeaters. - Introduced SNRUi class for better management of SNR icon and text representation. - Improved error handling in PathTraceMap and Neighbours screens to log errors appropriately.
…a mapping in PathTraceMapScreen
… coding based on signal strength
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…SNR indicator dialog content layout
…related screens to reflect changes Improve SNR handling by adding validation for spreading factor range in snrUiFromSNR function Update contact handling in MeshCoreConnector to fix variable naming and improve readability Stop parsing unsupported LPP types in CayenneLpp to avoid misalignment
…e for improved path management dialog
…y; update related UI components to reflect changes
…e languages - Updated localization keys from "neighbours" to "neighbors" in the following files: - app_localizations_bg.dart - app_localizations_de.dart - app_localizations_en.dart - app_localizations_es.dart - app_localizations_fr.dart - app_localizations_it.dart - app_localizations_nl.dart - app_localizations_pl.dart - app_localizations_pt.dart - app_localizations_ru.dart - app_localizations_sk.dart - app_localizations_sl.dart - app_localizations_sv.dart - app_localizations_uk.dart - app_localizations_zh.dart - Updated corresponding ARB files to reflect the changes in keys. - Renamed the NeighboursScreen to NeighborsScreen in the chat and repeater hub screens for consistency.
…NR for improved accuracy
…dling in channel message screens
…or outgoing messages and channel messages
* Initial plan * Wrap title Column in Expanded to prevent horizontal overflow in AppBarTitle Co-authored-by: wel97459 <12990640+wel97459@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wel97459 <12990640+wel97459@users.noreply.github.com>
- Implemented localization for "Show All Paths" in multiple languages (DE, EN, ES, FR, IT, NL, PL, PT, RU, SK, SL, SV, UK, ZH). - Updated path management dialog to include a toggle for showing all paths. - Refactored path history display logic to conditionally show paths based on the toggle state. - Cleaned up unused print statements and improved code readability in path tracing and chat screens.
…ogs based on repeaters list
…nto dev-repeaterSignal
…at and path management dialogs
…at and path management dialogs
There was a problem hiding this comment.
Pull request overview
This PR adds UI support for showing signal/SNR information for the nearest (direct) repeater(s), improves app bar consistency across screens, and refines path management by sorting/filtering recent paths based on nearby repeaters.
Changes:
- Add a new SNR indicator widget + dialog listing nearby repeaters, and integrate it into a shared app bar title widget.
- Improve path management UI/logic to sort paths and optionally hide paths not starting via nearby repeaters.
- Harden protocol/frame parsing and contact refresh behavior; add tracking for “direct repeaters” based on RX advert frames.
Reviewed changes
Copilot reviewed 48 out of 49 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.lock | Updates locked dependency versions. |
| lib/widgets/snr_indicator.dart | New SNR UI model + indicator widget and nearby repeater dialog. |
| lib/widgets/path_management_dialog.dart | Adds sorting/filtering + “Show all paths” toggle based on nearby repeaters. |
| lib/widgets/battery_indicator.dart | Adjusts battery indicator layout to stack icon + text. |
| lib/widgets/app_bar.dart | Introduces AppBarTitle widget consolidating title + battery + SNR indicators. |
| lib/screens/repeater_hub_screen.dart | Renames neighbors screen reference and updates l10n keys. |
| lib/screens/path_trace_map.dart | Improves trace parsing robustness; changes SNR storage to List<double> and updates UI rendering. |
| lib/screens/neighbors_screen.dart | Renames Neighbours→Neighbors and adds parsing error logging. |
| lib/screens/map_screen.dart | Switches to shared AppBarTitle; minor UI polish and makes some text selectable. |
| lib/screens/contacts_screen.dart | Switches to shared AppBarTitle; adds safer frame parsing + logging. |
| lib/screens/chat_screen.dart | Updates path history dialog to sort/filter paths similarly to path management dialog. |
| lib/screens/channels_screen.dart | Switches to shared AppBarTitle. |
| lib/screens/channel_message_path_screen.dart | Adjusts path direction handling and map opening behavior for channel vs direct messages. |
| lib/screens/channel_chat_screen.dart | Passes channelMessage: true into message path screen. |
| lib/models/contact.dart | Tweaks trace route byte selection and makes contact parsing more defensive. |
| lib/helpers/cayenne_lpp.dart | Adds error handling/logging around Cayenne LPP parsing. |
| lib/connector/meshcore_protocol.dart | Adds bounds checks in BufferReader; introduces payload type constants and a new “set other params” frame builder; renames neighbors request constant. |
| lib/connector/meshcore_connector.dart | Adds direct repeater tracking from RX adverts; preserves path overrides on advert refresh; handles new advert push code. |
| lib/l10n/app_en.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_de.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_es.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_fr.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_it.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_nl.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_pl.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_pt.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_ru.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_sk.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_sl.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_sv.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_uk.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_zh.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_bg.arb | Adds new SNR/path toggle strings and renames “neighbours” keys to “neighbors”. |
| lib/l10n/app_localizations.dart | Updates localization interface for renamed/added keys. |
| lib/l10n/app_localizations_en.dart | Regenerates English localizations for new/renamed keys. |
| lib/l10n/app_localizations_de.dart | Regenerates German localizations for new/renamed keys. |
| lib/l10n/app_localizations_es.dart | Regenerates Spanish localizations for new/renamed keys. |
| lib/l10n/app_localizations_fr.dart | Regenerates French localizations for new/renamed keys. |
| lib/l10n/app_localizations_it.dart | Regenerates Italian localizations for new/renamed keys. |
| lib/l10n/app_localizations_nl.dart | Regenerates Dutch localizations for new/renamed keys. |
| lib/l10n/app_localizations_pl.dart | Regenerates Polish localizations for new/renamed keys. |
| lib/l10n/app_localizations_pt.dart | Regenerates Portuguese localizations for new/renamed keys. |
| lib/l10n/app_localizations_ru.dart | Regenerates Russian localizations for new/renamed keys. |
| lib/l10n/app_localizations_sk.dart | Regenerates Slovak localizations for new/renamed keys. |
| lib/l10n/app_localizations_sl.dart | Regenerates Slovenian localizations for new/renamed keys. |
| lib/l10n/app_localizations_sv.dart | Regenerates Swedish localizations for new/renamed keys. |
| lib/l10n/app_localizations_uk.dart | Regenerates Ukrainian localizations for new/renamed keys. |
| lib/l10n/app_localizations_zh.dart | Regenerates Chinese localizations for new/renamed keys. |
| lib/l10n/app_localizations_bg.dart | Regenerates Bulgarian localizations for new/renamed keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final name = widget.connector.contacts | ||
| .where((c) => c.publicKey.first == repeater.pubkeyFirstByte) | ||
| .map((c) => c.name) | ||
| .firstOrNull; |
There was a problem hiding this comment.
firstOrNull is used on an Iterable here, but there is no import providing that extension (it’s not in Dart core). This will fail to compile unless you add the appropriate extension import (e.g. from package:collection/collection.dart) or replace it with a safe isEmpty ? null : first pattern.
| final repeatersList = List.of(connector.directRepeaters) | ||
| ..sort((a, b) => b.ranking.compareTo(a.ranking)); | ||
|
|
||
| if (repeatersList.isEmpty) { | ||
| _showAllPaths = true; | ||
| } |
There was a problem hiding this comment.
This state is being mutated during build (_showAllPaths = true). Mutating widget state in build can lead to inconsistent UI (the toggle won’t update via setState) and makes rebuilds non-idempotent. Consider deriving the effective value locally for this build, or move the initialization into initState/didUpdateWidget and update via setState when repeaters become empty.
There was a problem hiding this comment.
This also BS the state only changes before the UI is built.
| String? get selfName => _selfName; | ||
| double? get selfLatitude => _selfLatitude; | ||
| double? get selfLongitude => _selfLongitude; | ||
| List<DirectRepeater> get directRepeaters => _directRepeaters; |
There was a problem hiding this comment.
Other list getters in this class return List.unmodifiable(...), but directRepeaters exposes the mutable backing list directly. This allows external callers to modify connector state without notifications. Consider returning an unmodifiable view/copy (e.g. List.unmodifiable(_directRepeaters)) for consistency and safety.
| List<DirectRepeater> get directRepeaters => _directRepeaters; | |
| List<DirectRepeater> get directRepeaters => List.unmodifiable(_directRepeaters); |
| class PathTraceMapScreen extends StatefulWidget { | ||
| final String title; | ||
| final Uint8List path; | ||
| final int? repeaterId; | ||
| final bool flipPathRound; | ||
| final bool reversePathRound; | ||
|
|
||
| const PathTraceMapScreen({ | ||
| super.key, | ||
| required this.title, | ||
| required this.path, | ||
| this.repeaterId, |
There was a problem hiding this comment.
repeaterId is declared but never used in this screen. If it’s not needed yet, removing it avoids analyzer warnings; if it is intended for future logic, consider wiring it into the trace/map behavior so the field is meaningful.
There was a problem hiding this comment.
This will be used to include the end repeater in the path. i'll add it in the next PR.
|
is my pr gonna interfere with this pr #198 lib/widgets/adaptive_app_bar_title.dart Also fixed mobile overflow issues: Path Trace overlay action controls made responsive (wrap instead of horizontal overflow). |
Adds a signal readout for the nearest repeater along with a list of the rest.
Improvements to app bar to help with consistency.
Message path numbered in the direction of 1 being the closest you it origin.
Improvements to the path management. It now sorts the paths and only show paths with a starting hop of one of the repeaters in the nearest repeater list.