Skip to content

feat: give four rows and twenty columns back to the data - #28

Merged
dmaax merged 1 commit into
mainfrom
feat/tui-compact-chrome
Aug 22, 2026
Merged

dmaax merged 1 commit into
mainfrom
feat/tui-compact-chrome

Conversation

@dmaax

@dmaax dmaax commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Items 4 and 3 of the TUI review. On an 80×24 terminal, chrome took 61% of the screen: three rows of header and three of status bar to show two lines of text, plus 25 of 80 columns for eight labels that never change.

After

 MikroTUI 0.4.5 · 192.168.88.1 (hEX S)                         DEMO   READ-ONLY
 1 ┌ Firewall Filter Rules (Read-Only) (5) ────────────────────────────────────┐
 2 │ID   Chain  Action Src. A Dst. A Proto Dst. P Bytes  Packet Comment        │
 3 │                                                                           │
 4 │0    forwar accept 192.16        tcp   22,443 186Mi  1.49M  defconf rule 0 │
 ...
 ❌  refresh gave up after 60s  [?] Help  [q] Quit            Search: (press '/')

Content area at 80×24 goes from 53×14 to 77×18 — 39% of the screen to 72%.

Header and status bar

One borderless row each. The header claims width for the security badges first: [READ-ONLY] used to sit on the right of a fixed split and was the first thing an 80-column terminal cut off. Identity text degrades instead, dropping the app name before the host.

Collapsible sidebar

Below 100 columns it becomes a rail of tab numbers, three columns wide. The numbers are not decoration — 1–8 now jump straight to a tab, which is what makes the collapsed form usable rather than merely present.

Icon alignment, measured

⚙ and 🛡 occupy one column while the rest occupy two. The old list compensated with hand-placed trailing spaces — correctly, except 📡 had one too many and pushed its row a column right. Icons are now bare glyphs padded to a measured two columns using unicode-width, the same crate ratatui uses for layout, pinned to the version already in the tree (no new version enters the dependency graph).

Worth recording how the test measures, because two earlier attempts measured the wrong thing: it finds the column a label lands in, not the char index of a concatenated row. A wide emoji occupies one cell and leaves the next holding an empty string, so string offsets measure neither width nor position. Verified by reverting the padding — [6, 7, 7, 7, 7, 6, 7, 7].

Testing

83 tests, up from 78. Coverage for chrome height, the sidebar collapsing at the threshold, the READ-ONLY badge surviving every width from 80 up, label alignment, and the number keys mapping onto tabs.

Still open

80 columns is better but not solved: Src. A and forwar are still clipped. Dropping whole columns by priority — item 2 — is the last piece.

🤖 Generated with Claude Code

Items 4 and 3 of the TUI review. On an 80x24 terminal, chrome took 61% of the
screen: three rows of header and three of status bar to show two lines of
text, plus 25 of 80 columns for eight labels that never change.

Header and status bar are one borderless row each. The header now claims width
for the security badges first — `[READ-ONLY]` used to be on the right of a
fixed split and was the first thing an 80-column terminal cut off — and
degrades the identity text instead, dropping the app name before the host.

The sidebar collapses below 100 columns to a rail of tab numbers, three
columns wide. The numbers are not decoration: 1-8 now jump straight to a tab,
which is what makes the collapsed form usable rather than merely present.

Together that turns a 53x14 content area at 80x24 into 77x18 — from 39% of the
screen to 72%. Chain and action are readable there now instead of `forwar` and
`acce`.

Icon alignment is measured rather than assumed. `⚙` and `🛡` occupy one column
while the rest occupy two, and the old list compensated with hand-placed
trailing spaces — correctly except for `📡`, which had one too many and pushed
its row a column right. Icons are now bare glyphs padded to a measured two
columns with `unicode-width`, the same crate ratatui uses for layout, pinned
to the version already in the tree.

The alignment test measures the column a label lands in, not the char index of
a concatenated row: a wide emoji occupies one cell and leaves the next holding
an empty string, so string offsets measure neither width nor position.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dmaax
dmaax merged commit 73d8e5e into main Aug 22, 2026
6 checks passed
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