Skip to content

Position out-of-band graphics inside the reserved box - #8

Merged
planadecu merged 1 commit into
mainfrom
feat/position-graphics-in-box
Jul 14, 2026
Merged

Position out-of-band graphics inside the reserved box#8
planadecu merged 1 commit into
mainfrom
feat/position-graphics-in-box

Conversation

@planadecu

Copy link
Copy Markdown
Owner

Raw-format images (kitty/iterm2/sixels) were written at the terminal's top-left (\x1b[1;1H) or via a fixed cursor-up, which pinned the chart to the screen corner and broke any layout where it isn't the only pane.

This reads the reserved <Box>'s actual on-screen position from Ink's yoga layout (summing computed offsets up the node tree) and places the image there, so the chart renders inside its box and can be embedded in a larger TUI layout.

tsc clean; 79 tests pass. (Positioning is runtime-only, so unit tests don't cover the placement itself — verified behavior visually.)

Raw-format images (kitty/iterm2/sixels) were written at the terminal top-left
(\x1b[1;1H) or a fixed cursor-up, forcing the chart to the screen corner and
breaking any layout where the chart isn't the only pane. Read the reserved
<Box>'s on-screen position from Ink's yoga layout (walking the node tree to sum
computed offsets) and place the image there instead, so the chart renders inside
its box and can be embedded in a larger TUI.
@planadecu
planadecu merged commit ab03100 into main Jul 14, 2026
2 checks passed
@planadecu
planadecu deleted the feat/position-graphics-in-box branch July 14, 2026 09:28
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.

1 participant