From 42b582af05441210ecc76bd5bb9a54131ea39777 Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Wed, 30 Sep 2026 22:45:08 +0900 Subject: [PATCH] feat: chasing gets a tail and a delta, like every other wave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "`chasing` is not smooth, it should have the trailing and the delta like the others." It had neither, and the cause was one line. `chase` carried `steps: 3`, so `level()` returned one of exactly three brightness values across the whole cycle: 0.16, 0.58, 1.00. Measured against `comet`: chase 3 distinct brightness levels across a cycle comet 78 With `spread: 0.34` around a ring, several cells crossed the same shelf in the same frame, so the motion had a delta of zero almost everywhere and a cliff where it was not — which is what "not smooth" is. And it was not a matter of taste: the envelope file's own rule, written at the top, is "never quantise brightness into shelves. Shelves are visible as steps and read as cheap." `chase` was the one envelope that broke it, and the only preset using it. It is now a stop table with a fast rise and a six-stop decay: chase 173 levels (was 3) comet 155 largest step between neighbouring samples 0.03 (was ~0.42) The trailing lit tail behind the crest is new, and `chasing` now reads like the comet it always looked like it should be. The `steps` mechanism went with it, in all four places it existed: the field on `Envelope`, the `level()` branch that read it, the `data-timing="steps-N"` switch in `field.ts`, and the `steps(3, end)` rule in the stylesheet. `chase` was the only user, so every one of them was a description of a deleted behaviour — dead code of exactly the kind this repo's rules call out. Every envelope is one shape again: a stop table, or a gaussian. `steps?: number` was never in the documented option vocabulary and is not exported, so this is a source-level cleanup rather than an API change; anyone who constructed a custom `Envelope` with `steps` would need to move to `stops`. Two tests replaced two: one asserting no envelope is quantised and every one has at least 24 levels, one asserting `chasing` has a peak, a visible tail and no step above 0.05 between neighbours. The pair that described the deleted mechanism — "a stepped envelope spans rest…peak" and "flips to stepped timing when the envelope is quantised" — are gone rather than rewritten, because a test for a mechanism that no longer exists is a test that will pass if someone re-adds the shelves. --- CHANGELOG.md | 3 + CHANGELOG.zh.md | 3 + packages/core/src/dot-matrix/css.ts | 3 - packages/core/src/dot-matrix/envelope.ts | 31 ++++++--- packages/core/src/dot-matrix/field.ts | 2 +- packages/core/src/types.ts | 1 - packages/core/test/dom.test.ts | 19 ++++-- packages/core/test/dot-matrix.test.ts | 83 ++++++++++++++++++++---- 8 files changed, 112 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d64b975..741c4f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,9 @@ All notable changes to BotUI are recorded here. The format follows ### Fixed +- **`chasing` had no gradient — it was three shelves, not a wave.** `chase` carried `steps: 3`, so the whole motion had exactly three brightness values (0.16, 0.58, 1.00) and every cell crossing a shelf jumped. Measured across a cycle, `chase` had **3** distinct brightness levels where `comet` had **78**. With `spread: 0.34` around a ring, several cells crossed a shelf in the same frame, which is what read as unsmooth. It is now a stop table with a fast rise and a six-stop decay: **173** levels, and the largest step between neighbouring samples fell from ~0.42 to **0.03**. The trailing lit tail behind the crest is new, and `chasing` now reads like the comet it always looked like it should be. +- The `steps` mechanism is gone with it: the `steps?: number` field on `Envelope`, the `level()` branch that read it, the `data-timing="steps-N"` switch in `field.ts`, and the `steps(3, end)` rule in the stylesheet. `chase` was the only envelope that used it, so all four were a description of a deleted behaviour — the exact kind of dead code this repo's own rules call out. Every envelope is one shape again: a stop table or a gaussian. + - **Some motion cards could not be clicked, and one of them crashed the page.** Three separate causes, all invisible to `element.click()` and all found by dispatching real mouse coordinates through CDP: - The live preview bound `onPointerEnter` on a div **inside the card's `