Repository navigation
Fit wide charts and diagrams to their column from the first frame - #533
Merged
Merged
Conversation
Collaborator
Author
|
Review: Changes needed CI is red. The Blocking
Verified
Legibility (non-blocking, follow-up recommended)
Recommendation:
|
MaggieAppleton
added this pull request to stack #546
October 13, 2026 08:58
MaggieAppleton
force-pushed
the
design-phone-chart-fit
branch
3 times, most recently
from
October 13, 2026 11:33
f554f34 to
b7c2708
Compare
A diagram wider than its column now opens fitted to it, in CSS so the first frame and every resize already fit; a size the reader picks survives resizing. A narrow column keeps the controls to one row, and investigation tables no longer inherit the authored-table column floor that pushed the last column out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…row bar Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaggieAppleton
force-pushed
the
design-phone-chart-fit
branch
from
October 13, 2026 12:15
b7c2708 to
d11bb00
Compare
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.
On a phone, an investigation's bar chart opened at 1:1 and was cropped until you pressed Fit. Its controls also wrapped onto two rows, and the four-column table cut off its last column.
What changed
packages/diagrams/src/diagram.tsx): a diagram wider than its column opens fitted to the column. The fit is plain CSS (min(100%, <authored>px)), so it already applies on the first frame and keeps up with every resize. A diagram that fits stays at 1:1. Once you choose a size with zoom or Actual size, it stays through resizes. Fit to width hands sizing back to the column.fitDiagramno longer stops at 85%. Zoom out still stops at 85%, or at the fitted size if that's smaller.viewer/chrome.css): a container query hides Restart, the step counter, zoom in, zoom out and the zoom percentage. Play, previous, next, Fit and 1:1 stay. Play restarts a finished diagram, and you can still pinch to zoom. The cutoff is 21rem for a mouse and 30rem for touch, where the buttons are 44px.packages/editor/src/styles.css): the table sits inside.plan-content, so it picked up the authored-tabledisplay: blockand the 7rem minimum cell width. Both are reset for.plan-evidence, with slightly tighter padding.This applies to every
@chopin/diagramstype: charts, graphs, lanes and structures (checked all 42 gallery fixtures at 390px). Wireframes already reflow, and Mermaid blocks keep their own legibility floor and full-screen sheet, so neither changes.Before / after, 390×844
Tests
a chart wider than a phone column fits it from the first frame: records the chart's width in its first animation frame and checks it is ≤ the stage width. It also checks the controls sit on one row and that Fit and Actual size toggle overflow.bun test packages/diagrams packages/experimentandbun run typespass. Theseecode.e2e.tsandwide-content.e2e.tse2e tests pass locally.🤖 Generated with Claude Code
Landing validation
The four chart-stack patches are preserved on current main. Fresh local CI and workspace types pass; prior production build, units, application browsers and galleries passed. Both native stack layers are running fresh full GitHub CI; stack metadata and existing images are preserved.
Final stack landing: source patches are unchanged on main
99d5d92a, including the shared Linux bundle repair #553 and all other handoff PRs. Fresh local project checks and types pass. Invalid lane anchors were replaced through the lane CLI, preserving their constraints; audits are now clean. All five fresh GitHub checks pass on these exact final stack heads, including design behavior, diagram galleries, full browser/system integration, and the Linux container build. The stack is ready for its native rebase merge.