gnodet-bot commented on code in PR #27487:
URL: https://github.com/apache/camel/pull/27487#discussion_r4205675031
##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AutocompletePopup.java:
##########
@@ -385,9 +402,9 @@ private void renderList(Frame frame, Rect listRect) {
frame.renderStatefulWidget(list, listRect, renderState);
int visibleRows = Math.max(1, listRect.height() - 2);
- if (shown + 2 > visibleRows) {
+ if (listRows() + 2 > visibleRows) {
scrollbarState
- .contentLength(shown)
+ .contentLength(listRows())
.viewportContentLength(visibleRows)
.position(sel != null ? sel : 0);
Review Comment:
⚠️ **Scrollbar position doesn't account for the divider offset.**
At line 382, `renderState.select()` correctly adds `+1` when `dividerAt >= 0
&& sel >= dividerAt` to account for the divider row above the selection. The
scrollbar's `contentLength` is `listRows()` which already includes the divider
row — but `.position()` uses the raw logical `sel`, so the thumb appears one
slot too high when the divider is present and the selection is below it.
```suggestion
.position(sel != null ? sel + (dividerAt >= 0 && sel >=
dividerAt ? 1 : 0) : 0);
```
--
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]