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

   ## Summary
   
   _Claude Code on behalf of Guillaume Nodet_
   
   Six improvements to the embedded shell panel in the TUI dashboard 
(`ShellPanel.java`, `CamelMonitor.java`, `Shell.java`):
   
   ### Reliability
   - **Replace reflection for ScreenTerminal history access**: cache the 
`Field` lookup at class load time, narrow `catch (Exception)` to `catch 
(NoSuchFieldException)` / `catch (IllegalAccessException)`, warn on first 
failure instead of silently returning empty results. Added TODO with JLine 
issue reference for when a public API is available.
   - **Add logging to silently swallowed exceptions**: introduce 
`java.lang.System.Logger` (JDK platform logger, no dependency) to `ShellPanel` 
and `CamelMonitor`. Race condition catches (`ArrayIndexOutOfBoundsException` 
from concurrent `ScreenTerminal` resize) get `DEBUG`/`TRACE` logging. Real 
errors like failed `.mcp.json` writes get `WARNING`. No behavior changes — just 
visibility.
   
   ### UX
   - **Render blinking cursor**: connect `ScreenTerminal` cursor position from 
`dump()` to `Frame.setCursorPosition()` so the terminal cursor blinks at the 
shell prompt. Only set when `scrollOffset == 0` (live view) and cursor is 
within bounds.
   - **Fullscreen shell mode**: at 100% the tab content area is fully hidden 
(skip `renderContent` call). Footer hint now shows the **next** percentage 
instead of the current one, so users know what Shift+F6 will do.
   - **Add scrollbar to shell panel**: follow the existing `StartupTab` pattern 
— `ScrollbarState` field, `Layout.horizontal()` split into content (fill) + 
scrollbar (1 col), `Scrollbar` widget. Maps `scrollOffset` (lines-from-bottom) 
to top-down position. Only shown when history exceeds viewport height.
   - **Simplify shell prompt**: remove version string from prompt in both 
embedded `ShellPanel` and standalone `Shell` — saves ~20 chars of horizontal 
space. Version is already visible in the TUI header bar and the shell's startup 
banner respectively.
   
   **Before:** `camel 4.21.0-SNAPSHOT> `
   **After:** `camel> `
   
   ## Test plan
   - [x] All 260 existing TUI tests pass (`mvn test -pl 
dsl/camel-jbang/camel-jbang-plugin-tui`)
   - [x] Code formatted with `mvn formatter:format impsort:sort`
   - [ ] Manual: open TUI with `camel tui`, press F6 to open shell, verify 
cursor blinks
   - [ ] Manual: cycle Shift+F6 through 25% → 50% → 75% → 100% → 25%, verify 
footer shows next %
   - [ ] Manual: run enough commands to create scrollback, verify scrollbar 
appears
   - [ ] Manual: verify `camel shell` prompt shows `camel> ` without version
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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