Skip to content

Added horizontal byte map view to Atom Map with zoom - #14

Merged
CodyCBakerPhD merged 5 commits into
mainfrom
claude/atom-map-horizontal-nzzohf
Aug 12, 2026
Merged

CodyCBakerPhD merged 5 commits into
mainfrom
claude/atom-map-horizontal-nzzohf

Conversation

@CodyCBakerPhD

Copy link
Copy Markdown
Member

The Atom Map now displays MP4 boxes in a horizontal orientation by default, mapping them onto the file's byte axis. This solves the problem of the indented tree view becoming thousands of rows tall for fragmented recordings.

Key changes:

  • New horizontal "byte map" view draws boxes left-to-right by byte offset, one lane per nesting depth, keeping height bounded regardless of file length
  • Added orientation toggle (Horizontal/Vertical) that remembers the user's choice in localStorage
  • Implemented zoom functionality: clicking a block zooms into its byte range, with breadcrumb navigation to zoom back out
  • Boxes too narrow to draw individually are collapsed into group blocks showing atom counts; clicking zooms to reveal them
  • Added atomLayout.ts module with geometry calculations for positioning atoms on the byte axis, handling clipping, collapsing, and grouping logic
  • Extended styling with color-coded families (moov/mdat/moof/other), ruler with byte offsets, legend, and responsive label sizing via ResizeObserver
  • Vertical tree view preserved unchanged, now toggled alongside the new horizontal view
  • Added comprehensive unit tests for layout calculations and Storybook stories for both orientations
  • Updated help text to explain both views and their use cases

https://claude.ai/code/session_0191Yrv8pTa7ujjv9iC9WiZE

The indented tree grew one row per box, so a long recording — especially a
fragmented one, where a moof+mdat pair repeats per fragment — ran to
thousands of rows. The new horizontal view draws the boxes onto the file
itself: left to right is byte offset, one lane per nesting level, so the map
is a handful of rows tall however long the video is.

Clicking a block zooms the view to its byte range, with a breadcrumb back
out. Boxes too narrow to draw at the current zoom are merged into one block
saying how many it stands for rather than dropped, so a 20,000-fragment file
is a few blocks that open up as you zoom instead of an empty map. Color says
which top-level box a byte belongs to; the palette was checked for colorblind
separation and contrast against both themes.

A Horizontal/Vertical toggle picks between the new view and the original
tree, and the choice is remembered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191Yrv8pTa7ujjv9iC9WiZE
@chromatic-com

chromatic-com Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: encoding-helper-storybook: 2 changes accepted as baselines
🟢 UI Review: encoding-helper-storybook: Approved by Cody Baker
Storybook icon Storybook Publish: encoding-helper-storybook: 7 stories published

@chromatic-com

chromatic-com Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: encoding-helper-playwright: 2 tests unchanged
🟢 UI Review: encoding-helper-playwright: 2 tests published -- no changes
Storybook icon Test suite publish: encoding-helper-playwright: 2 tests published

@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://brain-bbqs.github.io/encoding-helper/pr-preview/pr-14/

Built to branch gh-pages at 2026-08-12 14:16 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov-commenter

codecov-commenter commented Aug 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.78075% with 107 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ui/atomsTab.ts 0.00% 103 Missing ⚠️
src/lib/atomLayout.ts 95.23% 2 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
src/lib/atomLayout.ts 95.23% <95.23%> (ø)
src/ui/atomsTab.ts 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CodyCBakerPhD CodyCBakerPhD self-assigned this Aug 11, 2026
claude added 3 commits August 11, 2026 21:22
The byte-proportional map could not give a moov under 1% of the file room
for its 24 children, so it summarised the whole subtree into one block and
most of what the indented tree shows went missing at the default zoom.

The Atom Map now offers two horizontal views, chosen alongside the tree from
one control. Structure, the new default, sizes each box by how many boxes its
subtree holds rather than by bytes, so every box in the file is drawn and
labelled at once — the tree turned on its side. Bytes is the previous
proportional map, kept because it is the one that shows a 99%-mdat file and
whether moov comes before mdat.

Merged runs are also cut as soon as they are wide enough to draw. A 20,000
fragment file collapsed into a single anonymous bar before; it now striates
into blocks whose density is the fragmentation, each carrying the color of
whatever fills most of it, so a fragmented recording reads as the sample data
it mostly is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191Yrv8pTa7ujjv9iC9WiZE
The structure view is the one worth having, and keeping a second axis meant
carrying a scale parameter through the placement, the layout, the readout and
the byte-offset ruler for a view nobody wanted.

Dropping it also removes a rule that was working against structure. A box
narrower than 2% was not opened up, because on the byte axis descending into
a sub-1% moov drew lane after lane of identical slivers. On the structure
axis a box's width is its subtree size, so that rule only hid children that
would have fit. Gone, the view now draws everything the panel has room for
and nothing less.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191Yrv8pTa7ujjv9iC9WiZE
The map is the view; a selector between it and the indented tree was one
button row standing between the tab and the thing worth looking at.

Nothing the tree carried is lost. Every block is already a button whose
aria-label is its type, role, offset and size, so those numbers are reachable
by keyboard and screen reader as well as by hovering, and the Report tab
still writes the whole tree out as indented text — the integration test now
counts the map's blocks against that listing, so the two cannot drift.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191Yrv8pTa7ujjv9iC9WiZE
@CodyCBakerPhD
CodyCBakerPhD merged commit 9c36cfd into main Aug 12, 2026
16 checks passed
@CodyCBakerPhD
CodyCBakerPhD deleted the claude/atom-map-horizontal-nzzohf branch August 12, 2026 14:25
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.

3 participants