TUI stage 3: render tree#32
Merged
Merged
Conversation
Cell-based transcription of Flutter's render layer: RenderObject/RenderBox, BoxConstraints, intrinsics, dirty-tracking via PipelineOwner, and a starter render-object set (Text, Padding, ConstrainedBox, Flex, DecoratedBox). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A box that receives tight constraints cannot change size on re-layout, so it is its own relayout boundary — essential for localizing re-layout (and for stage 4 panels). Fix the boundary test to cover both the tight case (self boundary) and the non-tight case (dirty bubbles to the parent). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…Text Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…DecoratedBox Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Row/Column mechanism: two-pass layout, flex factors with FlexFit, main/cross alignment, and a Bresenham-style integer space split that tiles the parent exactly. Tests adjusted from the plan draft: the single-flex test now passes FlexFit.tight (a loose flex child may stay smaller), and two CrossAxisAlignment tests drop an unused local. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…erFlex tests Also fixes the _splitProportional doc comment to accurately describe the cumulative-floor (Bresenham) algorithm instead of claiming front-to-back remainder distribution. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t for RenderTuiView Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Stage 3 of the Flutter-style terminal UI framework in
app/lib/src/tui/— a cell-based transcription of Flutter's render layer. Layout reuses Flutter's box protocol (constraints down, sizes up); the only substitution is the unit: terminal cells instead of pixels. Render objects paint through the stage 2Painter.BoxConstraints(cell-based min/max width & height with the full algebra:tight/tightFor/loose/constrain/deflate/loosen/enforce),RenderObject/RenderBox, the four intrinsic-dimension methods, andEdgeInsets.PipelineOwnerwith depth-sortedflushLayout;markNeedsLayoutlocalizes re-layout to the nearest relayout boundary.markNeedsPaintis whole-tree (no layer model yet — documented limitation).RenderText(leaf),RenderPadding,RenderConstrainedBox,RenderDecoratedBox(border + fill),RenderFlex(theRow/Columnmechanism: two-pass layout, flex factors withFlexFit, all alignments, and a Bresenham-style integer space split that tiles the parent exactly), andRenderTuiView(the root, bridging the tree toTerminal.draw).app/examples/tui/render_tree_demo.dart: a multi-panel screen (header / two bordered flex panels / footer) with key-driven mutation and resize.All stage 3 code lives in one library
app/lib/src/tui/render/render.dartcomposed ofpartfiles. Design spec and implementation plan are indocs/superpowers/.Built task-by-task with TDD; each task had spec-compliance and code-quality review.
Test plan
cd app && flutter test test/tui/— 225 tests pass (81 new undertest/tui/render/)flutter analyze— cleandart tool/prepare_submit.dart— no diffcd app && dart run examples/tui/render_tree_demo.dartin a real terminal — header bar, two bordered panels (left flex 1, right flex 2) with wrapped text, footer; keypress updates the left panel only; resize re-lays the screen;qexits cleanly. (Not runnable in a non-tty console such as the IDE run window.)🤖 Generated with Claude Code