Repository navigation
Show a message's fields and bytes as separate panes - #16
Merged
Merged
Conversation
The detail panel was one scroll area with the summary, the field tree and the hex dump stacked inside it. A message with many fields pushed the bytes out of sight, and reaching them scrolled the field tree away, so the two representations this view exists to link could not both be read at once. Each is its own pane now, and what the message is stays above them both. The facts about the instance move onto the head row, which had a wide empty middle while they sat in a boxed strip costing a line of the panel. The Fields heading stays put while its tree scrolls, the way the Raw bytes heading already did. The bytes pane takes its content's height rather than a fixed share, since most messages are a handful of bytes. Four rows is the floor, so a five-byte Sync still gets a box with some presence, and 40% of the panel is the ceiling, so a large CopyData cannot crowd out the fields. A ruler above the dump labels which column is which byte of the row. It sits outside the scroll container and follows it sideways by transform, because the dump is wider than its pane at most widths and a ruler that did not follow would label the wrong columns. It reuses the cells' own widths, so the two cannot drift apart. Revealing a field scrolls to the row its first byte falls in and brings that row to the top. A field can span more rows than one, and resting it against the nearer edge left the rest of it below the fold. The dump's own top padding is part of that arithmetic now, which it was not before: a revealed row came to rest with its lower edge clipped by exactly the padding, nearly half of a 20px row. Hovering a byte scrolls its field's row into view, the reverse of what hovering a field already did to the dump. Each side declines to scroll while it is the one being pointed at. The dump no longer scrolls smoothly. That distance is however far apart the bytes happen to sit, so on a large dump it was a long glide with nothing to see on the way.
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.
The detail panel was one scroll area with the summary, the field tree and the hex dump stacked inside it. A message with many fields pushed the bytes out of sight, and reaching them scrolled the field tree away, so the two representations this view exists to link could not both be read at once.
Layout
The facts about the instance moved onto the head row, which had a wide empty middle while they sat in a boxed strip costing a line of the panel. The Fields heading now stays put while its tree scrolls, matching what the Raw bytes heading already did.
The bytes pane takes its content's height rather than a fixed share, since most messages are a handful of bytes: a
ParameterStatusis 29, aSyncis 5. Four rows is the floor and 40% of the panel is the ceiling, so a short message does not hold open a large empty box and a largeCopyDatacannot crowd out the fields.The column ruler
00 01 02 … 0fabove the dump, the header every GUI hex editor has. It sits outside the scroll container and follows it sideways bytransformrather than beingposition: stickyinside it. Sticky would sit in the flow above the sizer, which shifts every row's scroll position, sotopInsetwould stop being the container's padding and the reveal arithmetic would have to reckon with a newly obscured top band. Outside costs onescrollLeftstate variable.It reuses
.hex-offset,.hex-bytesand.hex-byte, so the2.6chcells and the wide8n + 1divider are defined once and used twice. A separate set of widths would have been a second contract to keep in step.The box border, background and inset shadow moved from
.hex-dumpto.hex-dump-frame, so the ruler sits inside the same box as the bytes it labels.Scrolling
Revealing a field scrolls to the row its first byte falls in and brings that row to the top. A field can span more rows than one, and resting it against the nearer edge put its first row at the last visible line with the rest below the fold.
The dump's own top padding is part of that arithmetic now, which it was not before.
scrollTopis measured from inside the padding while a row's position is measured from the sizer's origin, so a revealed row came to rest with its lower edge clipped by exactly the padding, nearly half of a 20px row.visibleRowWindowhad the same omission, whichOVERSCAN_ROWS = 6had been masking.PacketListalready solved this the same way, andHexDumpnow measures the padding off the computed style in its existingResizeObserverrather than hardcoding it, since it is set inrem.Hovering a byte scrolls its field's row into view, the reverse of what hovering a field already did to the dump. Each side declines to scroll while it is the one being pointed at, which is the
hoveredByteguard on one side and the existingrevealprop on the other. It scrolls the tree's ownscrollTopby comparing rectangles rather than callingscrollIntoView, which would also scroll every scrollable ancestor: below the 1100px breakpoint.explorer-bodyis one of those, so the page itself would move.The dump no longer scrolls smoothly. That distance is however far apart the bytes happen to sit, so on a large dump it was a long glide with nothing to see on the way. The packet list keeps its animation, where a keyboard step is always exactly one row, and it keeps its own nearest-edge
scrollTopToRevealinpacketWindow.tsfor the same reason.Notes for review
hexWindow.test.ts, 223 total. The load-bearing ones pin the padding fix and the wrapped-field case..detail-panel .panel-headgainsflex-wrap, scoped so the message list's head is untouched. The detail panel is only guaranteed 26rem and that row now carries a name, a docs link, a type char, three facts and a chip.20pxrow height is now in three places:.hex-row'sheight,ROW_HEIGHTinHexDump.tsx, and themin-heightcalc. Commented, but a custom property would cut it to two..hex-offsetis 4 hex digits with no fixed width, so a packet past0xffffwould render five and shift its rows. No shipped capture is near it (the largest packet is 206 bytes) but an uploadedCOPYcapture could be. Left alone as out of scope.