This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch fix/CAMEL-23934 in repository https://gitbox.apache.org/repos/asf/camel.git
commit 94f8f2cda28fce5505e8f3d334efcab7b5991884 Author: Claus Ibsen <[email protected]> AuthorDate: Wed Jul 8 15:09:58 2026 +0200 CAMEL-23934: Add mnemonic CSS token for tab and menu key shortcuts Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../apache/camel/dsl/jbang/core/commands/tui/PopupManager.java | 2 +- .../java/org/apache/camel/dsl/jbang/core/commands/tui/Theme.java | 8 +++++++- .../org/apache/camel/dsl/jbang/core/commands/tui/TuiIcons.java | 2 +- .../src/main/resources/tui/themes/dark.tcss | 1 + .../src/main/resources/tui/themes/light.tcss | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/PopupManager.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/PopupManager.java index 8fd96eab495a..964936940de7 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/PopupManager.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/PopupManager.java @@ -409,7 +409,7 @@ class PopupManager { frame.renderWidget(Clear.INSTANCE, popup); - Style keyStyle = Theme.hintKey(); + Style keyStyle = Theme.mnemonic(); ListItem[] items = morePopupItems(keyStyle); ListWidget list = ListWidget.builder() .items(items) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/Theme.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/Theme.java index 2952d7b3c31c..9d2a2b54b729 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/Theme.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/Theme.java @@ -76,6 +76,7 @@ public final class Theme { private static final Style FALLBACK_LABEL = Style.EMPTY.fg(Color.rgb(0xDC, 0xDC, 0xAA)); private static final Style FALLBACK_CHANGE = Style.EMPTY.fg(Color.rgb(0xDC, 0xDC, 0xAA)); private static final Style FALLBACK_SEARCH_MATCH = Style.EMPTY.fg(Color.BLACK).bg(Color.rgb(0xDC, 0xDC, 0xAA)); + private static final Style FALLBACK_MNEMONIC = Style.EMPTY.fg(Color.rgb(0xDC, 0xDC, 0xAA)).bold().underlined(); // Diagram token fallbacks (dark-theme defaults). private static final Color FALLBACK_DIAGRAM_BORDER = Color.rgb(0x80, 0x80, 0x80); @@ -91,7 +92,7 @@ public final class Theme { "accent", "accent-bg", "hint-key", "border", "border-focused", "title", "success", "warning", "error", "muted", "selection", "info", "notice", "row-alt", "base-bg", "base-fg", - "label", "change", "search-match", + "label", "change", "search-match", "mnemonic", "diagram-border", "diagram-id", "diagram-from", "diagram-to", "diagram-choice", "diagram-action", "diagram-eip", "diagram-default" }; @@ -244,6 +245,11 @@ public final class Theme { return style("search-match", FALLBACK_SEARCH_MATCH); } + /** Keyboard shortcut mnemonic in tab headers and menus (bold + underlined). */ + public static Style mnemonic() { + return style("mnemonic", FALLBACK_MNEMONIC); + } + /** Theme-aware markdown styles for MarkdownView headings and other elements. */ public static dev.tamboui.markdown.MarkdownStyles markdownStyles() { return dev.tamboui.markdown.MarkdownStyles.builder() diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiIcons.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiIcons.java index c719a4221e7e..3a21a76dd939 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiIcons.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiIcons.java @@ -175,7 +175,7 @@ final class TuiIcons { static dev.tamboui.text.Span[] primaryTabHeader(String icon, String key, String name) { return new dev.tamboui.text.Span[] { dev.tamboui.text.Span.raw(icon + " "), - dev.tamboui.text.Span.styled(key, Theme.hintKey()), + dev.tamboui.text.Span.styled(key, Theme.mnemonic()), dev.tamboui.text.Span.raw(" " + name) }; } diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/dark.tcss b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/dark.tcss index e65f71a42793..40717f52861e 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/dark.tcss +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/dark.tcss @@ -41,6 +41,7 @@ $dark-fg: #D4D4D4; #label { color: #DCDCAA; } #change { color: #DCDCAA; } #search-match { color: black; background: #DCDCAA; } +#mnemonic { color: #DCDCAA; text-style: bold underline; } /* Diagram tokens */ #diagram-border { color: #808080; } diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/light.tcss b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/light.tcss index 022c7142e5d0..a6a9a285a348 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/light.tcss +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/themes/light.tcss @@ -41,6 +41,7 @@ $light-fg: #24292E; #label { color: #735C00; } #change { color: #B08800; } #search-match { color: black; background: #FFD33D; } +#mnemonic { color: #735C00; text-style: bold underline; } /* Diagram tokens */ #diagram-border { color: #808080; }
