Let the develop column ask how wide it needs to be
Build and test / Desktop (Linux) (push) Successful in 21m53s
Build and test / Layer separation (push) Successful in 28s
Traceability / Requirement traces (push) Successful in 32s
🐳 Android image / Build and push (push) Successful in 3s
Build and test / android-image (push) Successful in 3s
Build and test / Android (aarch64) (push) Failing after 53m45s

The column was 280px, a number chosen for a tablet, with 380px bolted on
later for a desktop. Both were guesses at how much room the widest row
inside needs, and a guess is what cannot work here: the mode strip is one
chip per attribute the *operation set declares*, so the row is generated
and no constant in app.slint can track it.

When the guess came up short the failure was not a tidy clip. The
Flickable inside the column never had its `viewport-width` set, so the
viewport took its content's preferred width, and a viewport wider than
its Flickable is *centred* in it — the same rule the note on the seam's
`x: 0` already records a few lines below. So the column lost half of each
edge rather than one of them: "HISTOGRAM" read "ISTOGRAM", "Straighten"
read "aighten", Copy sat centred while Paste ran off the far side. It
looked like a rendering fault and it was an alignment one.

So the column asks instead of guessing. Every panel that can appear in it
— image, histogram, geometry, settings transfer, masks, repairs, adjust,
history — now publishes a `content-width`: how wide it has to be before
it starts clipping itself, read off its own layout rather than asserted.
Each declares that as its `min-width` too, and that is what makes the
aggregation automatic: `column` is a layout, so it already reports the
largest minimum among its children, and it does so for the panels that
come and go with the mode as well, which live inside `if`s and cannot be
named from outside. Grep `content-width` in ui/dr-ui/ui to see every
panel with a say in the answer. The mode strip is named explicitly only
because it is pinned outside that layout, so nothing else measures it.

There is no floor left. A floor is one more guess and the panels state
their own minimums now. The only thing still above the measurement is
`panel-max-width`, which is not a size but a policy — a column may not
take the window from the photograph it exists to serve — and it comes
from Rust beside `layout-class` because a width read from `root.width`
inside the layout that `root.width` depends on is a binding loop.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 21:23:44 +02:00
co-authored by Claude Opus 5
parent d6380fecc8
commit cafa63ca6f
7 changed files with 202 additions and 18 deletions
+48 -1
View File
@@ -503,6 +503,21 @@ export component GeometryPanel inherits Rectangle {
callback angle-reset();
callback reset();
/// TRACES: FR-UI-2
/// How wide this panel has to be before it starts clipping itself.
///
/// Every panel in the develop column declares one, and the column takes
/// the largest — that is the whole of how the column is sized. It replaced
/// two guessed constants (280px for a tablet, 380px for a desktop) that
/// could not track a panel gaining a control, and did not.
///
/// Published as `min-width` as well as read by name: the first is what
/// makes the enclosing layout aggregate these automatically, including for
/// the panels that come and go with the mode and so cannot be referenced
/// from outside their `if`.
out property <length> content-width: layout.preferred-width;
min-width: root.content-width;
height: layout.preferred-height;
layout := VerticalLayout {
@@ -623,6 +638,15 @@ export component TransferPanel inherits VerticalLayout {
callback copy();
callback paste();
/// TRACES: FR-UI-2
/// How wide this panel has to be before it starts clipping itself — the
/// same question every panel in the develop column answers.
///
/// No `min-width` beside it, unlike the others: this component *is* a
/// layout, so it already reports its own minimum to whatever contains it,
/// and a `min-width` bound to its own preferred size is a binding loop.
out property <length> content-width: self.preferred-width;
padding: Theme.gap;
spacing: Theme.gap-sm;
@@ -723,6 +747,17 @@ export component ModeStrip inherits Rectangle {
callback picked(int);
callback mode-picked(ViewMode);
/// How much width this row actually needs, for the column that pins it.
///
/// Read rather than guessed: the chips are one per mode plus one per group
/// the operation set declares, so the number is generated and no constant
/// in the column could stay in step with it. The Flickable below is still
/// the answer when the column cannot be given that much — it is the floor
/// under a control that must never become unreachable — but it is no longer
/// the *first* answer, which is what made a generated row into a row you
/// had to know to pan.
out property <length> content-width: layout.preferred-width;
background: Theme.surface;
height: root.enabled ? layout.preferred-height : 0px;
visible: root.enabled;
@@ -924,7 +959,19 @@ export component AdjustPanel inherits Rectangle {
/// scrolls as one, so the panel reports the drag and the column obeys it.
out property <bool> slider-dragging: false;
VerticalLayout {
/// TRACES: FR-UI-2
/// How wide this panel has to be before it starts clipping itself. The
/// develop column is the largest of these and nothing else; publishing it
/// as `min-width` too is what makes the enclosing layout aggregate them
/// without this panel having to be referenced by name.
///
/// The sliders are the part that matters. Each is a label, a value and a
/// track, and a track squeezed below the width its handle needs is a
/// control that cannot be set accurately — which is the whole job.
out property <length> content-width: layout.preferred-width;
min-width: root.content-width;
layout := VerticalLayout {
padding: Theme.gap;
spacing: Theme.gap-sm;
alignment: start;