Repository navigation
feat: chasing gets a tail and a delta, like every other wave - #11
Conversation
"`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.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe dot-matrix ChangesChase envelope and timing
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The chase animation now uses a continuous rise and decay with linear CSS timing. No actionable merge-blocking issue is identified; the change is mergeable subject to normal checks. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The exported animation contract changes, which can affect consumers of custom stepped envelopes. The reviewed change does not expand renderer access or authority, and no introduced security risk was identified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Why
它两样都没有,原因是一行代码。
Cause
chase带着steps: 3,所以level()在整个周期里只返回三个亮度值之一:0.16、0.58、1.00。chase(修复前)comet(对照)环上
spread: 0.34时,同一帧里有多格跨过同一个台阶 —— 所以这个动效几乎处处差值为零,只在台阶处是断崖。这就是"不 smooth"的字面含义。而且这不是审美问题:
envelope.ts顶部自己写着规则 —— "Never quantise brightness into shelves. Shelves are visible as steps and read as cheap."chase是唯一违反它、也是唯一用到steps的 envelope。Change outline
改成"快升 + 六段衰减"的 stop 表:
chase之前chase之后comet(对照)波峰后面那道仍然亮着的拖尾是新增的。
实际渲染(9×9,一行一个时刻,
.到@是亮度):同一帧里能同时读出
+/%/*三层梯度;修复前只有三级硬台阶。Special things to note
stepsmechanism.This changes published engine behaviour —
@botharness/botui-core@0.1.1ships the oldchasing. A revert restores it exactly; the version is not yet bumped, so nothingpublished has changed yet.
stepsmechanism went with it, in all four places: the field onEnvelope, thelevel()branch, thedata-timing="steps-N"switch, and thesteps(3, end)CSS rule.chasewas the only user, so every one of them described a deleted behaviour.steps?: numberwas never in the documented option vocabulary and is not exported, sothis is a source-level cleanup rather than an API change — but anyone constructing a
custom
Envelopewithstepswould need to move tostops. Flagging it rather thanburying it.
levels; one asserts
chasinghas a peak, a visible tail, and no step above 0.05 betweenneighbours. 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 would pass if someone re-added the shelves.
this source, so the site and the installed component change together — but npm is still
on 0.1.1 with the old envelope.
🤖 Generated with Claude Code
Summary by CodeRabbit
Visual Updates
Bug Fixes