Skip to content

Add a Hex bytes toggle for non-printable bytes in the packet log#388

Merged
chrissnell merged 3 commits into
mainfrom
feature/nonprintable-byte-toggle
Jun 22, 2026
Merged

Add a Hex bytes toggle for non-printable bytes in the packet log#388
chrissnell merged 3 commits into
mainfrom
feature/nonprintable-byte-toggle

Conversation

@chrissnell

@chrissnell chrissnell commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Follow-up to the non-printable byte work (#384) based on UI feedback: surfacing every <0x7f> token is noise for everyday log reading and only matters when chasing a malformed packet. This gates the tokens behind an operator toggle, off by default, built on the toggle infrastructure from #386 (now merged).

Change

  • New device-local pref showNonPrintable in log-prefs-store (localStorage aprs-log-show-nonprintable), defaulting off — unlike auto-refresh/auto-scroll which default on.
  • A compact Hex bytes toggle in the log viewer toolbar (Logs page and Dashboard feed), next to Auto-refresh / Auto-scroll. Short label so the toolbar stays tidy.
  • PacketLogViewer takes a showNonPrintable prop: when on, the raw line renders the styled <0x7f> tokens (current behavior); when off, it renders the display string as plain text. State is shared, so the choice carries between Logs and Dashboard.

Default behavior

With the toggle off (the default), the packet log reads as ordinary text — the pre-#384 look. Operators diagnosing a stray control byte (e.g. a 0x7F wedged into a position report breaking map plotting, per #376) flip it on to reveal the bytes.

Rebased onto main after #386 merged. Build green, all 372 web tests pass.

The non-printable byte tokens (<0x7f>) from #384 are noise for everyday
log reading, useful only when diagnosing a malformed packet. Gate them
behind a device-local 'Hex bytes' toggle in the log viewer toolbar,
alongside auto-refresh / auto-scroll. Off by default: the raw line reads
as ordinary text until an operator opts in. State lives in the shared
log-prefs store, so the choice carries between the Logs page and the
Dashboard feed.
@chrissnell chrissnell force-pushed the feature/nonprintable-byte-toggle branch from 7dc4ff1 to acfcbb2 Compare June 22, 2026 22:16
@chrissnell chrissnell changed the base branch from feature/aprs-log-scroll-toggles to main June 22, 2026 22:17
The <0x..> tokens picked up a pink chip background and, because Chonky
ships .log-body span { display: block }, each one stacked on its own
full-width line. Drop the chip (no background, no padding) and scope the
selector to .pkt-raw .pkt-ctrl so display: inline outweighs Chonky's rule
after Svelte scoping. The byte still reads distinctly via the danger
colour and semibold weight, just quietly inline.
@chrissnell chrissnell merged commit 9de8f99 into main Jun 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant