CAMEL-23841: camel-jbang - fix TUI layout overflow and add minimum size guard#24284
CAMEL-23841: camel-jbang - fix TUI layout overflow and add minimum size guard#24284ammachado wants to merge 3 commits into
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
…ze guard - Tab bar: switch to compact labels (no outer spaces, | divider) when terminal width < 126 chars; full labels need 126, compact needs 88 - Footer: on overflow, drop secondary F-key hints (F2/F3/F6) before tab-specific action hints (stop/kill/restart) to preserve the most actionable hints; right-side decorations (MCP, recording) dropped first - Minimum size: render a btop-style centered message when terminal is below 88x24 instead of clipping content; resumes normal rendering as soon as the terminal is resized above the threshold Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ze guard - Tab bar: switch to compact labels (no outer spaces, | divider) when terminal width < 126 chars; full labels need 126, compact needs 88 - Footer: on overflow, drop secondary F-key hints (F2/F3/F6) before tab-specific action hints (stop/kill/restart) to preserve the most actionable hints; right-side decorations (MCP, recording) dropped first - Minimum size: render a btop-style centered message when terminal is below 88x24 instead of clipping content; resumes normal rendering as soon as the terminal is resized above the threshold Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🧪 CI tested the following changed modules:
All tested modules (2 modules)
|
davsclaus
left a comment
There was a problem hiding this comment.
Nice work on the compact tab bar and the priority-based footer truncation — the approach is solid and the minimum-size guard is a good addition.
One bug in the footer overflow drop loop: the index formula removes F1 (which should be preserved) while keeping F6, when hasHelp=true (the common case). Details in the inline comment.
This review does not replace specialized AI review tools or static analysis.
This review was generated by an AI agent (Claude Code on behalf of Claus Ibsen) and may contain inaccuracies. Please verify all suggestions before applying.
… help The footer overflow handler dropped F-key hints from the wrong end: with help text present it removed F1 (which should always be preserved) while keeping F6. insertFKeyHints returned the secondary-only count and the drop loop's index formula resolved to the F3 pair, removing F1/F2/F3 in turn. insertFKeyHints now returns the total F-key span count, and the drop logic is extracted into a testable static dropFKeyHints helper that removes pairs from the tail (F6, then F3, F2), stopping before the first pair so F1 (help) always survives. Added unit tests covering the help, no-help, no-overflow, and heavy-overflow cases. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Description
Fix TUI layout overflow issues visible at 120×43 (the primary target terminal size) and add a minimum-size guard for smaller terminals.
Tab bar overflow: the full tab bar needs ~126 chars and clips
0 More▾to a bare0at 120 columns. Two display modes are now used: full labels (1 Overview | 2 Log | ...) at ≥126 cols, compact labels (1 Overview|2 Log|..., ~88 chars) at 88–125 cols. Badge X-position calculation was updated to match the active divider width.Footer overflow: some tabs have footers that exceed terminal width by 50–80 chars (Diagram: ~170–186, Errors: ~169–199), clipping mid-word. On overflow the footer now drops content in priority order: decorative right-side spans (MCP status, recording) first, then secondary F-key hints (F2/F3/F6), and only then tab-specific action hints (stop/kill/restart). F1 help and the first tab hint are always preserved.
The secondary F-key drop logic is extracted into a package-private static
dropFKeyHintshelper so it can be unit tested. It removes hint pairs from the tail (F6 first, then F3, F2) and stops before the first pair, so F1 (help) always survives even on a narrow terminal.Minimum size guard: when the terminal is below 88×24, all rendering is skipped and a btop-style centered message is shown with the current and required dimensions (out-of-range values in orange). Normal rendering resumes automatically on resize — no new event-handling code is needed since TamboUI already re-invokes
render(Frame)with current dimensions on every resize.Target
mainbranch)Tracking
JIRA: https://issues.apache.org/jira/browse/CAMEL-23841
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.AI-assisted contributions
Co-authored-bytrailers) and the PR description identifies the AI tool used.Claude Code on behalf of Adriano Machado