ammachado commented on code in PR #24064:
URL: https://github.com/apache/camel/pull/24064#discussion_r3436042990


##########
pom.xml:
##########
@@ -426,6 +426,7 @@
                             <kts>SLASHSTAR_STYLE</kts>
                             <ldif>LDIF_STYLE</ldif>
                             <libsonnet>SLASHSTAR_STYLE</libsonnet>
+                            <mjs>SLASHSTAR_STYLE</mjs>

Review Comment:
   Good catch. The entry was added speculatively but no `.mjs` files exist in 
this PR. Removed in 03fccd411220.
   
   _Claude Code on behalf of Adriano Machado_



##########
components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramHelper.java:
##########
@@ -120,6 +120,50 @@ public static List<RouteInfo> parseRoutes(JsonObject jo) {
         return routes;
     }
 
+    static List<String> wrapText(String text, int maxWidth) {
+        if (maxWidth <= 0 || text.length() <= maxWidth) {
+            return List.of(text);
+        }
+
+        List<String> lines = new ArrayList<>();
+        String remaining = text;
+
+        while (!remaining.isEmpty() && lines.size() < MAX_WRAP_LINES) {
+            if (remaining.length() <= maxWidth) {
+                lines.add(remaining);
+                remaining = "";
+                break;
+            }
+
+            int breakAt = -1;
+            for (int i = 0; i < maxWidth && i < remaining.length(); i++) {
+                char c = remaining.charAt(i);
+                if (c == ' ' || c == ':' || c == '/' || c == '.' || c == ',' 
|| c == '&' || c == '?') {
+                    breakAt = i + 1;
+                }
+            }
+            if (breakAt <= 0) {
+                breakAt = maxWidth;
+            }
+
+            lines.add(remaining.substring(0, breakAt).stripTrailing());
+            remaining = remaining.substring(breakAt).stripLeading();
+        }

Review Comment:
   Confirmed intentional. The `RouteDiagramAsciiRenderer` version was chosen as 
the canonical implementation precisely because it handles the short-remainder 
edge case better. The old `TopologyAsciiRenderer` behavior (always truncate 
with `...`) was the deficiency being fixed.
   
   _Claude Code on behalf of Adriano Machado_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to