Skip to content

feat(widget): add a Node Tracker home-screen widget - #7665

Draft
jamesarich wants to merge 2 commits into
mainfrom
feat/node-tracker-widget
Draft

jamesarich wants to merge 2 commits into
mainfrom
feat/node-tracker-widget

Conversation

@jamesarich

@jamesarich jamesarich commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

There's no way to keep an eye on one node without opening the app. Apple now ships a Node Tracker widget (Meshtastic-Apple#2653); this is the Android equivalent.

🌟 New Features

  • Node Tracker home-screen widget. The small size shows the node chip, battery and last heard. The wide size adds SNR/RSSI (direct, non-MQTT only), hops away and distance from our radio (only while connected).
  • Readings dim once the node falls outside the online window. Tap opens the node's details.
  • NodeTrackerConfigActivity picks the node for each widget instance, favorites first then most recently heard, with search. It's a standalone APPWIDGET_CONFIGURE activity with no navigation graph. Backing out cancels placement, and the widget is reconfigurable. The list is a snapshot taken when it opens, so rows don't move under the finger on a busy mesh.
  • A tracked node that leaves the node DB shows "Node not found. Tap to choose a node." and the tap reopens the picker.

🛠️ Refactoring & Architecture

  • AndroidAppWidgetUpdater.updateAll() covers both widgets. Trackers re-render from a 1 s sample of the node DB, and only when a tracked node's rendered state changes.
  • updatePeriodMillis is 30 minutes for the tracker (Local Stats stays 0). Nothing else re-renders a node that goes quiet, so this is what dims it.
  • WidgetNodeChip is shared by both widgets. The tracker receiver carries its own android:label, which is what the launcher's picker shows.
  • feature:widget now depends on core:ui and core:navigation for the picker theme, node chip and deep link.

📝 Documentation

  • docs/en/user/widget.md covers both widgets; feature/widget/README.md updated.

Testing Performed

  • NodeTrackerWidgetContentTest: wide and small layouts; an unknown node opens the picker for this widget id; a stale node renders dimmed.
  • NodeTrackerWidgetStateTest: not found, readings, staleness, distance only while connected, signal only for direct RF nodes.
  • NodeTrackerCandidatesTest: ordering, own radio and ignored nodes excluded, search.
  • BundledSqliteGuardTest: the new receiver is an app entry point.
  • Full baseline green locally.
  • Emulator, API 36 Pixel Launcher, against a simulated TCP radio: placed from the picker, the configure activity opens and the chosen node is tracked; reconfigure from the launcher's pencil switches nodes; resizing to wide adds hops and distance; readings update as packets arrive and survive an app update; a tap opens the node's details.
  • Not seen: battery and signal rows (the sim sends neither), the dimmed state, and two trackers on one screen.
Picker Choose a node Small Wide
picker choose small wide

Constitution Check

  • I: Android-only Glance module; no commonMain changes.
  • II: spotless and detekt (incl. type-resolved) pass.
  • III: the picker uses Compose Material 3 and core:ui components; no navigation graph because it's a launcher entry point.
  • IV: nothing logged beyond a widget id.
  • V: AppTheme, NodeChip, MeshtasticSearchBar, M3 tokens. Cross-platform spec N/A for a platform widget; meshtastic/design has no features/ directory.
  • VI: widget page rewritten, last_updated bumped, alias registered.
  • VII: baseline green before push.

Follows one node the user picks: battery, signal, last heard, hops away
and distance from our radio, matching the Node Tracker widget the Apple
app ships. A configuration activity picks the node per instance, and a
node that drops out of the node DB asks to be re-chosen.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 18, 2026
… order

The launcher labels a widget from its receiver, not the provider XML, so
both widgets showed the app name. The picker now takes one snapshot of the
node DB; a live list re-sorted by last heard under the finger and tracked
the wrong node.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant