fix(manifold): preserve slider overrides until input moves

This commit is contained in:
monkey-w1n5t0n 2026-07-25 15:20:11 +02:00
parent 0010097d01
commit 491820ac79
2 changed files with 16 additions and 4 deletions

View file

@ -116,7 +116,7 @@ CompositeStage/SandwichStage. `Manifold.tsx` is the full-bleed 2D input surface
+ feedback markers; pointer → `onMove`; **double-click the input mark → follow-mouse mode**, a window + feedback markers; pointer → `onMove`; **double-click the input mark → follow-mouse mode**, a window
`pointermove` listener mapping the whole viewport onto this surface's space, Esc or a second `pointermove` listener mapping the whole viewport onto this surface's space, Esc or a second
double-click exits). `OutputStage.tsx` is the output columns; click or drag a bar to temporarily double-click exits). `OutputStage.tsx` is the output columns; click or drag a bar to temporarily
audition a clamped value (the next engine tick restores the live MLP), and it takes a `compact` prop audition a clamped value (the next actual input change restores the live MLP), and it takes a `compact` prop
for the narrow pane. for the narrow pane.
- **Output modes** (the TOP dock selector, NOT the same axis as `focus`): `src/console/output-mode.ts` - **Output modes** (the TOP dock selector, NOT the same axis as `focus`): `src/console/output-mode.ts`

View file

@ -647,9 +647,21 @@ export function ConsoleApp() {
}), }),
); );
// A direct slider gesture is only an audition value. The next engine tick // A direct slider gesture is only an audition value. Keep it visible while
// (normally caused by moving the input) returns that param to the live MLP. // the input is stable; the next actual input change returns that param to
// the live MLP.
const lastInputRef = useRef<number[] | null>(null);
useEffect(() => { useEffect(() => {
if (!engine) return;
const nextInput = Array.from(engine.inputVector());
const previousInput = lastInputRef.current;
lastInputRef.current = nextInput;
const inputChanged =
previousInput !== null &&
(previousInput.length !== nextInput.length ||
nextInput.some((value, index) => value !== previousInput[index]));
if (!inputChanged) return;
setParams((ps) => { setParams((ps) => {
let changed = false; let changed = false;
const next = ps.map((p) => { const next = ps.map((p) => {
@ -659,7 +671,7 @@ export function ConsoleApp() {
}); });
return changed ? next : ps; return changed ? next : ps;
}); });
}, [version]); }, [engine, version]);
/** /**
* The single output-card mutation seam. Callers provide the desired active * The single output-card mutation seam. Callers provide the desired active