Adriano Machado created CAMEL-23841:
---------------------------------------
Summary: camel-jbang - TUI layout overflow at 120 columns (tab
bar, footer, minimum size)
Key: CAMEL-23841
URL: https://issues.apache.org/jira/browse/CAMEL-23841
Project: Camel
Issue Type: Bug
Components: camel-jbang
Reporter: Adriano Machado
Assignee: Adriano Machado
The Camel TUI has two rendering issues visible at 120x43 \(a common terminal
size\) and no minimum\-size safeguard.
h2. 1. Tab bar clips the last entry
The full tab bar string \( "{{ 1 Overview | 2 Log | ... | 0 More▾ }}" \)
requires \~126 characters. At 120 columns the last label clips to a bare {{0}},
hiding the "More▾" label entirely.
h2. 2. Footer overflows mid\-word on some tabs
Tab\-specific footers on several tabs exceed the terminal width significantly.
For example, the Diagram tab footer requires \~170\-186 characters and the
Errors tab footer \~169\-199 characters. The terminal clips the last visible
hint mid\-word \(e.g., {{e ex}} instead of {{e export}}, {{d diagra}} instead
of {{d diagram}}\).
h2. 3. No minimum terminal size handling
Resizing the terminal below a sensible minimum produces corrupted or clipped
output with no feedback to the user.
h2. Resize behavior
TamboUI already re\-invokes {{render\(Frame\)}} with the current terminal
dimensions on every resize event. This means all three fixes work automatically
when the user resizes the terminal while the app is running: the tab bar
switches display mode, the footer drops or restores hints, and the too\-small
screen appears or clears — all without any additional event handling code.
h2. Proposed fix* _Tab bar:_ Add two display modes. At 126\+ columns use the
current full labels. At 80\-125 columns switch to compact mode \(strip outer
spaces from labels, use {{|}} instead of {{ | }} as divider\), reducing the
total to \~88 characters.
* _Footer:_ After assembling all hint spans, sum their character widths. If the
total exceeds the terminal width, drop decorative right\-side spans
\(recording, MCP status\) first, then drop left\-side hints from the end one at
a time, preserving the first tab\-specific hint and {{F1 help}} always.
* _Minimum size:_ Below 80 columns or 24 rows, skip all rendering and show a
centered message \(matching btop's style\): current dimensions highlighted in
color when below minimum, required dimensions in white. Normal rendering
resumes as soon as the user resizes above the threshold.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)