N8 — Develop callbacks onto a global, so a panel can be declared twice #52

Closed
opened 2026-09-06 08:11:11 +00:00 by dtourolle · 2 comments
Owner

Every develop panel forwards its callbacks and takes its inputs through the window root by hand, and each instantiation in app.slint is twenty to forty lines. N9 declares each panel a second time, and copying that wiring is the kind of duplication that drifts.

Panels

AdjustPanel, MaskPanel, SpotPanel, ComposePanel, TransferPanel, FocusPanel, HistogramPanel, InfoPanel. MaskPanel alone forwards about twenty callbacks.

Deliverable

  • A Slint global (or one per panel family, if a single one reads badly) carrying the develop callbacks and the inputs the panels bind to. Readout in adjust.slint is the precedent.
  • A panel calls the global directly; Rust hooks the global (window.global::<…>().on_…) instead of the window.
  • The existing instantiation in the column shrinks to the properties that genuinely differ by placement, which should be none.
  • Count the tests in ui/dr-ui/src that drive these callbacks through the window before starting; they move to the global and they size the ticket.

Acceptance

  • No develop panel's instantiation in app.slint forwards a callback by hand
  • Every existing test passes (--test-threads=1; the parallel segfault is pre-existing)
  • A second instantiation of any of the panels is under five lines

Spec: docs/ui-navigation.md N8. Plumbing only; no visible change.

**Every develop panel forwards its callbacks and takes its inputs through the window root by hand, and each instantiation in `app.slint` is twenty to forty lines.** N9 declares each panel a second time, and copying that wiring is the kind of duplication that drifts. ## Panels `AdjustPanel`, `MaskPanel`, `SpotPanel`, `ComposePanel`, `TransferPanel`, `FocusPanel`, `HistogramPanel`, `InfoPanel`. `MaskPanel` alone forwards about twenty callbacks. ## Deliverable - A Slint global (or one per panel family, if a single one reads badly) carrying the develop callbacks and the inputs the panels bind to. `Readout` in `adjust.slint` is the precedent. - A panel calls the global directly; Rust hooks the global (`window.global::<…>().on_…`) instead of the window. - The existing instantiation in the column shrinks to the properties that genuinely differ by placement, which should be none. - Count the tests in `ui/dr-ui/src` that drive these callbacks through the window before starting; they move to the global and they size the ticket. ## Acceptance - [ ] No develop panel's instantiation in `app.slint` forwards a callback by hand - [ ] Every existing test passes (`--test-threads=1`; the parallel segfault is pre-existing) - [ ] A second instantiation of any of the panels is under five lines Spec: `docs/ui-navigation.md` N8. Plumbing only; no visible change.
dtourolle added the uisize:M labels 2026-09-06 08:11:11 +00:00
dtourolle added a new dependency 2026-09-06 08:11:28 +00:00
Author
Owner

Implemented on branch dev/develop-globals (commit fea5b1b), merged into integrate/portrait-dock. One global per panel family (Develop, Capture, Levels, Peaking, Adjustments, Framing, Transfer, Masking, Repair, Steps); every develop panel in the column is now Name { }. Build, clippy and 639 tests pass on the merged branch; screenshots identical to before the change.

Implemented on branch `dev/develop-globals` (commit fea5b1b), merged into `integrate/portrait-dock`. One global per panel family (Develop, Capture, Levels, Peaking, Adjustments, Framing, Transfer, Masking, Repair, Steps); every develop panel in the column is now `Name { }`. Build, clippy and 639 tests pass on the merged branch; screenshots identical to before the change.
Author
Owner

Landed in 0a5eab0. Each panel family has a Slint global, Rust hooks the global rather than the window, and every panel's instantiation in the develop column is its name and a pair of braces. session.slint carries the two facts every family needed.

Landed in 0a5eab0. Each panel family has a Slint global, Rust hooks the global rather than the window, and every panel's instantiation in the develop column is its name and a pair of braces. session.slint carries the two facts every family needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Blocks
Reference: dtourolle/DarkRoom#52