This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit cec95787dfb06a508c06a49f38d2951e6ee072c4
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jul 27 20:16:41 2026 +0200

    camel-tui: Use Tab key for panel focus switching in Overview tab
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../camel/dsl/jbang/core/commands/tui/OverviewTab.java  |  5 +++--
 .../jbang/core/commands/tui/OverviewTabRenderTest.java  | 17 +++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTab.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTab.java
index 970e4ed5add3..1636ac13334c 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTab.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTab.java
@@ -31,6 +31,7 @@ import dev.tamboui.terminal.Frame;
 import dev.tamboui.text.Line;
 import dev.tamboui.text.Span;
 import dev.tamboui.text.Text;
+import dev.tamboui.tui.event.KeyCode;
 import dev.tamboui.tui.event.KeyEvent;
 import dev.tamboui.tui.event.MouseEvent;
 import dev.tamboui.tui.event.MouseEventKind;
@@ -163,7 +164,7 @@ class OverviewTab extends AbstractTab {
             topMode = !topMode;
             return true;
         }
-        if (ke.isChar('i') && !ctx.infraData.get().isEmpty()) {
+        if (ke.isKey(KeyCode.TAB) && !ctx.infraData.get().isEmpty()) {
             infraFocused = !infraFocused;
             if (infraFocused && infraTableState.selected() == null) {
                 infraTableState.select(0);
@@ -1015,7 +1016,7 @@ class OverviewTab extends AbstractTab {
         }
         hint(spans, TuiIcons.HINT_SCROLL, "navigate");
         if (!ctx.infraData.get().isEmpty()) {
-            hint(spans, "i", infraFocused ? "integrations" : "infra");
+            hint(spans, "Tab", infraFocused ? "integrations" : "infra");
         }
         if (infraFocused) {
             hint(spans, "d", "details");
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTabRenderTest.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTabRenderTest.java
index f0c95a08f6a0..c16b38d1395b 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTabRenderTest.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/OverviewTabRenderTest.java
@@ -26,6 +26,7 @@ import dev.tamboui.layout.Rect;
 import dev.tamboui.style.Color;
 import dev.tamboui.terminal.Frame;
 import dev.tamboui.text.Span;
+import dev.tamboui.tui.event.KeyCode;
 import dev.tamboui.tui.event.KeyEvent;
 import dev.tamboui.tui.event.KeyModifiers;
 import dev.tamboui.tui.event.MouseButton;
@@ -305,11 +306,11 @@ class OverviewTabRenderTest {
 
         assertFalse(tab.infraFocused, "infra panel should not be focused 
initially");
 
-        tab.handleKeyEvent(KeyEvent.ofChar('i', KeyModifiers.NONE));
-        assertTrue(tab.infraFocused, "pressing 'i' should toggle focus to 
infra panel");
+        tab.handleKeyEvent(KeyEvent.ofKey(KeyCode.TAB, KeyModifiers.NONE));
+        assertTrue(tab.infraFocused, "pressing Tab should toggle focus to 
infra panel");
 
-        tab.handleKeyEvent(KeyEvent.ofChar('i', KeyModifiers.NONE));
-        assertFalse(tab.infraFocused, "pressing 'i' again should toggle back 
to integrations");
+        tab.handleKeyEvent(KeyEvent.ofKey(KeyCode.TAB, KeyModifiers.NONE));
+        assertFalse(tab.infraFocused, "pressing Tab again should toggle back 
to integrations");
     }
 
     @Test
@@ -320,8 +321,8 @@ class OverviewTabRenderTest {
         });
 
         assertFalse(tab.infraFocused);
-        tab.handleKeyEvent(KeyEvent.ofChar('i', KeyModifiers.NONE));
-        assertFalse(tab.infraFocused, "pressing 'i' with no infra services 
should have no effect");
+        tab.handleKeyEvent(KeyEvent.ofKey(KeyCode.TAB, KeyModifiers.NONE));
+        assertFalse(tab.infraFocused, "pressing Tab with no infra services 
should have no effect");
     }
 
     @Test
@@ -344,7 +345,7 @@ class OverviewTabRenderTest {
         renderOnce(tab, area);
 
         // Toggle to infra panel
-        tab.handleKeyEvent(KeyEvent.ofChar('i', KeyModifiers.NONE));
+        tab.handleKeyEvent(KeyEvent.ofKey(KeyCode.TAB, KeyModifiers.NONE));
         assertTrue(tab.infraFocused);
 
         // Default infra sort is SERVICE - pressing 's' should cycle to VERSION
@@ -354,7 +355,7 @@ class OverviewTabRenderTest {
                 "After sort cycle in infra panel, indicator should move to 
VERSION");
 
         // Integration sort should remain unchanged on NAME
-        tab.handleKeyEvent(KeyEvent.ofChar('i', KeyModifiers.NONE));
+        tab.handleKeyEvent(KeyEvent.ofKey(KeyCode.TAB, KeyModifiers.NONE));
         assertFalse(tab.infraFocused);
         rendered = TuiTestHelper.renderToString(tab, 160, 30);
         assertTrue(rendered.contains("NAME▼") || rendered.contains("NAME▲"),

Reply via email to