Show the zoom of the music tabs and the EQ as a transition (#377)
The zoom transition of #309 left out the Pattern, Song and Sound tabs
and the Parametric EQ's curve. There a wheel step or Fit still jumped,
whatever "Zoom (ms)" in the general settings said.
- axisTween wraps ViewTween for a single axis. The music tabs zoom
their time across and their rows, tracks or height down apart, so
each keeps one tween per axis and either goes its own way.
- Fit by its button is shown as a transition too, as in the other
tabs. The fit on opening a document still jumps.
- A middle-button pan first lands a transition under way, and saving
a document's view lands it on the step it was heading for.
- The EQ's range is saved on the node at once. While the zoom is on
its way the curve draws a range of its own and writes nothing.
Its dB lines are those of the new range, sliding to their place,
so no line shows a crooked number.
Found on the way, not part of #377:
- CI task 611 for 82e96e6 failed the stream check of e2e 34. The
renderer had grown by 60.1 MB with nothing decoded. The check
summed the RSS of every Chrome renderer, and the test Chrome runs
four of them. It now measures the largest one, the tab's own, and
writes all of them into the check's detail.
Tests:
- view-tween.test.ts: 18 tests, 2 new. They fail when axisTween
writes the wrong offset.
- e2e 34, 64, 65 on melektaus-atx: ALL PASSED, 202 checks, 4 new.
At 1000 ms each zoom is between its two steps a frame after the
wheel and lands on the step a jump reaches.
- Stream check: the tab's renderer grew by 8.6 MB streamed and by
66.9 MB decoded.
- Gate on melektaus-atx: CHECK EXIT 0, 280 files, 4321 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
82e96e680f
commit
23922ee4a2
13 files changed
+323
-40
No files matched your search
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* A wheel step on one axis of a music tab, once as a jump and once as a transition of 1000 ms (#377).
|
||||
* `read` returns `{ scale, moving }` – the zoom of that axis and whether a transition is on its way.
|
||||
* The step is taken back each time with the opposite wheel, so the view ends where it started.
|
||||
*/
|
||||
export async function sampleZoom(t, at, read, dy = -100) {
|
||||
const { evaluate, json, mouse, settle, wheel, waitUntil } = t;
|
||||
const now = () => json(read);
|
||||
await evaluate('__gm.zoomTransition(0)');
|
||||
const start = await now();
|
||||
await wheel(at.x, at.y, dy);
|
||||
const jumped = await now();
|
||||
await wheel(at.x, at.y, -dy);
|
||||
const back = await now();
|
||||
await evaluate('__gm.zoomTransition(1000)');
|
||||
await mouse('mouseMoved', at.x, at.y);
|
||||
await mouse('mouseWheel', at.x, at.y, 'none', { deltaX: 0, deltaY: dy });
|
||||
await settle(2);
|
||||
const midway = await now();
|
||||
await waitUntil(`!(${read}).moving`, { label: 'the zoom transition ended' });
|
||||
const landed = await now();
|
||||
await evaluate('__gm.zoomTransition(0)');
|
||||
await wheel(at.x, at.y, -dy);
|
||||
const between = (v, a, b) => v > Math.min(a, b) && v < Math.max(a, b);
|
||||
const ok =
|
||||
jumped.scale !== start.scale &&
|
||||
Math.abs(back.scale - start.scale) < 1e-9 &&
|
||||
midway.moving === true &&
|
||||
between(midway.scale, start.scale, jumped.scale) &&
|
||||
landed.moving === false &&
|
||||
Math.abs(landed.scale - jumped.scale) < 1e-9;
|
||||
const samples = { start, jumped, back, midway, landed };
|
||||
return { ok, samples, detail: JSON.stringify(samples) };
|
||||
}
|
||||
Reference in new issue
Block a user