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

   # Description
   
   Fixes the broken context-sensitive help in the `camel tui` (camel-jbang TUI 
plugin). See [CAMEL-23838](https://issues.apache.org/jira/browse/CAMEL-23838).
   
   Two independent problems:
   
   **1. `F1` threw `java.lang.NoClassDefFoundError: 
org/commonmark/renderer/markdown/MarkdownRenderer$MarkdownRendererExtension`.**
   
   The `camel-launcher` fat-jar bundles every ASF plugin on a single flat 
classpath. Maven dependency mediation resolved a *split* commonmark:
   
   - `org.commonmark:commonmark` (core) → **0.21.0**, via 
`camel-jbang-plugin-generate` → `openapi-generator:7.23.0` (declared first).
   - `org.commonmark:commonmark-ext-*` → **0.28.0**, via 
`camel-jbang-plugin-tui` → `tamboui-markdown:0.4.0`.
   
   commonmark 0.21.0 does not contain the 
`org.commonmark.renderer.markdown.MarkdownRenderer` class at all (added later), 
so the TUI markdown help view (tamboui `MarkdownView`) blew up. Fixed by 
pinning `org.commonmark:commonmark` to `0.28.0` in `camel-launcher`'s 
`dependencyManagement` so the core matches the extension modules. 
`openapi-generator` only uses the stable `Parser`/`HtmlRenderer` builder APIs, 
which are unchanged in 0.28.0, so it remains safe. The on-demand 
`camel-jbang-main` path was never affected, as it downloads only the requested 
plugin into its own classloader.
   
   **2. `?` did nothing.**
   
   Only `KeyCode.F1` was bound to help. `?` is now bound to open/toggle help in 
`CamelMonitor` (guarded so it does not trigger while typing in a search/filter 
input), and `HelpOverlay` also closes on `?` so the binding is a true toggle.
   
   Also: documented the `?` shortcut in `camel-jbang-tui.adoc` and added 
`HelpOverlayTest` (close-on-`?`, F1/`q` regression, and that an unrelated key 
keeps the overlay open).
   
   # 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) 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.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes. <!-- Draft: the affected 
camel-jbang modules build and test clean; a full root build is still pending 
before marking ready. -->
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   _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