Skip to content

os/v3/puppy: a console-TUI message takes 9 Reboot / power off off the screen for 12 s in a 13-row window #1015

Closed

Description

@bong-water-water-bong

Found while sweeping the fourth "no half blocks" case (#1012 / #1014). Same family, different payer: the transient
message.

draw() builds the footer as [keys line] + [message] and wraps both into footer: Vec<Line>. The keys line and the
message are therefore charged the same way, and when actions + keys + message exceeds the frame, ratatui clips the END
of the MENU — the ninth action — for as long as the message lives (12 s, main.rs's Duration::from_secs(12)).

Measured (blank-key mode, c16_board(), TERM=linux):

size no message message shown (q stays: no bare prompt here (7 shell, 9 reboot))
40x13 9 actions (+ MENU rule) 8 actions, 9 Reboot / power off gone, footer whole
56x12 9 actions 9 (message fits: 9 + 2 + 1 = 12)
80x11 9 actions 9 (same arithmetic)
24x13, 30x13 9 actions wrapped 8; at these widths even the keys line alone over-subscribes, so the actions are lost regardless

So the trigger is a window where actions + keys <= h < actions + keys + message — 40x13 is the clean case: the same
window draws all nine until a key is pressed, then loses Reboot / power off (a vm-check.sh / menugate string) for
twelve seconds. Full-log view (key 8) is unaffected.

No gate impact: the gates run at 80x25 and 240x67, where the frame has room for all of it.

The fix is a priority decision, which is why it is an issue and not a commit tonight — three options, in increasing size:

  1. Drop the message when it would cost an action row (actions + keys + message > h). Smallest diff, but the
    messages include real feedback ("reboot returned - the box did not go down", a handoff exit status), and silence is
    indistinguishable from a dead key.
  2. Wrap the message to at most one row in that case (cost 1 row instead of 2). Keeps feedback; the message is cut
    mid-word, which the file's "nothing is drawn half a block" rule otherwise forbids.
  3. Trim the keys line's legend tail before the message — the gate string is 1-9 actions (checked:
    puppy-check.sh and menugate.sh key the TUI shape on 1-9 actions or 1 Show the API key; nothing greps
    arrows/refresh/q stays), so 1-9 actions arrows scroll f newest r fits on one row at 40 columns and frees the
    row the message needs. Keeps the gate string, keeps the message, costs legend text that only the footer carries.

I would take 3, then 1 for anything narrower. Owner's call if the legend matters more than the message.

Not fixed here so that #1014 stays one idea; recorded because the sweep found it and it is the last size-related way the
MENU can lose a row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions