Symptom

Two silent bugs surfaced while building an SVG Project.Diagram dashboard: a bound DataPoint’s value was chopped to a handful of characters with no ellipsis (a corpus count of 26324 rendered as 2632 — a plausible-looking but wrong number), and any <text> element in the source SVG never appeared on screen, even though shapes (<rect>, <line>, fills, strokes) rendered correctly.

Root cause

IconManager’s swarm-canvas badge overlays a DOUBLE DataPoint’s value with meta.snapshot.value.take(4) — a hard truncation with no indication anything was cut. DataPointStateView, the composable a Diagram tile uses to render a bound DataPoint at its anchor rect, routed through that same small fixed-size badge regardless of how much room the author had actually allocated for the anchor in the diagram editor.

Separately, the SVG is decoded via Coil’s KMP SvgDecoder (io.coil-kt.coil3:coil-svg), which draws shape primitives only — it has no text-rendering support at all on this target set, so <text> is dropped during decode, not degraded. The upload flow already warned about this with softened language (“may not render correctly in all environments”) but only ran the check when a file was picked via the Upload button, not when a URL was pasted or reloaded via “Load Preview” — the more common path for a diagram the author uploaded once and now just links to.

Fix

Prevention

Adding rendering-bandwidth constraints (fixed badge sizes, hard character caps) needs an explicit overflow indicator from day one — a truncated value that looks complete is worse than an empty one, because it’s actively misleading. When a composable already has more layout room available from its caller (here, the diagram anchor rect the author sized), route the real value through that room instead of reusing a badge built for a much smaller, unrelated context. No realistic automated check catches the second bug class (a third-party decoder silently no-op’ing on a whole element type) beyond what the extracted svgContainsTextElements() unit test now covers — full prevention would mean either vendoring a decoder with text support or rendering a server-side rasterized preview, both bigger changes than this fix’s scope.