Device editors: redraw knobs, switches, faders and drawings on every edit (0.35.1)
The controls were skipped on a revision bump because their arguments compared equal by identity; they now take the revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2d285592e2
commit
1eafe20410
@@ -349,6 +349,14 @@ table). `DeviceLayoutsTest` checks that every parameter of every laid-out device
|
||||
is on exactly one card and that knob labels stay short. A device missing from
|
||||
`DeviceLayouts` falls back to one card with all its parameters.
|
||||
|
||||
**Recomposition pitfall (fixed in 0.35.1).** Slot params live in a plain map that
|
||||
Compose can't observe; edits bump `vm.revision` instead. Because the compiler's
|
||||
strong skipping compares `vm`/`slot` by identity, a child composable that receives
|
||||
only those is *skipped* on a revision bump and shows stale values, and a `Canvas`
|
||||
lambda that captures only them is memoized and never redraws. So every control in
|
||||
Panels.kt (`SpecKnob`, `Segmented`, `FaderBank`, `VizCanvas`) takes `rev: Int`,
|
||||
and `VizCanvas` reads `rev` inside its draw lambda. Do the same in any new control.
|
||||
|
||||
### 5.4.1 Opening a device's settings from another tab
|
||||
|
||||
The Toolbox owns its editor state (`editing` in `ToolboxScreen`). Other screens ask
|
||||
|
||||
Reference in New Issue
Block a user