Symptom

Opening a Project.Diagram node’s view face (ScreenCore.viewExpanded(), the view:<id> path) rendered the diagram collapsed to a thin strip at the bottom of the screen, with the time-range selector squeezed to roughly one character wide (its “Range”/”Minute”/”Hour” labels wrapped one letter per line). The same SVG rendered correctly in the edit face’s Preview box, so the SVG pipeline itself was fine — this was purely a layout bug in the view face.

Root cause

Two independent defects compounded, and an earlier fix attempt addressed neither fully:

  1. ViewScreenToolbar’s internal Spacer(Modifier.weight(1f, true)). A weight child forces its Row to claim the entire incoming max width during Compose’s unweighted-children-first measurement pass — regardless of what modifier the caller applies to the toolbar. DiagramScreen’s header row placed ViewScreenToolbar beside TimeRangeSelector(Modifier.weight(1f)); the toolbar’s internal weight consumed the row before the selector’s own weight had anything left to claim. A first fix attempt added an optional modifier parameter and passed Modifier.wrapContentWidth() from the caller, but wrapContentWidth() only relaxes the minimum width constraint passed to a child — it does not touch the maximum, so the internal weight spacer kept expanding to the unchanged max and the row stayed starved.
  2. fillMaxSize() inside an unbounded-height scroll container. DiagramScreen renders inside NodeEditorContainer’s Settings-tab content column, which is Modifier.fillMaxSize().verticalScroll(...). verticalScroll hands its content an unbounded (Constraints.Infinity) max height so it can scroll past the viewport. Modifier.fillMaxSize()/fillMaxHeight() has no effect once the incoming max is Constraints.Infinity (documented Compose behavior) — so the diagram’s image-hosting Box collapsed to whatever minimal height its own children happened to report.

Fix

Prevention