Skip to content

fix(patches): keep patch descriptions inside the display - #51

Closed
arena-ai-coding-agent[bot] wants to merge 1 commit into
mainfrom
arena/01a0700a-enhancify
Closed

arena-ai-coding-agent[bot] wants to merge 1 commit into
mainfrom
arena/01a0700a-enhancify

Conversation

@arena-ai-coding-agent

Copy link
Copy Markdown
Contributor

Problem

On the Patch Selection Menu, the highlighted patch's description went beyond the display — it was painted over the box's bottom border and chopped off mid-word at the screen edge.

Root cause

dialog always draws the highlighted item's description (via --item-help) on the very last line of the terminal (dlg_item_help() does wmove(stdscr, LINES - 1, 0)). The patches list was opened with auto full-screen sizing (-1 -1 0), so the box grew down to exactly that line — its bottom border landed on the same row where descriptions are drawn. Descriptions longer than the screen width were also cut off at the edge with no truncation marker.

Fix

In modules/json/patches.sh:

  1. Reserve the last screen line for the description. Size the checklist explicitly from tput lines/tput cols so the box ends one line above the bottom and the description gets its own clean line below the box. This matches how every other --item-help menu in the app (Custom_keystore.sh, Bundle_Parser.sh, import.sh) is already sized — the patches list was the only one using full-screen -1 -1 0.
  2. Trim descriptions to the screen width in the jq query (with a ... suffix) so the help line always fits; dialog's own edge-truncation remains as a backstop.
  3. Safe fallbacks: tput failure → 24×80, and minimums for box height / list height / description length on tiny screens.

Verification

Reproduced and verified with a locally built dialog (1.3) driving the real managePatches function end-to-end on rendered terminal captures:

  • ✅ 24×60 (phone portrait): description on its own line, borders intact — before/after captures confirmed the fix
  • ✅ Bottom of a 30-patch list (the reported case): clean description line with scrollbar
  • ✅ Narrow 24×40, wide 30×100
  • ✅ Done / Recommended / Enable All / Disable All button flows — valid JSON written, options merged with defaults
  • ✅ Empty-selection guard still fires and recovers; Back button still returns TASK=CHOOSE_APP
  • ✅ Tiny screens (10–13 rows): no crash, list auto-shrinks with scrollbar
  • ✅ Mid-dialog terminal shrink (rotation) exits cleanly — no Window too big error
  • ✅ tput failure falls back to safe defaults; bash -n clean on all repo scripts

dialog draws the highlighted patch's description on the very last line of
the terminal. With the fullscreen '-1 -1 0' sizing the checklist box ended
exactly on that line, so the description was painted over the bottom border
and chopped off at the screen edge when longer than the display.

Size the checklist explicitly (box ends one line above the bottom) and
truncate descriptions to the terminal width so the help line always fits,
matching how every other --item-help menu in the app is sized.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@Graywizard888
Graywizard888 deleted the arena/01a0700a-enhancify branch September 5, 2026 08:16
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