Skip to content

feat(components): intrinsic measurement for terminal, table and codeblock#35

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/component-intrinsics
Jul 18, 2026
Merged

feat(components): intrinsic measurement for terminal, table and codeblock#35
LeadcodeDev merged 1 commit into
mainfrom
feat/component-intrinsics

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #11.

Goal: Terminal, Table and Codeblock size to their natural content inside flex containers without explicit dimensions.

  • Formulas replicate the painters' exact constants (promoted to pub(crate) rather than re-hardcoded): terminal chrome + 2×padding + lines × line_height, table (1 + rows) × row_height with measured-or-declared column widths, codeblock through the shared compute_code_dimensions + chrome height.
  • Explicit style dimensions keep priority; auto_scroll semantics unchanged.
  • Fixed auto_scroll_disabled_codeblock_overflows, which passed by accident before (no intrinsic → height 0 → always "overflowing"); it used the silently-ignored legacy size field and now uses style.height.

Side finding for follow-up: rustmotion validate on examples/component-showcase.json emits 16 true-positive unknown 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 ✓

…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.
@LeadcodeDev
LeadcodeDev merged commit cd76b22 into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the feat/component-intrinsics branch July 18, 2026 20:54
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.

feat(components): intrinsic measurement for terminal, table and codeblock

1 participant