From 1ad5c2aff5624d2a27bca3fc984ee8f717d58882 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:44:35 +0000 Subject: [PATCH] feat: Truncate long container names This change truncates long container and system names to 14 characters with an ellipsis to prevent them from overlapping with other elements in the diagram. A `truncateName` function has been added to `src/ViewEditor/DrawContainer.elm` and is used to shorten the names before they are rendered. --- src/ViewEditor/DrawContainer.elm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ViewEditor/DrawContainer.elm b/src/ViewEditor/DrawContainer.elm index 044439f..d5ef8dd 100644 --- a/src/ViewEditor/DrawContainer.elm +++ b/src/ViewEditor/DrawContainer.elm @@ -203,7 +203,7 @@ renderContainerInternal selected highlighted { key, name, description, xy, wh } ] ++ events ) - [ text name ] + [ text (truncateName name) ] ] ] ] @@ -248,7 +248,7 @@ renderContainerInternal selected highlighted { key, name, description, xy, wh } , style "font-size" "14px" , style "background-color" (if highlighted then "yellow" else "white") ] - [ text name ] + [ text (truncateName name) ] ] , title [] [ text tooltip ] ] @@ -263,3 +263,12 @@ containerWidth = containerHeight : Float containerHeight = 50 + + +truncateName : String -> String +truncateName name = + if String.length name > 14 then + String.slice 0 14 name ++ "..." + + else + name