Give the develop column room, and the mask a way out of the way

Three faults reported together, and they share a shape: each is something the
panel decided on the photographer's behalf.

**The column was 280px on every screen.** That width was chosen for a tablet,
where the column is a large fraction of the display and every pixel of it is
taken from the photograph. On a desktop window the mode strip alone — two
modes, a separator, "All", and a chip per attribute the operation set declares
— does not fit, so it scrolled sideways. A control you have to pan to reach is
one you do not know is there. 380px when the window is classed expanded, 280px
when it is not; driven off `layout-class` because reading the window width
inside the layout that sets it is a binding loop.

**The overlay could not be hidden.** An earlier "Overlay" button was removed
for a good reason — it *armed* the overlay, so local mode could be entered and
still show nothing. Hiding is the opposite need and was never served: a mask is
judged against the photograph beneath it, and that photograph is exactly what
the overlay covers. `overlay-hidden` is kept separate from `overlay-on` so a
recompute cannot switch the overlay back on under someone who just turned it
off.

**The masks were coarse because the model saw the subject small.** The graph's
input is a fixed 640x640 and every frame is letterboxed into it, so a bird
200px across in a 1600px proxy reaches the model at 80px. `Tiling::Grid` has
been implemented and tested since the segmentation spike and defaulted off,
because it costs one inference per tile — 2.8s for a 3x2 grid against 470ms.
Now offered as "Look closer (slower)", which says what it costs, rather than
spending it on every image or on none.

The tiling choice enters the segmentation signature. A mask stores the
signature its region ids index into, and a tiled run finds different instances
in a different order; sharing a signature would silently reinterpret a layer
built against the coarse pass — a wrong mask rather than a stale one, and
nothing announces it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-23 10:54:35 +02:00
co-authored by Claude Opus 5
parent ec8582032e
commit 7fcb8dc107
4 changed files with 139 additions and 13 deletions
+35 -4
View File
@@ -909,6 +909,16 @@ export component AppWindow inherits Window {
/// opaque map hides the thing being judged.
in property <float> overlay-strength: 0.55;
in property <bool> overlay-on: false;
/// TRACES: FR-DEV-3
/// The photographer's switch for the same overlay, kept separate from
/// `overlay-on` because the two answer different questions: `overlay-on`
/// is "is there a mask to draw", which Rust decides, and this is "do I
/// want to look at it right now", which only they can.
///
/// Folding them into one property would mean the next recompute — any
/// mask edit — silently switched the overlay back on under someone who had
/// just turned it off to check their work against the photograph.
in-out property <bool> overlay-hidden: false;
/// Which part of the source-space overlay the view is showing, in overlay
/// pixels. Without it the overlay stays frame-sized while the photograph
/// moves under it.
@@ -957,7 +967,7 @@ export component AppWindow inherits Window {
/// rather than as one per frame of the gesture.
callback gradient-handle-released();
callback segment-image();
callback segment-image(bool);
/// A click on the photograph, in fractions of the shown image, plus
/// whether it should extend the selection rather than replace it.
callback region-picked(float, float, bool);
@@ -1519,7 +1529,7 @@ in property <bool> panel-visible: true;
// it is a diagnostic and not an edit: it must not reach
// the histogram, an export, or the texture the develop
// pass hands the compositor.
if root.overlay-on && root.total > 0: Image {
if root.overlay-on && !root.overlay-hidden && root.total > 0: Image {
x: parent.shown-x;
y: parent.shown-y;
width: parent.shown-w;
@@ -2106,7 +2116,24 @@ in property <bool> panel-visible: true;
// width, which the layout then influences. Slint flags it, and
// it can panic at runtime.
Rectangle {
width: root.panel-visible ? 280px : 0px;
// TRACES: FR-UI-2
// 280px was chosen for a tablet, where the column is a
// large fraction of the screen and every pixel of it is
// taken from the photograph. On a desktop window it is
// simply too narrow: the mode strip alone is two modes,
// a separator, "All", and one chip per attribute the
// operation set declares, which is more words than 280px
// holds — so it scrolled sideways, and a control you have
// to pan to reach is one you do not know is there.
//
// Driven off `layout-class` rather than `root.width`
// because reading the window width inside the layout that
// sets it is the binding loop the comment on `expanded`
// above describes. Rust already classifies the window; this
// just spends the extra width where there is some.
width: root.panel-visible
? (root.layout-class == "expanded" ? 380px : 280px)
: 0px;
visible: root.panel-visible;
background: Theme.surface;
clip: true;
@@ -2255,8 +2282,12 @@ in property <bool> panel-visible: true;
subjects: root.subject-rows;
segmented: root.segmented;
segmenting: root.segmenting;
// Two-way: the panel is where it is toggled and
// the canvas is what obeys it, so neither owns
// the value alone.
overlay-hidden <=> root.overlay-hidden;
segment => { root.segment-image(); }
segment(fine) => { root.segment-image(fine); }
mask-selected(id) => { root.mask-selected(id); }
mask-removed(id) => { root.mask-removed(id); }
mask-toggled(id, on) => { root.mask-toggled(id, on); }
+44 -2
View File
@@ -243,8 +243,14 @@ export component MaskPanel inherits Rectangle {
/// One is being computed now.
in property <bool> segmenting: false;
/// Whether the photographer has hidden the overlay to see the photograph.
/// Two-way bound to the window's own, so the canvas and this control never
/// disagree about it.
in-out property <bool> overlay-hidden: false;
callback segment();
/// `true` asks for the slower, tiled pass.
callback segment(bool);
callback mask-selected(string);
callback mask-removed(string);
@@ -299,7 +305,7 @@ export component MaskPanel inherits Rectangle {
text: root.segmenting ? "Looking…" : "Find subjects";
enabled: !root.segmenting;
primary: true;
clicked => { root.segment(); }
clicked => { root.segment(false); }
}
// No "Overlay" button and no "Select" button. Both switched on things
@@ -312,6 +318,42 @@ export component MaskPanel inherits Rectangle {
wrap: word-wrap;
}
// Hiding the overlay is not the "Overlay" button this panel used to
// have, and the distinction is the reason it is back. That one *armed*
// the overlay: local mode could be entered and still show nothing,
// which is the fault the comment below records. This one only takes an
// overlay that is already there out of the way for a moment, which is
// the one thing a photographer needs constantly and had no way to do —
// a mask is judged against the photograph under it, and you cannot see
// that photograph through the thing describing it.
//
// Reads as its own action rather than its state: "Show the mask" is
// what pressing it will do, not what is currently true.
if root.enabled && root.segmented: Button {
text: root.overlay-hidden ? "Show the mask" : "Hide the mask";
clicked => { root.overlay-hidden = !root.overlay-hidden; }
}
// The second pass, offered rather than taken automatically.
//
// The model's input is a fixed 640x640 square and every frame is
// letterboxed into it, so a subject that is small in the frame reaches
// the model small — a bird at 200px in a 1600px proxy arrives at 80px,
// and an outline traced at 80px is what a coarse mask is. Tiling runs
// the model over overlapping windows instead, so that bird arrives at
// its own size.
//
// It costs one inference per tile: about 2.8s for a 3x2 grid against
// 470ms for the whole frame. That is the wrong trade for the usual
// photograph, where the subject fills much of the frame and the first
// pass is already the best answer available — so it is a button and
// not a default, and it says what it costs.
if root.enabled && root.segmented: Button {
text: root.segmenting ? "Looking closer…" : "Look closer (slower)";
enabled: !root.segmenting;
clicked => { root.segment(true); }
}
// Granularity, labelled by what it does rather than by its number:
// "detail" is what a photographer is choosing between, where "300
// regions" is an implementation detail they would have to learn.