Files
meshcore-analyzer/docs/user-guide/live.md
T
efiten 5c0de8fb41 feat(live): optional "Multibyte only" view filter (#1780) (#1781)
Closes #1780.

## What

Adds an opt-in **"Multibyte only"** toggle to the live map controls.
When ON, packets whose path hash size is `< 2` bytes (single-byte, or
unresolvable) are excluded from the entire live view — feed, map
polylines/rain, and the packet counter — in both LIVE and REPLAY modes.

- **Default OFF** — no behavior change for existing users.
- Persisted in `localStorage` under `live-multibyte-only`.
- Distinct from the existing global "hide 1-byte path hops" toggle: that
filters individual hops within a path at every render site; this filters
whole packets, on the live view only. They share no state.

## How

- **`public/hop-filter.js`** — new pure, dependency-free classifier
`MC_packetHashSize(rawHex, routeType)` returning `1|2|3`, or `0` when
unresolvable. Reads the path-length byte from `raw_hex` (`(pathByte >>
6) + 1`), offset `5` for transport routes (route_type 0/3) else `1` —
mirroring the existing `getPathLenOffset`/`computeBreakdownRanges` logic
in `app.js`. Lives next to the existing `hopByteLen`/`MC_*` family;
`app.js` is untouched (no duplication of the byte math).
- **`public/live.js`** — `groupIsMultibyte(packets)` consumes that
helper; applied at two render-time sites: the top of `renderPacketTree`
(above the counter increment, so the counter reflects multibyte-only)
and inside the `rebuildFeedList` group loop (so toggling re-filters the
buffered feed). Toggle markup + change handler mirror the existing
`liveFavoritesToggle` pattern.

## Why read from `raw_hex` and not the path hops

The hash size is a property of the whole packet and is present even for
zero-hop packets (where there are no hops to inspect), so reading the
path-length byte is correct in all cases. Unresolvable size is treated
as single-byte (excluded when ON) — we only show packets we can
positively confirm are multibyte.

## Performance (hot path)

The filter runs in the packet-render hot path, so: classification is
**O(1) per packet group** — it reads the first resolvable observation's
`raw_hex` (a short hex string, single `parseInt` of one byte) and
short-circuits. No per-packet API calls, no allocation in the loop, no
added O(n²). When the toggle is OFF (default) the check is a single
boolean guard and does nothing else. The buffered-feed re-filter reuses
the existing `rebuildFeedList` pass — no extra traversal.

## Tests

- **Unit** (`test-live-multibyte-filter.js`, 9 cases):
single/2-byte/3-byte classification, transport-route offset,
missing/short/garbage `raw_hex` → 0, whitespace tolerance.
- **E2E** (`test-live-multibyte-only-e2e.js`, Playwright): toggle
present and defaults OFF; ON hides a single-byte packet while a
multibyte one renders; OFF restores it; setting persists across reload.
Registered in the CI live-E2E block in `deploy.yml`.

## Docs

User-guide entry added in `docs/user-guide/live.md`.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 03:56:08 -07:00

2.6 KiB
Raw Blame History

Live

The Live page shows packets flowing through your mesh in real time, with animated map visualizations.

[Screenshot: live page with map animations and packet feed]

Real-time feed

Packets appear as they arrive via WebSocket. Each entry shows:

  • Packet type icon and color
  • Sender name
  • Observer that captured it
  • SNR and hop count
  • Timestamp

The feed scrolls automatically. New packets appear at the top.

Map animations

When a packet arrives, the Live map animates the signal path:

  • A pulse appears at the sender's location
  • Lines animate from sender to each observer that heard the packet
  • Observer markers flash briefly on reception

Realistic propagation

Enable Realistic Propagation in the controls to buffer observations of the same packet and animate them simultaneously — showing how a single transmission ripples through the mesh.

Ghost hops

When enabled, intermediate relay hops are shown as faded markers even if they don't have known locations. Disable to show only nodes with GPS coordinates.

VCR mode

The Live page has a built-in VCR (video cassette recorder) for packet replay.

Button Action
⏸ Pause Freeze the feed. New packets are buffered but not displayed.
▶ Play Resume live feed or start replay.
Rewind Step backward through packet history.
Fast-forward Replay at 2×, 4×, or 8× speed.

While paused, a badge shows how many packets arrived that you haven't seen yet.

Timeline

The timeline bar at the bottom shows packet activity over the selected time scope (default: 1 hour). Click anywhere on the timeline to jump to that point in time.

Packet type legend

Each packet type has a color and icon:

Type Icon Color
Advert 📡 Green
Channel Msg 💬 Blue
Direct Msg ✉️ Amber
ACK Gray
Request Purple
Response 📨 Cyan
Trace 🔍 Pink
Path 🛤️ Teal

Controls

  • Favorites only — show only packets from your claimed nodes
  • Multibyte only — show only multibyte (≥2-byte path-hash) packets and hide single-byte traffic. Single-byte path hashes collide heavily at scale, so their paths are unreliable; enable this for a cleaner, more trustworthy live picture. Off by default; the choice is remembered.
  • Matrix mode — visual effect overlay (just for fun)

Tips

  • Use VCR pause when you spot something interesting — then step through packet by packet
  • Realistic propagation mode is best for understanding multi-path reception
  • The timeline sparkline shows traffic patterns — useful for spotting quiet periods or bursts