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 4bc7533742cf0469919caee42dd7064415c9825a Author: Claus Ibsen <[email protected]> AuthorDate: Wed Jul 8 12:18:33 2026 +0200 CAMEL-23934: Replace hardcoded Color.DARK_GRAY with Theme.muted()/selectionBg() Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../jbang/core/commands/tui/CamelCatalogTui.java | 2 +- .../jbang/core/commands/tui/ConfigurationTab.java | 2 +- .../dsl/jbang/core/commands/tui/DiagramTab.java | 2 +- .../dsl/jbang/core/commands/tui/RoutesTab.java | 2 +- .../dsl/jbang/core/commands/tui/SqlQueryTab.java | 26 +++++++++++----------- .../commands/tui/diagram/RouteDiagramWidget.java | 2 +- .../commands/tui/ConfigurationTabRenderTest.java | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelCatalogTui.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelCatalogTui.java index b20e778539c4..7c2df76c4516 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelCatalogTui.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelCatalogTui.java @@ -540,7 +540,7 @@ public class CamelCatalogTui extends CamelCommand { frame.renderWidget( Block.builder() .borders(Borders.TOP_ONLY) - .borderStyle(Style.EMPTY.fg(Color.DARK_GRAY)) + .borderStyle(Theme.muted()) .build(), area); } diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTab.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTab.java index 404a02f5d0e8..f7deef4be673 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTab.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTab.java @@ -53,7 +53,7 @@ import static org.apache.camel.dsl.jbang.core.commands.tui.TuiHelper.*; class ConfigurationTab extends AbstractTableTab { - private static final Style SECRET_STYLE = Style.EMPTY.fg(Color.DARK_GRAY); + private static final Style SECRET_STYLE = Theme.muted(); private int detailScroll; diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTab.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTab.java index 26729f67f1d6..66a13602d3a4 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTab.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTab.java @@ -582,7 +582,7 @@ class DiagramTab extends AbstractTab { } else if (ln.treeNode != null && ln.treeNode.info.remote) { String arrow = "from".equals(ln.type) ? " external → " : " → external"; lines.add(Line.from( - Span.styled(arrow, Style.EMPTY.fg(Color.DARK_GRAY)))); + Span.styled(arrow, Theme.muted()))); } else { lines.add(Line.from(Span.raw(""))); } diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java index 33198fdfca82..2563be2f2ac0 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java @@ -988,7 +988,7 @@ class RoutesTab extends AbstractTab { } else if (ln.treeNode != null && ln.treeNode.info.remote) { String arrow = "from".equals(ln.type) ? " external → " : " → external"; lines.add(Line.from( - Span.styled(arrow, Style.EMPTY.fg(Color.DARK_GRAY)))); + Span.styled(arrow, Theme.muted()))); } else { lines.add(Line.from(Span.raw(""))); } diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SqlQueryTab.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SqlQueryTab.java index c8d9a56421fa..0792e677601e 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SqlQueryTab.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SqlQueryTab.java @@ -378,7 +378,7 @@ class SqlQueryTab extends AbstractTab { sb.append(" "); } } - Style style = focusOnInput ? Style.EMPTY.fg(Color.CYAN) : Style.EMPTY.fg(Color.DARK_GRAY); + Style style = focusOnInput ? Style.EMPTY.fg(Color.CYAN) : Theme.muted(); Paragraph dsLabel = Paragraph.builder() .text(Text.from(Line.from(Span.styled(sb.toString(), style)))) .build(); @@ -399,7 +399,7 @@ class SqlQueryTab extends AbstractTab { } else { title = " SQL Query (F5 to execute) "; } - Style borderStyle = focusOnInput ? Style.EMPTY.fg(Color.CYAN) : Style.EMPTY.fg(Color.DARK_GRAY); + Style borderStyle = focusOnInput ? Style.EMPTY.fg(Color.CYAN) : Theme.muted(); Block inputBlock = Block.builder() .title(Title.from(title)) .borders(Borders.ALL) @@ -459,7 +459,7 @@ class SqlQueryTab extends AbstractTab { .title(Title.from(" Results ")) .borders(Borders.ALL) .borderType(BorderType.ROUNDED) - .borderStyle(Style.EMPTY.fg(Color.DARK_GRAY)) + .borderStyle(Theme.muted()) .build(); Rect inner = emptyBlock.inner(area); frame.renderWidget(emptyBlock, area); @@ -468,7 +468,7 @@ class SqlQueryTab extends AbstractTab { ? "No DataSource available" : "Type a SQL query and press F5 to execute"; Paragraph hintText = Paragraph.builder() - .text(Text.from(Line.from(Span.styled(hint, Style.EMPTY.fg(Color.DARK_GRAY))))) + .text(Text.from(Line.from(Span.styled(hint, Theme.muted())))) .build(); frame.renderWidget(hintText, inner); return; @@ -477,7 +477,7 @@ class SqlQueryTab extends AbstractTab { // build result table String resultTitle = String.format(" %d row(s)%s %dms ", rowCount, truncated ? " (truncated)" : "", elapsed); - Style tableBorderStyle = !focusOnInput ? Style.EMPTY.fg(Color.CYAN) : Style.EMPTY.fg(Color.DARK_GRAY); + Style tableBorderStyle = !focusOnInput ? Style.EMPTY.fg(Color.CYAN) : Theme.muted(); Block tableBlock = Block.builder() .title(Title.from(resultTitle)) .borders(Borders.ALL) @@ -496,7 +496,7 @@ class SqlQueryTab extends AbstractTab { for (String col : columnNames) { Object val = row.get(col); String s = val != null ? String.valueOf(val) : "null"; - Style style = val == null ? Style.EMPTY.fg(Color.DARK_GRAY) : Style.EMPTY.fg(Theme.baseFg()); + Style style = val == null ? Theme.muted() : Style.EMPTY.fg(Theme.baseFg()); cells.add(Cell.from(Span.styled(s, style))); } dataRows.add(Row.from(cells)); @@ -513,7 +513,7 @@ class SqlQueryTab extends AbstractTab { .rows(dataRows) .widths(colConstraints) .block(tableBlock) - .highlightStyle(Style.EMPTY.bg(Color.DARK_GRAY)) + .highlightStyle(Theme.selectionBg()) .build(); lastTableArea = area; frame.renderStatefulWidget(table, area, tableState); @@ -770,7 +770,7 @@ class SqlQueryTab extends AbstractTab { String label = columnNames[i] + (isPk ? " *" : " "); Style labelStyle; if (isPk) { - labelStyle = Style.EMPTY.fg(Color.DARK_GRAY); + labelStyle = Theme.muted(); } else if (isFocused) { labelStyle = Style.EMPTY.fg(Color.CYAN).bold(); } else { @@ -785,7 +785,7 @@ class SqlQueryTab extends AbstractTab { if (isPk) { String val = editOriginalValues[i]; frame.renderWidget(Paragraph.from(Line.from( - Span.styled(val.isEmpty() ? "null" : val, Style.EMPTY.fg(Color.DARK_GRAY)))), valArea); + Span.styled(val.isEmpty() ? "null" : val, Theme.muted()))), valArea); } else if (isFocused) { boolean changed = !editInputs[i].text().equals(editOriginalValues[i]); Style cursorStyle = changed @@ -810,11 +810,11 @@ class SqlQueryTab extends AbstractTab { Rect footerArea = new Rect(inner.left(), footerY, inner.width(), 1); frame.renderWidget(Paragraph.from(Line.from( Span.styled(" F5", Theme.label().bold()), - Span.styled("=Save ", Style.EMPTY.fg(Color.DARK_GRAY)), + Span.styled("=Save ", Theme.muted()), Span.styled("Esc", Theme.label().bold()), - Span.styled("=Cancel ", Style.EMPTY.fg(Color.DARK_GRAY)), - Span.styled("*", Style.EMPTY.fg(Color.DARK_GRAY)), - Span.styled("=Primary Key", Style.EMPTY.fg(Color.DARK_GRAY)))), footerArea); + Span.styled("=Cancel ", Theme.muted()), + Span.styled("*", Theme.muted()), + Span.styled("=Primary Key", Theme.muted()))), footerArea); } } diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java index de626ac1e5ea..90cb5c4f031c 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java @@ -301,7 +301,7 @@ public class RouteDiagramWidget implements Widget { } else if (external) { edgeStyle = Style.EMPTY.fg(externalColor()); } else if (dashed) { - edgeStyle = Style.EMPTY.fg(Color.DARK_GRAY); + edgeStyle = Theme.muted(); } else { edgeStyle = Style.EMPTY.fg(Color.GRAY); } diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTabRenderTest.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTabRenderTest.java index 4ec59cc7476a..3fb2f8514242 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTabRenderTest.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfigurationTabRenderTest.java @@ -132,8 +132,8 @@ class ConfigurationTabRenderTest { Frame frame = Frame.forTesting(buffer); tab.render(frame, area); - assertTrue(TuiTestHelper.findCellWithColor(buffer, "x", Color.DARK_GRAY), - "Secret value 'xxxxxx' should be rendered in DARK_GRAY"); + assertTrue(TuiTestHelper.findCellWithColor(buffer, "x", Theme.muted().fg().orElse(Color.DARK_GRAY)), + "Secret value 'xxxxxx' should be rendered in muted color"); } // ---- Helper methods ----
