Skip to content

Show routing/hop info on messages #65

Description

@MrSurly

Summary

Show each message's routing info (direct vs. relayed, hop count) in the chat UI. This data is already captured from firmware but never surfaced.

What's already there

  • Firmware sends hop count with every received message: path_len in both the direct-message and channel-message V3 response formats (lib/ble/ble_responses.dart:501,531, SNR is sent alongside it too).
  • It's parsed into pathLength/hopCount and persisted per-message in the messages table (lib/database/tables.dart:28-29: isDirect "True if 0 hops" and hopCount "Number of relay hops (-1 = unknown)"), written in lib/repositories/message_repository.dart (e.g. lines 752, 771, 1424, 2070).
  • SNR is parsed (response.snr) but is not currently persisted per-message the way hop count is.

What's missing

None of this reaches the UI. There's no reference to .hopCount or .snr anywhere under lib/screens or lib/widgets -- the data is captured and stored, then discarded from the user's perspective.

Desired behavior

  • Show a small indicator per message (e.g. in the existing per-message status-icon row added in the Add status icons to chat screens #46 status-icons work) indicating whether it arrived direct or via N hops.
  • Consider also surfacing SNR if it's cheap to persist alongside hop count (may need a migration to add an snr column to messages, mirroring the existing snr column already on the contact_position_histories table at lib/database/tables.dart:195).
  • A tap/long-press on the indicator could show more detail (exact hop count, SNR) for users who want it, keeping the default view unobtrusive.

Open questions

  • Exact visual treatment (icon + tooltip vs. inline text) -- should follow whatever pattern the Add status icons to chat screens #46 status-icons work already established for consistency.
  • Whether SNR is worth the schema migration for v1, or whether hop count alone covers the ask.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions