Repository navigation
os/v3/puppy: the console TUI never draws half a block, so a short window keeps all nine actions - #983
bong-water-water-bong wants to merge 2 commits into
Conversation
The code's row budget was a hand-counted 12 ("panels, nine menu rows, three
log rows and the footer"), so at 104x29 - a plain ssh window, the shipped
blank-key mode - the width test passed, the layout had rows left over, and
ratatui gave the panel grid's rows to the code: LEMONADE/GPU/NPU/MODELS/
FANS/DATA were gone, the log pane was gone, and the code's bottom quiet zone
painted over the MENU rule (which came back as " MENU ---- -").
The rows are the caller's question and only the caller can count them, so
qr_panel() no longer takes h and draw() decides after the footer, the panel
grid and the nine menu rows exist: the code is drawn only when
padded_top + facts + menu + 2 (log title and one log row) + footer <= h.
Where it does not fit, the URLs stay plain text - the documented fallback.
Measured at 104x29 with the static binary: before, panels 0 and the holed
MENU rule; after, the panel grid and the whole rule are back, no code, and
at 240x67 the code is still drawn (12 rows) with the panels intact. q over
ssh still exits 0 and restores icanon/echo; Ctrl-C on the console still
refuses to exit.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…dow keeps all nine actions
The log pane's height was a bare remainder (`h - top - menu - footer`) with no
floor, so whenever the fixed blocks did not fit, ratatui clipped the tail of
the frame: the MENU lost its last rows. Measured on the merged main with the
static binary in a pty: 80x18 drew actions 1-7 and a footer that still
promised "1-9 actions", with no `8 Logs` and no `Reboot / power off` - the
latter is a gate string vm-check.sh greps off tty1; 100x20 drew 1-8.
Now the nine actions and the footer are fixed (never trimmed) and everything
above them gives way in a fixed order, whole rows at a time: the status
facts first, then the log pane (a title needs a row under it), then the
CONNECT block's own tail. A one-row leftover is not a pane - it is the tail
of a wrapped log record (" tokens, 330.75 tok/s)") - so that row goes back
to the block above and the footer stays on the last row.
Measured after, same pty and binary: 80x18 and 100x20 show all nine actions
including `Reboot / power off`, 100x20 keeps a one-row log pane, 80x25 and
240x67 are byte-identical to the committed snapshots.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
#983 ready for review at |
|
CI at |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
READY.
$ cd os/v3/puppy/console-tui && cargo test --offline
test result: ok. 45 passed; 0 failed; 0 ignored (0.04 s)
Including the two arms that say what the change is for: a_short_window_keeps_the_nine_actions_and_the_footer_whole and the_qr_never_costs_another_block_a_row.
Read of the reordering: the footer is built first, and the QR is only drawn when the whole frame still fits (a log title plus one log row as the floor), so a code that does not fit takes a rule or the panel grid with it rather than being squeezed into the log pane. That is the right order — the thing a person reads first (facts, MENU) keeps its rows, and the thing that is optional (the code, which is also plain text in the URL row at 80x25) yields.
Not verified: an actual 80x25 and 132x43 terminal on the appliance (needs the VM/stick). The two sizes in the test suite are the same ones the earlier console PRs pinned, so the "whole" claims are at least anchored to a fixed geometry rather than asserted in prose.
|
CHANGES (state, not content): This PR's base is the branch Rebased it for you rather than leave it red: #995 ( Recipe, if you would rather own the branch: Close this one when #995 is green; the verdict for the content is posted on #995. |
|
Superseded by #995 (same commit |
Closes #982. Stacked on #981 (
os/v3-tui-qrfit, same function) — merge #981 first; this branch is #981 + one commit,so a rebase onto
mainafter #981 lands is a no-op.Root cause
The log pane's height was a bare remainder with a 1-row floor, and nothing bounded the total:
When
top + menu + log + footer > h, theLayout::verticalLengthconstraints are satisfied by clipping the END ofthe frame — which is the MENU. The code's comment already claimed the menu is "always whole"; that was only true at the
two sizes with committed fixtures.
Measured before (merged main, static binary, pty,
TERM=linux, blank key)Reboot / power off8 LogsReboot / power offis a gate string (vm-check.sh'sU2 menurow,menugate) — safe on tty1 at 80x25, missing onany ssh window shorter than 25 rows. At 40x15 only actions 1-5 were drawn, below an empty
LOGS newesttitle, and thefooter still said "1-9 actions".
After
The nine menu rows and the footer are fixed (never trimmed). Everything above them gives way in a fixed order, whole
rows at a time: the status facts first (they are the "technical information"), then the log pane (a title needs
a row under it — a 1-row pane would only show the tail of a wrapped record,
" tokens, 330.75 tok/s)", which reads asbroken output), then the CONNECT block's own tail. A one-row leftover goes back to the block above, so the footer
stays on the last row.
80x18 after — all nine actions, footer whole, log pane gone rather than half:
100x20 after keeps a one-row log pane on top of the nine actions; 80x25 and 240x67: both committed snapshots are
byte-identical and
renders_at_the_two_console_sizespasses unmodified.The diff
draw()computesavail = h - (menu + footer), drops the facts iftop + facts + 2 > avail, keeps the log pane onlywhen it is a title plus a row, and truncates the CONNECT block to the rest — arithmetic rather than a pop loop, so the
1-row case can hand its row back. New test
a_short_window_keeps_the_nine_actions_and_the_footer_wholesweeps40x15, 60x15, 80x18, 80x20, 80x24, 100x20, 120x16, 160x13, 240x12, 240x67 and requires: frame height == terminal, all
nine actions present, the footer whole on the last row(s), and no
LOGStitle without a log row under it.the_qr_never_costs_another_block_a_row(from #981) is adjusted in one place, not weakened: its "the panel grid ispresent at every width >= 100" becomes "if the code is on this frame, the panel grid is present" — because a frame
too short for the panels now drops them by design (the nine actions win), which is not something the QR caused.
cargo test45/45, clippy-D warningsclean,fmt --checkclean,tools/copyright.py --checkrc 0,build-static.shok —7e909e05b2725f4a, 1,554,688 B, static. README updated with the degradation order and the testcount (it also had 43 while #981 added one; now 45). No gate row touched, no image build, no board run, no device
ticket,
:18097untouched.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com