fix: keep Memory label visible above the memory graph - #5
Merged
Merged
Conversation
added 2 commits
September 11, 2026 23:36
The memory label was drawn at mem_rect.y and then erased by the graph's clear and braille passes, which rewrite every cell inside mem_rect. Draw the label one row above the rect, matching the network label pattern, and add a pure layout regression test.
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.
Problem
demos/verification_2026-09-11.mdrecords that theMemory: ...label is drawn but never visible in the rendered TUI. Root cause insrc/ui.rs: the label was drawn atmem_rect.y(line 160) and the memory graph's clear pass then rewrote every cell inmem_rect.y..mem_rect.y + mem_rect.height(lines 182-185), followed bydraw_braille_line, which also rewrites every cell in the rect. The network label survives because it is drawn atnet_rect.y - 1, outside its graph rect.New behavior
mem_rect, via a small testable helperDashboardLayout::memory_label_y()(src/rendering.rs). Layout rects, graph heights, y-scaling, and all other labels are unchanged.tests/tui_memory_label.rs: for multiple terminal sizes it assertsmemory_label_y()is outside the memory graph rectangle (clear/braille region) and below the CPU graph clear pass. It fails on the pre-fix value (memory label row 10 overlaps memory graph rows 10..14 at 60x20).Network I/O: RX .. KB TX .. KB (last interval)remains a per-interval byte delta, noKB/s.demos/(tui_capture_2026-09-11-memory.raw/.txt) plus build identity indemos/tui_capture_2026-09-11-memory.md. Older captures and READMEs are untouched.Test commands and evidence
Real render under a pty (binary built from
42f4602, clean tree), rendered with pyte 0.8.2 at 110x50:Final frame now contains (row 18):
Memory: 52.4% (12.6GB/24.0GB), and row 26 keepsNetwork I/O: RX 14.0 KB TX 1.0 KB (last interval). Binary SHA-2568572c7e189a5736733869c337482a6a348838c9148d44831ff1048f991f7bbcc,rustc 1.94.1.Limits
CPU Usage:label has the same pre-existing overlap with the CPU graph clear pass; out of scope for this fix and noted in the capture doc.