[
https://issues.apache.org/jira/browse/CAMEL-23831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Adriano Machado updated CAMEL-23831:
------------------------------------
Description:
h3. Add mouse support to the Camel TUI JBang plugin.
The TUI already enables mouse capture via TamboUI's {{mouseCapture(true)}}, but
originally only the ShellPanel handled mouse events (scroll only). This ticket
covers adding mouse interactions to the main TUI.
The work was delivered across two pull requests:
*Delivered in PR #24351 (merged):*
* Mouse-wheel scrolling (3 lines per tick) in all table-based tabs
* Click-to-select rows in tables
* Tab-bar click navigation
* More / Switch dropdown mouse handling (click an entry, outside-click to
dismiss, wheel to move highlight)
* Vertical scrollbar rendering and drag support
* Topology / EIP node click selection in diagram views
* Panel-border drag resize for the Shell and AI panels
* Log-view scroll ({{LogTab}} custom scroll logic)
*Delivered in PR #24365 (this ticket's remaining follow-up):*
* Footer key bindings clickable: clicking a hint (F1/help, F2/actions,
Enter/open, single-letter actions) synthesizes that key through the normal key
path; ambiguous multi-key hints stay non-clickable
* Actions popup and doc picker clickable: click an entry to select/activate via
a synthetic Enter, outside-click goes back one level via a synthetic Esc, wheel
moves the highlight
* Overview divider fix: clicking the "Dev/Infra Services" divider row no longer
moves the selection onto it (matches keyboard navigation, which skips it)
*Still keyboard-only (not in scope):*
* The example and infra browsers, whose wrapped, variable-height rows cannot be
reliably hit-tested
*Implementation approach:*
* A default {{handleMouseEvent(MouseEvent, Rect)}} method on the {{MonitorTab}}
interface, with {{getTableState()}}/{{getTableRowCount()}} accessors so
table-bearing tabs get scroll and click support with minimal overrides
* Rendered {{Rect}} areas stored in {{CamelMonitor}} during {{render()}} for
hit-testing during event dispatch
* Static hit-testing helpers ({{tableRowAt}}, {{tabIndexAt}},
{{footerKeyEvent}}, {{footerRegionAt}}, {{listItemAt}}) unit-tested directly
No new dependencies required. Uses the existing TamboUI {{MouseEvent}} API.
was:
h3. Add mouse support to the Camel TUI JBang plugin.
The TUI already enables mouse capture via TamboUI's {{mouseCapture(true)}}, but
only the ShellPanel handles mouse events (scroll only). This ticket covers
adding mouse interactions to the main TUI:
_Initial scope (this ticket):_
* Click on tab labels to switch tabs (instead of pressing number keys 1-9, 0)
* Scroll wheel in content area to navigate table rows (tabs using
{{TableState}})
* Scroll wheel in log view ({{LogTab}} has custom scroll logic)
_Deferred to follow-up tickets:_
* Click on table rows to select them
* Click on popup items (More popup, Switch popup)
* Drag support
_Implementation approach:_
* Add a default {{handleMouseEvent(MouseEvent, Rect)}} method to the
{{MonitorTab}} interface, with {{getTableState()}}/{{getTableRowCount()}}
accessors so table-bearing tabs get scroll support with minimal overrides
* Store rendered {{Rect}} areas in {{CamelMonitor}} during {{render()}} for
hit-testing during {{handleEvent()}}
* Add {{handleTabBarClick()}} in {{CamelMonitor}} to map click x-coordinates to
tab labels
* Override {{handleMouseEvent}} in {{LogTab}} for its custom scroll field
* Add {{getTableState()}}/{{getTableRowCount()}} overrides to all ~20
table-bearing tabs
No new dependencies required. Uses existing TamboUI {{MouseEvent}} API.
> camel-tui: add mouse support (tab clicks and scroll)
> ----------------------------------------------------
>
> Key: CAMEL-23831
> URL: https://issues.apache.org/jira/browse/CAMEL-23831
> Project: Camel
> Issue Type: New Feature
> Components: camel-jbang
> Reporter: Adriano Machado
> Assignee: Adriano Machado
> Priority: Minor
> Fix For: 4.22.0
>
>
> h3. Add mouse support to the Camel TUI JBang plugin.
> The TUI already enables mouse capture via TamboUI's {{mouseCapture(true)}},
> but originally only the ShellPanel handled mouse events (scroll only). This
> ticket covers adding mouse interactions to the main TUI.
> The work was delivered across two pull requests:
> *Delivered in PR #24351 (merged):*
> * Mouse-wheel scrolling (3 lines per tick) in all table-based tabs
> * Click-to-select rows in tables
> * Tab-bar click navigation
> * More / Switch dropdown mouse handling (click an entry, outside-click to
> dismiss, wheel to move highlight)
> * Vertical scrollbar rendering and drag support
> * Topology / EIP node click selection in diagram views
> * Panel-border drag resize for the Shell and AI panels
> * Log-view scroll ({{LogTab}} custom scroll logic)
> *Delivered in PR #24365 (this ticket's remaining follow-up):*
> * Footer key bindings clickable: clicking a hint (F1/help, F2/actions,
> Enter/open, single-letter actions) synthesizes that key through the normal
> key path; ambiguous multi-key hints stay non-clickable
> * Actions popup and doc picker clickable: click an entry to select/activate
> via a synthetic Enter, outside-click goes back one level via a synthetic Esc,
> wheel moves the highlight
> * Overview divider fix: clicking the "Dev/Infra Services" divider row no
> longer moves the selection onto it (matches keyboard navigation, which skips
> it)
> *Still keyboard-only (not in scope):*
> * The example and infra browsers, whose wrapped, variable-height rows cannot
> be reliably hit-tested
> *Implementation approach:*
> * A default {{handleMouseEvent(MouseEvent, Rect)}} method on the
> {{MonitorTab}} interface, with {{getTableState()}}/{{getTableRowCount()}}
> accessors so table-bearing tabs get scroll and click support with minimal
> overrides
> * Rendered {{Rect}} areas stored in {{CamelMonitor}} during {{render()}} for
> hit-testing during event dispatch
> * Static hit-testing helpers ({{tableRowAt}}, {{tabIndexAt}},
> {{footerKeyEvent}}, {{footerRegionAt}}, {{listItemAt}}) unit-tested directly
> No new dependencies required. Uses the existing TamboUI {{MouseEvent}} API.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)