feat(components): intrinsic measurement for terminal, table and codeblock#35
Merged
Conversation
…lock The three content-heavy components had no IntrinsicMeasure, so without explicit width/height they laid out at zero/arbitrary size in flex containers. Each intrinsic replicates its painter's exact constants (promoted to pub(crate) instead of duplicating literals): terminal chrome+padding+lines, table header+rows with measured or declared column widths, codeblock via the shared compute_code_dimensions. Also fixes auto_scroll_disabled_codeblock_overflows which passed by accident (height=0 layout) using the silently-ignored legacy size field; it now constrains via style.height as always intended.
18 tasks
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.
Closes #11.
Goal: Terminal, Table and Codeblock size to their natural content inside flex containers without explicit dimensions.
pub(crate)rather than re-hardcoded): terminalchrome + 2×padding + lines × line_height, table(1 + rows) × row_heightwith measured-or-declared column widths, codeblock through the sharedcompute_code_dimensions+ chrome height.styledimensions keep priority;auto_scrollsemantics unchanged.auto_scroll_disabled_codeblock_overflows, which passed by accident before (no intrinsic → height 0 → always "overflowing"); it used the silently-ignored legacysizefield and now usesstyle.height.Side finding for follow-up:
rustmotion validateonexamples/component-showcase.jsonemits 16 true-positiveunknown attribute 'size'warnings — the example uses that dead legacy field throughout; to clean up in a docs pass.Tests: 3 new red-first layout tests (height reflects line/row count for each component). 177 total, all green; showcase validate output identical before/after.
Verify:
cargo test --workspace✓ ·cargo fmt --check✓ · clippy 0 warnings ✓