Skip to content

Commit c288d54

Browse files
ammachadoclaude
andcommitted
CAMEL-23720: Centralize remaining TUI glyphs through TuiIcons
Migrate raw emoji literals that lived in popup/browser classes to the TuiIcons registry, completing the single-source-of-truth goal: - ExampleBrowserPopup: bundled/online/Docker/infra/Citrus icons and legend - InfraBrowserPopup: infra service row prefix - FolderBrowser: directory icon - DoctorPopup: MCP connection check now uses TuiIcons.MCP instead of reusing TuiIcons.OTEL (which stays for OTel Spans) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9514e9a commit c288d54

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DoctorPopup.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,13 @@ private void checkMcpConnection(List<Line> result) {
310310
String client = mcpConnectedClient != null ? mcpConnectedClient.get() : null;
311311
if (client != null) {
312312
result.add(Line.from(
313-
Span.raw(TuiIcons.indent(TuiIcons.OTEL)),
313+
Span.raw(TuiIcons.indent(TuiIcons.MCP)),
314314
Span.styled(String.format("%-14s", "MCP"), Style.EMPTY.bold()),
315315
Span.raw(String.format("%-30s", client + " (port " + mcpPort + ")")),
316316
Span.raw(" " + TuiIcons.OK)));
317317
} else {
318318
result.add(Line.from(
319-
Span.raw(TuiIcons.indent(TuiIcons.OTEL)),
319+
Span.raw(TuiIcons.indent(TuiIcons.MCP)),
320320
Span.styled(String.format("%-14s", "MCP"), Style.EMPTY.bold()),
321321
Span.raw(String.format("%-30s", "Listening on port " + mcpPort)),
322322
Span.raw(" " + TuiIcons.WARN)));
@@ -325,7 +325,7 @@ private void checkMcpConnection(List<Line> result) {
325325
}
326326
} else {
327327
result.add(Line.from(
328-
Span.raw(TuiIcons.indent(TuiIcons.OTEL)),
328+
Span.raw(TuiIcons.indent(TuiIcons.MCP)),
329329
Span.styled(String.format("%-14s", "MCP"), Style.EMPTY.bold()),
330330
Span.raw(String.format("%-30s", "Not enabled")),
331331
Span.raw(" " + TuiIcons.WARN)));

dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ExampleBrowserPopup.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ private List<ListItem> buildListItems(int width) {
404404
boolean citrus = ExampleHelper.hasCitrusTests(ex);
405405
boolean infra = !ExampleHelper.getInfraServices(ex).isEmpty();
406406

407-
String icons = (bundled ? "📦" : "🌐") + (docker ? "🐳" : " ")
408-
+ (infra ? "🔧" : " ") + (citrus ? "🍋" : " ");
407+
String icons = (bundled ? TuiIcons.BUNDLED : TuiIcons.ONLINE) + (docker ? TuiIcons.DOCKER : " ")
408+
+ (infra ? TuiIcons.INFRA : " ") + (citrus ? TuiIcons.CITRUS : " ");
409409
int nameCol = Math.min(30, width / 3);
410410
String padded = String.format("%-" + nameCol + "s", TuiHelper.truncate(name, nameCol));
411411
String prefix = " " + icons + " " + padded + " ";
@@ -426,7 +426,9 @@ private List<ListItem> buildListItems(int width) {
426426
}
427427
}
428428
items.add(ListItem.from(""));
429-
items.add(ListItem.from(" 📦 = bundled 🌐 = online 🐳 = Docker 🔧 = infra services 🍋 = Citrus tests")
429+
items.add(ListItem.from(" " + TuiIcons.BUNDLED + " = bundled " + TuiIcons.ONLINE + " = online "
430+
+ TuiIcons.DOCKER + " = Docker " + TuiIcons.INFRA + " = infra services " + TuiIcons.CITRUS
431+
+ " = Citrus tests")
430432
.style(Style.EMPTY.dim()));
431433
return items;
432434
}

dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/FolderBrowser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private boolean loadDirectory(Path dir, String selectName) {
106106
.forEach(p -> {
107107
String name = p.getFileName().toString();
108108
if (Files.isDirectory(p)) {
109-
dirs.add(new DirEntry("📁", name, p.toString(), true));
109+
dirs.add(new DirEntry(TuiIcons.FOLDER, name, p.toString(), true));
110110
} else {
111111
files.add(new DirEntry(TuiHelper.fileEmoji(p), name, p.toString(), false));
112112
}
@@ -120,7 +120,7 @@ private boolean loadDirectory(Path dir, String selectName) {
120120
List<DirEntry> found = new ArrayList<>();
121121
Path parent = dir.getParent();
122122
if (parent != null) {
123-
found.add(new DirEntry("📁", "..", parent.toString(), true));
123+
found.add(new DirEntry(TuiIcons.FOLDER, "..", parent.toString(), true));
124124
}
125125
found.addAll(dirs);
126126
found.addAll(files);

dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/InfraBrowserPopup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private void renderBrowser(Frame frame, Rect area) {
288288
List<ListItem> items = new ArrayList<>();
289289
for (InfraServiceEntry entry : catalog) {
290290
String padded = String.format("%-" + nameCol + "s", TuiHelper.truncate(entry.alias(), nameCol));
291-
String prefix = " 🔧 " + padded + " ";
291+
String prefix = TuiIcons.indent(TuiIcons.INFRA) + padded + " ";
292292
if (entry.running()) {
293293
items.add(ListItem.from(prefix + "(running)").style(Style.EMPTY.dim()));
294294
} else {

0 commit comments

Comments
 (0)