ammachado opened a new pull request, #24236:
URL: https://github.com/apache/camel/pull/24236

   # Description
   
   Adds a vertical scrollbar to the embedded JLine shell panel in the Camel TUI 
(`camel jbang` / `camel tui`).
   
   The shell panel already supported scrollback through 
`Shift+PageUp`/`PageDown` and the mouse wheel, but it rendered no visual 
scrollbar, so there was no affordance showing the current position within the 
scrollback history (see https://issues.apache.org/jira/browse/CAMEL-23829).
   
   **What changed**
   
   - Render a vertical scrollbar following the same pattern already used by the 
other TUI tabs (`LogTab`, `SourceViewer`, `DiagramSupport`): the inner area is 
split into a content column (`Constraint.fill()`) and a 1-column scrollbar 
gutter (`Constraint.length(1)`), and the scrollbar is drawn via 
`renderStatefulWidget` only when there is scrollback history to page through.
   - The virtual terminal is now sized to the content width (`innerWidth - 1`) 
so shell output is never clipped underneath the scrollbar. The gutter is 
reserved permanently to keep the content width stable, which avoids extra 
`ScreenTerminal` resizes (the source of the concurrent-resize races the class 
already guards against).
   - The viewport position math is extracted into a small static helper 
`scrollbarPosition(...)`, reused by both `renderScrolledView` (which line to 
start drawing) and the scrollbar `position`, so the indicator can never 
disagree with what is actually on screen.
   
   **Tests**
   
   - New `ShellPanelTest` covers the `scrollbarPosition` math: live view pins 
the thumb to the bottom, maximum scrollback pins it to the top, partial scroll 
is proportional, and over-scroll / no-history are clamped.
   
   **Docs**
   
   - No documentation change: `camel-jbang-tui.adoc` has no shell-panel section 
today (the existing scrollback shortcuts are likewise undocumented), and a 
passive scrollbar indicator does not change any default, option, or API, so it 
does not warrant an upgrade-guide entry.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL-23829) 
filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   ---
   
   _Submitted by Claude Code on behalf of Adriano Machado._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to