CAMEL-24003: Pass F-keys through AI panel to global TUI handlers#24669
CAMEL-24003: Pass F-keys through AI panel to global TUI handlers#24669davsclaus wants to merge 9 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Looks good -- clean and correct fix for F-key passthrough in the AI panel.
The two commits map cleanly to two logical changes:
-
AiPanel.java -- F-keys (F1-F7, F9-F12) are now explicitly rejected by
handleKeyEvent()via a newisFunctionKey()guard, returningfalseto let the caller dispatch them elsewhere. F8 is correctly excluded since it closes the panel. -
CamelMonitor.java -- The dispatch chain in
handleEvent()is reordered so thatactionsPopupandpopupManagerare checked before the AI panel. The AI panel dispatch changes from unconditionalreturn aiPanel.handleKeyEvent(ke)to conditionalif (aiPanel.handleKeyEvent(ke)) { return true; }, allowing unhandled keys to fall through tohandleGlobalKeysandhandleTabKeys.
The approach is sound: F-keys bubble from AiPanel up through CamelMonitor's dispatch chain to handleGlobalKeys(), which is exactly where F1 (help), F2 (actions), F3 (switch), F6 (shell), and F8 (AI) are handled. Popup windows opened via these keys get priority because their checks now precede the AI panel block.
One minor observation: the isFunctionKey() method would be a good candidate for a small unit test in AiPanelTest.java to guard against regressions if the key handling evolves further -- but that's not blocking.
Scanner coverage: ast-grep (sg) ran on both modified files with no findings. Other scanners (semgrep, gitleaks, PMD, SpotBugs) were not available in this environment. SpotBugs/ErrorProne require compilation -- see CI.
Claude Code review on behalf of @gnodet
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
Thanks for this. I traced the full dispatch chain and the menu structures. The core fix is correct and nicely minimal, but I have a few asks before merge. What I verified holds:
Asks:
Two things to confirm (not blockers):
Claude Code on behalf of @ammachado |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
The F8 AI panel now exclusively uses TUI-specific tools backed by McpFacade instead of the CLI-oriented AskTools. This makes the AI panel fully TUI-aware - when AI cannot do something, it means a tui_* tool is missing, not that we need CLI tools. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Address review feedback: add unit tests for F-key pass-through (including during thinking state), and add a comment explaining why F8 is excluded from isFunctionKey. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
Addressed all review feedback:
Claude Code on behalf of davsclaus |
Emphasize that tui_get_* tools fetch data directly WITHOUT navigating, and that tui_navigate should only be used when the user explicitly wants to change the view. Also list all 16 tools in the prompt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 2 tested, 1 compile-only — current: 2 all testedMaveniverse Scalpel detected 3 affected modules (current approach: 2).
|
…nd TuiMcpServer Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Summary
Claude Code on behalf of davsclaus
Test plan
🤖 Generated with Claude Code