Add a Hex bytes toggle for non-printable bytes in the packet log#388
Merged
Conversation
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.
7dc4ff1 to
acfcbb2
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
showNonPrintableinlog-prefs-store(localStorageaprs-log-show-nonprintable), defaulting off — unlike auto-refresh/auto-scroll which default on.PacketLogViewertakes ashowNonPrintableprop: 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
0x7Fwedged into a position report breaking map plotting, per #376) flip it on to reveal the bytes.Rebased onto
mainafter #386 merged. Build green, all 372 web tests pass.