Note wrapping labels and heightFor in Architecture

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adminandClaude Opus 5.5 committed 2026-10-06 19:54:52 +02:00
1 parent f7a9a80f35
commit c9db970376
1 file changed
+6 -1
+6 -1
@@ -87,7 +87,12 @@
into the label. A `Dialog` (a question with buttons) takes Escape as its plain button, the one
neither primary nor danger: Escape and Cancel lead back to the same place.
Every label that can be wider than its control is cut with an ellipsis (`truncate` in
`Label.ts`, shared by `Label`, `ListRow` and `Button`). A `Button` keeps the full text and
`Label.ts`, shared by `Label`, `ListRow` and `Button`). Prose is the exception: a `Label` with
`wrap` breaks into lines at the width it gets, so a node's description and every inspector
note (`addNote`) show in full. Its height depends on that width, which `measure()` cannot
know. `Widget.heightFor(width)` answers it instead: `VStack` and `SectionStack` lay a column
out with it, and `ScrollContainer` asks once more at the narrower width when its scrollbar
shows. Every other widget answers with `measure().h`. A `Button` keeps the full text and
measures from it — only what is drawn is shortened — and a subclass that puts something else
inside the control takes its room off `labelSlot()`, so a long value is cut rather than run
underneath the chevron. Given a `width`, a button is exactly that wide and truncates instead: