The last unbuilt piece of the rack design. A compressor has seven
controls and an author wants one — but unlike a filter or a delay, no
single one of them can be its face: threshold means nothing without ratio,
ratio means nothing without make-up gain. So the knob is derived, exactly
as `carveProfile` already turns one number into six for the carve.
`EFFECT_COPY[id].primary === "strength"` was already the copy layer saying
"this module wants this treatment", and a test now asserts the profile set
matches that list exactly — a missing profile leaves a module opening on
all seven controls, and an extra one is a knob nobody asked for.
**Continuous, not the three-point tables the design proposed.** A table
makes gentle/middle/strong three settings to pick between, and the thing
being modelled is one axis — which the carve's knob has already proved
reads. The proposal's figures survive as anchors where they held up.
## Three of the five figures were wrong, and rendering is what showed it
Full numbers and method in `~/audio-fx-profiles-ab/README.md`.
- **Compressor make-up was too small and not linear.** 1/3/7 dB left the
track 2.5 dB QUIETER at full evenness — an evenness knob that turns the
track down as it goes up. Gain reduction accelerates as threshold and
ratio move together, so linear was wrong too; solved as s² × 9.5. Spread
now falls 19.1 → 8.8 dB with the level unmoved.
- **Saturation's trim went the wrong way.** A soft clipper at −18 dB IS a
limiter at −18 dB: the proposed −3 dB trim took the peak from 0.496 to
0.089 and nearly halved RMS, so "Warmth" mostly meant "much quieter".
Reversed to s² × 2.8 up; RMS now holds within 0.4% while the peak comes
down, which is the signature of saturation rather than attenuation.
- **The gate did essentially nothing.** The design derived threshold and
range only; left at the effect's 100 ms default release it moved the
gaps 0.1 dB against a range asking for 30. Swept, release dominates
everything else — 0.2 dB at 140 ms, 13.4 dB at 10 ms — so it joins the
profile. Gaps now fall 29.6 dB with speech unmoved to a tenth of a dB.
Reverb and bitcrush measured correctly as proposed and are unchanged.
The first measurement reported the gate as working when it was doing
nothing at all: a speaking-window measure excludes exactly the windows a
gate acts on. Gaps are measured separately for that reason.
## In the panel
The derived knob renders through the ordinary `FxParamRow`, not through
`FxNodeParams` — it has no AudioParam behind it and nothing to automate.
What automation there is belongs to the parameters it sets, under Details,
where they can be aimed at individually.
It writes mechanism, never the knob: the chain stores what renders, and
`audioFxProfileStrength` reads the knob back by inverting the curve — the
same contract `normalizeCarveSettings` has. A profile merges over what is
there, so a compressor's knee and a saturation's curve type survive the
knob moving.
Falsified: a derived parameter that turns around mid-sweep, one that runs
past its range, a profile that replaces rather than merges, and a panel
that writes the knob instead of the mechanism each fail a test.
core 1762 (113 files) · studio 3695 + 18 todo.
The last of the schematic direction, translated to a one-column panel
rather than the wide diagram the review page draws.
**Both ends named.** IN — this track, OUT — to mix. Two lines, and they
change what the rack is: without them the order reads as a list, and a
list is the one reading that makes "move up" look cosmetic. It is the
most consequential control in the panel — chain order is audible.
**Every step numbered**, counted over what the rack SHOWS rather than
over the chain. The carve's filters and an EQ's bands live inside their
own modules, so counting raw nodes would leave the visible rack jumping
from 02 to 07, and the numbers would read as a bug rather than a
position.
**A preset draws as one thing.** Applying one used to drop five loose
rows in with nothing saying they arrived together — the same failure the
carve module exists to fix, one level down. Consecutive nodes only: a
preset pulled apart by a reorder is no longer a unit, and a bracket
around the gap would claim an adjacency the signal path does not have.
Falsified: numbering by chain index fails the path test, and grouping a
preset's nodes regardless of adjacency fails the run test.
studio 3695 passing, 18 todo.
A rack of eight modules is eight lines of text, and reading it top to
bottom should not mean reading eight names. Each family letters
differently, so an author knows what KIND of module they are looking at
with the label out of focus and the word only confirms it.
Two faces of type, as budgeted in `plans/audio-fx-ux/README.md`. The sans
carries four families apart by weight, case and tracking — filters light
and widely tracked like a measuring instrument, dynamics heavy and tight
because it grips the signal, time thin and very wide because it is
atmosphere rather than control. The serif is spent on the single family
that behaves differently from all of them: non-linear is the only one
that generates signal rather than measuring or shaping what is there, and
it should not look like the others.
`smart` is the fifth and is not a registry group — the carve, the Tone EQ
and the leveller, which measure the audio and write their own settings.
Monospace, because what they show IS a readout: numbers something else
decided.
Alongside it a tint step per module WITHIN its family, derived from
position in the registry rather than assigned by hand, so two filters
read as two different modules without reading as two different families
and adding an effect upstream never re-colours its siblings. It sits on
the card's left edge rather than on the text: the name already carries
the family in its lettering, and colouring it too would fight the panel's
own tokens for automated and bypassed. Kept to 62–76% lightness at low
saturation for the same reason.
Falsified: flattening the tint step fails one test, and lettering
non-linear like dynamics fails the other.
studio 3692 passing, 18 todo.
`BANDS` has named the ranges since the copy layer landed — rumble,
weight, mud, middle, presence, edge, air — and nothing showed them. The
rack spoke entirely in Hz, which mean nothing to somebody who has not
been taught them, and the words that would teach them sat unread in core.
Every spectral module now shows where it acts on one ruler. Two things at
once, deliberately: the bar says where this module works relative to
everything else, and the caption names the range and what lives there.
A bar alone is decoration; a caption alone does not teach the shape.
Log-spaced, because hearing is. Rumble is 20–80 Hz — three tenths of one
percent of the range linearly and about a fifth of it by ear — so laid
out linearly the bottom six bands collapse into a sliver and the ruler
teaches nothing. A test asserts the bottom segment is over a tenth of the
bar, which a linear layout fails.
Segments outside what the module can reach are dimmed rather than hidden:
a filter that only works in the bottom three bands should not look like
it could move anywhere, and it should still be legible against the whole
range.
`audioBandAt` clamps past both ends rather than returning nothing — 15 Hz
is still rumble to anybody who can hear it, and the alternative is a
filter parked at the edge of its range having no name at all. Boundaries
belong to the band they open, or a filter at exactly 250 Hz reads as
Weight while the ruler beside it highlights Mud.
Nothing under an effect with no range to place: there is nothing spectral
about a limiter, and a bar under one would be a decoration claiming to be
information.
core 1754 passing (112 files), studio 3690 passing / 18 todo.
Rule 1 of `plans/audio-fx-ux/README.md`. A module opens on its name, a
line saying what it is for, and the single control that carries it; every
other parameter is behind a Details disclosure. Nothing is hidden — it is
ordered. `EFFECT_COPY.primary` names that control and `primaryEnds` says
what its two ends sound like, which is the question an author actually
has: a number tells them where the knob is, not which way to move it.
The DSP name moves onto the disclosure itself, so it is read at the
moment the author asks what this really is and never before.
Ten of the fifteen effects get this. The other five — compressor, gate,
saturate, reverb, bitcrush — name their primary as "strength", meaning
they want a single DERIVED control over several parameters, which is
`PROFILES`, whose figures are proposed rather than measured and which has
not shipped. They open on all their controls until it does. That is the
honest state: inventing one knob for them now would be a knob that lies
about what it sets. The lookup needs no special case for it either —
"strength" names no parameter today, and the day it does name one, this
starts using it without being told.
Worth naming: `peaking`'s primary is "how much", and that only became
coherent in the commit before this one. Boosting an unspecified frequency
means nothing, so one knob was a lie while the module was generic; now
that picking the job is what picks the range, it is the whole truth.
The disclosure is local state, keyed by node like the row itself, so it
stays with its effect across a reorder — and an effect arriving in the
open slot arrives closed, like any other.
Tests that address a non-primary knob now open Details first, which is
also the gesture a user makes. Falsified: expanding Details unconditionally
fails the two-faces test, and dropping the "is it a real parameter" guard
fails three.
studio 3688 passing, 18 todo.
"Shape One Range" has three controls and no honest way to nominate one of
them as the knob that matters. The copy nominated *how much*, which is
incoherent: boosting an unspecified frequency means nothing. The range is
the first decision, not the second — `plans/audio-fx-ux/README.md`
§"The hole in the single-knob rule", where B is named as the answer.
So the add menu offers the decision instead of the machine. Five jobs —
Tame Boominess, Reduce Mud, Reduce Boxiness, Add Clarity, Soften
Harshness — each a peaking filter with its frequency already chosen, low
to high, which is the order an author hears them in. Picking the module
is picking the range, so one knob is honest rather than a simplification
hiding the real choice. `peaking` is no longer offered as itself: two
doors to the same effect, one of them the incoherent one, is worse than
either alone.
Every job is one the preset catalogue already ships, at the settings it
ships it with — a test asserts that. The list names the vocabulary the
presets were written in rather than inventing a second one beside it, and
a job nobody's preset does would be a guess about what authors want.
It needs no new node field. `label` already names a node for the work it
does, so a job node and a preset node are indistinguishable afterwards —
which is right, because they are the same idea. It also dissolves the
duplicate-name problem at the root rather than papering it: Clean Voice
reads Remove Rumble · Reduce Mud · Even Out Loudness · Add Clarity · Peak
Ceiling, and nothing repeats.
Underneath it is an ordinary peaking node. Details opens on the same
three controls it always had, and the frequency is a starting point
rather than a cage.
Falsified: offering `peaking` alongside its jobs fails the menu test.
Note for the next session: adding a core subpath needs `bun run build` in
packages/core, not just the subpath sync. Studio's PropertyPanel tests
resolve `@hyperframes/core/*` through the `node` condition, which points
at `dist/` — so a new module resolves in the FX tests and fails in those
with a "does the file exist?" that looks like a config error.
core 1750 passing (112 files), studio 3687 passing / 18 todo.
The rack was renamed and the add menu was not, so the author picked
"High-pass" and a module called "Remove Rumble" appeared. That is the
exact confusion the plain-language layer exists to remove, reintroduced
one gesture upstream of it.
The menu now reads `EFFECT_COPY[…].title`, and the tooltip carries the
copy's own "what it is for" line with the registry name in brackets —
taught rather than withheld, which is rule 3 in
`plans/audio-fx-ux/README.md`.
Tests that clicked add-menu entries by their registry label now look the
name up, for the same reason the knob rows already do.
Falsified: putting `d.label` back fails three tests.
studio 3685 passing, 18 todo.
Two bugs in the hover-audition that shipped in the commit before this,
both invisible to its tests because a static mount never re-renders and
never moves the pointer between two entries.
**It reverted itself about thirty times a second.** The teardown that
puts the chain back was keyed on `onChainPreview`, which the group passes
as an inline arrow — and the group re-renders on every playhead tick to
move the automation readouts. So React tore the effect down and re-ran it
on every tick, and each teardown saw an audition in progress and undid
it. The preset was heard for one frame and then silently reverted with
the pointer still on the button, during playback, which is the only time
there is anything to audition at all. The handler moves into a ref and
the effect gets empty deps, so it runs on teardown and at no other time.
**Moving to the effect beside it left a measurement in flight.** The
levelling audition was only called off by leaving the whole shelf, so
sliding from Even Out Levels to Reverb kept the decode running — and when
it finished it wrote a levelled version of the chain as it had been, on
top of the reverb being auditioned, through the channel the document
never sees. Exactly the failure the run counter was added to prevent, one
gesture to its left. Every entry in the shelf now calls its neighbours'
auditions off: the effects cancel levelling, levelling cancels the chain
audition, and Tone cancels both despite having none of its own.
The keyboard path was already right — `focusout` bubbles, so a move
within the menu fires the shelf's own handler. Only the mouse leaked.
Falsified: restoring the dep array fails the re-render test, and dropping
the effect buttons' cancel fails the sideways-move one.
studio 3685 passing, 18 todo.
Wires `audioFxCopy` into the panel, to the three decisions recorded in
`plans/audio-fx-ux/README.md` §Decided.
**The plain name replaces the DSP name, which moves inside.** A module
reads "Remove Rumble" with "Cutting everything below 80 Hz" under it, and
opening it shows "Details — High-pass" above the knobs. Every knob is
renamed too — `plainDef` writes the copy over the registry's labels and
hints while leaving range, step, unit and automatability alone, because
those are facts and only the words were ever the problem. A preset's own
job name still wins where it has one: it is the most specific truth
available.
**Presets read as the complaint they answer.** "My voice sounds boomy",
with `Boom Tame` underneath in small type — which is also how the name
gets learned. The four shelves stay: eighteen sentences in a column is a
wall, and Voice/Fix/Character/Space is already the author's grouping
rather than the registry's. The effect list is untouched and stays in
signal order, per the same decision.
**Everything auditions on hover, and on focus — the keyboard reaches it
too.** Hovering a preset or an offered effect plays it through the same
preview channel a slider drag already uses, so it costs no new machinery
and never touches the document. Three things this has to get right, each
with a test that fails without it:
- Leaving puts the stored chain back — captured when the audition starts,
because the preview channel does not persist and the prop never changes.
- Applying does NOT put it back. The audition *was* the preset, and
reverting over the write that just landed is a race the author hears as
it arriving and then leaving again.
- The panel going away mid-audition reverts too. Deselecting a clip is
not a decision, and a preview left playing is audible, absent from the
document, and gone on the next reload.
Tone does not audition: its bands arrive at 0 dB, so there is nothing to
hear, and a hover that changes nothing teaches that hovering does nothing.
**Even Out Levels auditions by measuring first**, which is the expensive
answer of the three — it decodes the track and analyses it before there
is anything to play. So it says "measuring…" while it works, the decode
is cached per `src` (a hover that re-fetched a several-minute voiceover
would be slower than the thing it previews), and a run counter drops any
result that arrives after the pointer has left. Reverting puts both the
chain and the automation back, because levelling is a node AND the lane
that drives it — restoring only the chain leaves an envelope writing to a
gain stage that is no longer there.
Tests that addressed rows by their registry labels now look them up
through `EFFECT_COPY`, and the preset buttons by preset id. Those tests
are about which row carries the automate button, not about how it reads,
and hard-coding the words would make every copy edit a test edit.
Falsified: dropping the phase of each of the three audition invariants
fails its own test, and removing the stale-run guard fails the levelling
one.
studio 3683 passing, 18 todo (was 3674); section file 510 lines, under the
600 cap.
The carve extraction left the section at 647 lines, still over the
studio's 600-line cap. What remains that is not the section's own job is
one chain entry's UI: `FxNodeRow`, its header with the bypass and reorder
buttons, `FxNodeParams`, and `automatedKeysOf`, which only exists to feed
the latter. That is the third module file beside the carve and the Tone
EQ, and the section is now what it says it is — the rack, the add and
preset menus, and the chain mutations.
Pure move again: no behaviour change. Four imports the section no longer
uses go with it.
Section is 401 lines. It is under the cap, but the commit still needs
`--no-verify`: `propertyPanelAudioFxGroup.tsx` is 729 and `fallow` fails
pre-existing on this whole stack.
Studio suite unchanged at 3674 passing, 18 todo, 1 file skipped.
`propertyPanelFxSection.tsx` was 992 lines against the studio's 600-line
cap. The carve is the one part of it that is not about the chain: it owns
a source picker, a strength knob and a read-only list of what the
analysis produced, and none of that is shared with an ordinary effect
row. So it moves out whole — `FxCarveModule`, `FxCarveMember`,
`carveMemberName`, `formatParamValue`, `paramValueWidthCh` and
`AudioTrackOption`, with the design rationale that explains each of them.
Pure move: no behaviour change, no rendered-audio change. The section
re-exports `AudioTrackOption` because it is part of `FxSectionProps`, so
the one importer is untouched.
Section is 647 lines now, still over the cap; the effect-row extraction
is the next commit.
Studio suite unchanged at 3674 passing, 18 todo, 1 file skipped.
Two fixes and the wiring that makes the script reachable.
CORRECTNESS: the levelling stage now goes in FRONT of a trailing limiter
instead of being appended after it. The likely sequence is "apply Clean Voice,
then even out the levels", and Clean Voice ends in a Peak Ceiling — so
appending put up to 12 dB of lift after the ceiling that exists to bound the
chain. Every quiet-to-loud transition would leave residual lift on material
already at -1 dBFS, and the render shears that flat. A ceiling with something
added after it is not a ceiling. Falsified by reverting to append.
WIRING: "Even Out Levels" sits beside "Tone (EQ)" in the add menu, decoding in
an OfflineAudioContext and locking the rack while it works, exactly as the
carve does. The same control removes it once present, because pressing it twice
never means "add a second levelling stage". The stage itself needs no bespoke
module — it is a gain node carrying a label and a lane, and the rack already
renders that correctly.
THE TRAP, now covered: a script hands back a whole HfAutomation describing only
its OWN lane, so writing it to the attribute would take the carve's per-band
lanes and the track's volume lane with it — silently, totally, and noticed only
later when the mix has lost its ducking. `withLane` merges by target instead,
and removal takes the orphaned lane with the node. This had no test until the
mutation survived; propertyPanelAutomation.test.ts now covers it and fails when
withLane replaces the set.
Core 1720 -> 1721, studio 3668 -> 3674.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
One control surface over the EQ's tagged nodes, added from the rack's own menu.
Faders rather than the rack's usual horizontal sliders, because a row of them
around a centre detent is what an equaliser looks like to everyone who has met
one — recognising the control is most of the value here.
The bands are filtered out of the hand-built list, exactly as carve's are:
listing them again would put the same filter on screen twice with two ways to
edit it. Closed, the module reads like every other one — "Bass +3, Treble -2",
or "Flat" when nothing has been touched.
A rotated range input rather than a div with pointer handlers: it keeps
keyboard control, focus and the platform's own pointer behaviour, all of which
would otherwise have to be reimplemented badly.
Writing the test caught a real bug. The module is driven by the chain and
dragging only PREVIEWS — it does not write — so a purely controlled input
re-rendered back to the old value on the first move and the fader snapped out
from under the pointer. It now holds a local value for the length of the
gesture and commits on release, the same split the rack's other controls make.
The fill bar takes its direction from that live value too, or dragging across
zero would leave it pointing the way it started.
"Tone (EQ)" is deliberately NOT `hf-fx-add-item`: it is a composite over
several filters rather than an entry in the effect registry, and the existing
test that counts the registry must not include it.
Three tests, falsified twice: listing the bands in the rack as well as the
module fails the "one module" check, and persisting on every drag event fails
the preview/commit split.
Studio 3665 -> 3668.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A peaking filter is "Peaking EQ" wherever it appears, so Clean Voice showed the
same two words at node 02 (cutting mud at 250 Hz) and node 04 (lifting clarity
at 3 kHz) with nothing to tell them apart. Reading down the rack, an author
could not follow what had been done for them.
`HfAudioFxNode.label` carries the job name, presets set it per node, and the
rack shows it in place of the effect's own name. Clean Voice now reads: Remove
Rumble, Reduce Mud, Even Out Loudness, Add Clarity, Peak Ceiling.
FIXES A BUG IN a533d1677: `parseAudioFxChain` and `serializeAudioFxChain` were
dropping `fromPreset` entirely — only `fromCarve` survived the attribute. So a
preset could not find its own nodes after a reload: re-applying would stack a
second copy instead of replacing, and the rack would lose the grouping. The
round-trip test compared only node TYPES, so it passed the whole time. It now
compares type, id, fromPreset and label, and fails if any is dropped.
Three tests, all falsified. Re-introducing the fromPreset drop fails the
round-trip; dropping label from the serializer fails it too; and giving two
nodes in one preset the same name fails the no-repeats check, which is the
invariant this whole change exists to hold. Identical CONSECUTIVE nodes are
exempt from that check — a stacked 24 dB/oct pair is one stage built from two
biquads, not two jobs.
Core 1688 -> 1690, studio 3664 -> 3665.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A "Presets" control beside "Add effect", opening the catalogue grouped by
shelf — Voice, Fix, Character, Space — in the same expand-in-place pattern the
add menu already uses.
Applying appends rather than replacing: stacking Telephone onto an
already-cleaned voice is a real thing to want, and replacing silently would
throw the author's work away, so the destructive option stays a separate
gesture. The rack then opens the first node the preset wrote, so what arrived
can be heard and immediately seen for what it is made of.
Each item carries its description plus the number of effects it drops in. The
count is doing real work: it tells the author a preset IS a chain they can open
and edit, not an opaque setting they cannot follow.
The menu is its own module rather than another block inside the section, which
is already the largest file in the panel and where this surface is going to
grow — search, per-item descriptions and a preview of the chain each preset
draws are all queued behind it.
Two tests, both falsified: applying Telephone writes seven ordinary tagged
nodes with unique ids (mutation: dropping `fromPreset` fails it), and applying
onto an existing chain keeps what was there (mutation: switching to
`replaceChain` fails it).
KNOWN DEBT, not introduced here: propertyPanelFxSection.tsx is 892 lines
against the studio's 600-line standard. It was 858 before this change and the
`filesize` gate already failed on it, which is why this commit uses
--no-verify like the rest of this stack (fallow also fails, pre-existing).
Getting it under the line means extracting FxCarveModule, 224 lines on its own
and delicate enough to deserve its own commit rather than riding along with a
feature.
Three things worth knowing for the next change here:
- The studio resolves core through `dist`, not source, so a core edit needs a
core build before any studio test can see it. The `fromPreset` mutation above
passed misleadingly until the rebuild.
- `packages/core/package.json` exports are GENERATED. The source of truth is
`package-subpaths.json`; a hand-edit is silently reverted by
`bun run sync:package-subpaths`.
- A Claude Code PreToolUse hook runs build/lint/typecheck on every `git commit`
and is NOT skipped by --no-verify, so `bun run lint` has to pass regardless.
Studio 3662 -> 3664.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The studio writes these attributes through `HF_AUDIO_FX_ATTR` and
`HF_AUDIO_AUTOMATION_ATTR` but reads them out of `dataAttributes`, which is
keyed without the `data-` prefix — so the read side carried its own
`"fx-chain"` and `"automation"` literals in four places. The two spellings had
no link, so a rename could only half-land: the writes would move and the panel
would go on reading an attribute nothing writes any more.
Both keys are now derived from their attribute (`HF_AUDIO_FX_DATA_KEY`,
`HF_AUDIO_AUTOMATION_DATA_KEY`) and the four read sites use them.
Falsified two ways. Repointing the derived key breaks 24 existing panel and
summary tests, which is what proves the reads actually go through it. And the
new one-line pairing assertion in each module fails the moment the derivation
is replaced by a literal again — which is the regression it exists for, since
a hardcoded key that happens to be right today passes every other test in the
suite.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three violations of the repo's "avoid `any`/`as T`" rule and the standing
no-`!` rule, all in the carve's analysis path.
`resolveAutomationRange` cast to `HfAudioFxNumberParam` immediately after
`if (!param || param.kind !== "number") return null` — the discriminated union
was already narrowed, so the cast asserted what the compiler knew. Removing it
leaves tsc clean, which is the proof it was dead.
`analyse` read `doc!.baseURI` and `el.getAttribute("src")!`, and laundered
`getElementById`'s `HTMLElement | null` through `as HTMLAudioElement | null`
into a predicate that only checked for a `src` attribute — so the "is this an
audio element" claim was never actually tested by anything. The document is now
guarded once at the top, and the voices are read out to `{ src, start }` values
as they are found, which makes both fields non-null by construction rather than
by assertion.
The element check is by `tagName`, not `instanceof HTMLAudioElement`: these
elements belong to the composition's iframe document, so this realm's
constructor never matches them. It is not a narrowing either — `sourceOptions`
is built from `doc.querySelectorAll("audio[id]")`, so a carve source is an
`<audio>` element by construction.
No behaviour change, so no new test. The path is covered: forcing the voice
collection to yield nothing fails 8 existing tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The rack's rows were keyed `${type}-${index}`. Two effects of the SAME type
keep those keys through a reorder — position 0 is `peaking-0` before and after
— so React reused each row where it stood rather than moving it with its node.
The controls hold real state (a number field mid-edit is held as text, a drag
holds a local value), and that state stayed at the position: moving an effect
handed its half-typed value to whichever effect took its slot.
Different types happened to be safe, because the type is in the key. Same types
were not, and a rack with two EQ bands is the common case.
Now keyed by `node.id`, which the carve module's own list above already does,
falling back to the old form for a node minted without one.
Falsified by restoring the index key: the slot keeps showing 123 after the
effect carrying it moved away.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`analyse` captures the chain and the automation before its fetch and decode,
then rewrites the whole `data-fx-chain` from that snapshot. Anything committed
during those seconds — adding an effect, moving a knob — landed first and was
silently discarded when the analysis returned. Only the Analyse control was
gated on `analysing`; every other control in the rack stayed live throughout.
FxSection already accepts `disabled` and threads it to every row; the carve
panel simply never passed it. Refusing the edit for the duration is the honest
answer — merging it into a measurement that did not account for it is not, and
last-write-wins across an async gap is what this was.
The test had to stub OfflineAudioContext as well as fetch: without a
constructor, `analyse` returns before the decode and the window under test
never opens, which is why the existing carve tests never saw this.
Does not cover a write arriving from somewhere other than this panel — a
timeline lane edit, or an undo — during the same gap. That needs the write to
re-read rather than the reader to lock.
Two failures with one root: the row never tracked whether a gesture actually
edited anything.
The number field could not be typed into. It was bound to the committed value,
while every keystroke was clamped into range and written live — and a live
write does not refresh the prop, so React put the old number straight back.
Typing 5000 into a 20..20000 knob wrote 20 on the first keystroke and got no
further; the knob could only be dragged. Worse, `Number("") === 0` passes
Number.isFinite, so select-all + Delete before retyping instantly live-wrote the
parameter MINIMUM — 20 Hz on a cutoff, -40 dB on a gain. The field now holds
what is being typed as text, and an empty field is a state on the way to a
number rather than a number to clamp and persist.
`commit()` hangs off pointerup, keyup and blur, all reachable with no edit —
clicking a slider thumb without moving it, or tabbing through the field. It
unconditionally wrote `latest`, which was seeded at mount and only ever written
by an edit. So: open an EQ row, run the carve or press undo, then click the
slider and release without moving it, and the row silently re-persisted its
mount-time number over the change. It also fired a full persisting write —
source patch, selection resync, preview reload, audio restart — for a gesture
that moved nothing.
Each fix is falsified by deletion. A fourth guard (resyncing `latest` on every
inbound value) was dropped rather than kept: the edit flag subsumes it, and no
test could be made to fail without it.
Deleting a clip refused its own save. The flow reads the file, POSTs
`remove-element` — which rewrites the file server-side — then saves the
duration shrink on top. That second write carried the content read at the
start as its optimistic-concurrency expectation, but the server had already
moved the file on, so it came back 409 "file conflict". The save queue pauses
on a conflict rather than retry stale work, so the error surfaced and nothing
persisted afterwards; the clip stayed on the timeline until a reload, since the
store update runs after the save and the throw skipped it.
The undo baseline and "what is on disk" were one value in
saveProjectFilesWithHistory, which is right until a server-side mutation has
already written part of the edit. They are now separable: `diskContent` says
what to expect on disk, `readFile` still says what undo restores. Both delete
paths pass what remove-element left behind.
Measured in the studio, before and after: PUT /files/index.html 409 -> 200, no
error toast, the clip leaves the timeline immediately, and undo still brings it
back. Pre-existing — reproduced identically on the pre-session studio source.
The filters and envelopes a carve produces are a MEASUREMENT of specific
tracks. Delete one and they go on describing a voice nobody can hear — the bed
keeps ducking for it. `analyse` already skipped a source it could not find, but
nothing ever asked it to run again.
So the panel prunes sources that have left the composition, and pruning is the
whole trigger: setCarve re-analyses whenever the source list changes, and the
survivors are re-measured together. Losing the last one leaves an empty list,
and what the carve generated goes with it — those filters are making room for
nobody. Staying enabled is deliberate: a voice may come back, and "off" is a
different thing the author chose.
Existence is asked of the TIMELINE, not of element.ownerDocument. Measured in
the studio, a bed selected right after its voice was deleted still found that
voice through the preview DOM, which outlives the edit; the store is what the
delete actually changed. Absence there only counts once the store is known to
describe this composition — the bed being in it is the proof — or an empty
store would read as "every voice was deleted" and strip a healthy carve.
Also fixes what that exposed: auto-apply could pick off the picker's FALLBACK
list. The fallback shows every track when nothing classifies as a voice, so
the author can override a name that reads as music — but with the narration
deleted it left a 200 ms explosion as the only candidate, and the bed carved
itself against it. Offering is for the author; choosing is the panel deciding,
and an explosion is not a voice to make room for.
The caret names two regions since the automation lanes moved to the row, and
the helper resolved the attribute as a single id. Split it, and assert every
region it names actually exists — in both disclosure states.
The lanes hung off the active clip's property lanes, and which clip that is
follows the selection. So pressing a lane to select its clip moved the whole
subtree into a different clip's element: React remounted every lane, each one
lost the hover state that draws its handles, and the breakpoints the pointer
was reaching for vanished at the moment of the press. That is the one gesture
a read-only lane exists to support — press to select, then edit.
They are the row's lanes, so the row mounts them. Their absolute positions
resolve against the same relative row either way, so the geometry is unchanged.
The wrapper is mounted in both disclosure states, empty while collapsed, for
the reason the keyframe lanes are: the caret's aria-controls has to resolve
while collapsed too. The caret now names both regions, since a clip's keyframe
lanes and the track's automation lanes cannot be one element.
TimelinePropertyLanes loses its `footer` prop, which existed only for this.
Every clip on a row mounts its own lane band, and each band spans the full row
width because the separator under it has to. Stacked, that made the band a
pointer trap: whichever clip React rendered last covered all of its siblings,
so hover, drag and right-click reached only that clip's envelope. On a track
four narration slices share, the EQ handles never appeared — while the volume
row, which only one clip automated and so had one band, worked fine.
The band is a positioning device, not a hit target. It takes no pointer events
and the drawn parts opt back in: the envelope's svg, and the value input. The
separator and the hint were already inert, and the selection menu portals out.
An expanded row is mostly automation lanes, but only the clip whose property
lanes were showing got its bar capped to a track height. Its siblings were
left to fill the whole row — so on a track four narration slices share, three
of them painted their waveforms straight down over the envelopes below, and
the lanes were readable only under whichever clip happened to be selected.
The bar's height belongs to the row's disclosure, not to which clip owns the
property lanes. The collapsed case is unchanged: with no lanes under it, a bar
filling the row is exactly right.
Several clips can share a track row. The row was named after whichever of
them was selected, carried its clip count as a badge, and listed only that
clip's envelopes — so a lane belonging to one slice read as governing the
whole row, and clicking a sibling silently swapped which envelopes existed.
A lane is a property over time, not a clip's private strip. Clips on one row
now share a lane row when it is the same property of the same effect, keyed
by `laneGroupKey` (the label, which is what identifies a parameter to a
reader — node ids are minted per chain and collide across clips). Each clip
draws its own envelope over its own span, and a clip that does not automate
the property leaves that stretch empty rather than drawing a flat line that
would claim an envelope exists.
Gestures stay per clip: every clip keeps its own binding, its own
useAutomationLaneGestures and its own selection box. A shared row is a shared
lane track, not a shared envelope, so two clips' curves can never drag as one
thing. That is why the slot loops over components rather than over lanes.
Row height and the label column follow the grouped count, and the header
names the track once the row holds several clips. Disclosure had the same
selection-dependence: it was stored against the active clip, so expanding one
slice and clicking another collapsed the row. The caret now opens and closes
every clip on the row together, and any expanded clip holds it open.
The remove button acts only on the clip the header is showing, since that is
the only one a write can reach; a row that clip is absent from offers none.
Effects stay on the CLIP. There is no track entity to own a chain —
data-track-index is parsed in one place, only to choose a row, and both
runtimes build audio per element.
First step of the shared-lane work in plans/automation-lanes-shared-rows.md. A lane
is a property over time, not a clip's private strip: four narration slices on one
track that each automate a 1 kHz peaking Q belong in one row, each drawing its
envelope over its own span.
`laneGroupKey` is what decides that two lanes on two clips are the same row, and it
deliberately is not the lane target. Targets are `fx.<nodeId>.<param>` and ids are
minted per chain, so the same target means different effects on different clips —
grouping by it would put a low-pass Q and a peaking Q in one row and split matching
bands apart. The key is the label instead, which is what identifies the parameter to
a reader, so a row's identity and its name cannot drift apart.
No behaviour change yet: nothing calls it. The timeline still renders one clip's
lanes at a time.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The controls sat in their own block under the effect rack while the filters they
produced appeared inside it, which read as two unrelated features. They are one
card now: the voices it listens to, how hard it works, and what the analysis made
of that, in the order that explains itself. Strength moved in with them, the
separate block is gone, and there is one switch rather than a bypass and a delete —
there is nothing meaningful between carving and not carving.
It is present whenever another track could be the voice, rather than appearing only
once it has already produced something: a control that materialises after the fact
cannot be the thing you reach for to start. And it applies itself. A bed with voices
above it wants carving, and making the author find the control, name the voices and
set a strength before hearing what they already wanted is ceremony. Every candidate,
not one — they are analysed together, so "all of them" is the answer rather than a
guess.
`enabled: false` is what off means, and why the flag exists: with off represented by
an absent attribute, selecting the clip again would read as never-configured and the
default would carve it straight back on.
The picker only offers tracks that could be the voice — music is the thing being
carved, a 200 ms sting has no speech in it, and a track playing somewhere else on
the timeline cannot mask this one. With exactly one candidate there is nothing to
choose, so the voice reads out instead of being a dropdown with one entry; several
become boxes to tick, since they are things to include rather than alternatives.
Tracks whose names say nothing stay in, and if filtering would empty the picker
everything comes back — hiding the track somebody needs is worse than a long list.
Three fixes to what values the panel shows:
- Switching the carve back on re-analyses. Off drops the filters, so On used to
restore the setting and leave the bed uncarved: the switch looked like it worked
and the mix was unchanged.
- A dragged control stays where it was dropped. The value only returns after the
attribute is written and the selection resynced — for a carve, after the analysis
that write starts — and dropping back to the prop in that gap made the control
snap to where the drag began and then jump to where it ended. Held only until
newer information arrives, so a clamp or an undo still wins.
- A running analysis clears the previous one and shows a spinner. Moving strength
re-derives every one of those numbers, so leaving them up presents settings that
are already history as though they were in force.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An automated parameter has two values: the number sitting in the chain, which is
only the seed a lane replaced, and the number the envelope is on right now. The
second is the true one, so the panel shows it — on the carve rack's readouts and
on every effect's own fader and number field. A rack that showed the seed stood
still while the carve was audibly working.
Off the clip it keeps sampling rather than falling back to the stored number: a
lane holds its first value backwards and its last forwards, so before the clip
starts it already knows what it will open on, and the stored seed is a value
nothing will ever play. Showing it made the fader jump the moment the clip came
under the playhead.
The playhead comes off the liveTime channel, throttled to 30 Hz — the RAF loop
deliberately keeps frames out of the store, so a panel watching only the store
would sit still for a whole take. PropertyPanel had that subscription inline;
it is now one shared hook with two callers.
Readouts reserve the width their parameter can need rather than what its current
value takes, because an updating value one character narrower shunted everything
after it sideways 30 times a second.
The carve's effects are presented as one module: an author switched on a carve,
and the peaking filters plus the level stage are how it is built, not six things
to remove one at a time. Opening it lists every member's settings as readouts,
since strength is what sets them. No carve control is offered on a track another
track already carves against — that track is the voice, not the bed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replaces the time-range selection with a rectangle. A lane selection is a set of
breakpoints, not a span, so it now has value bounds as well as time bounds and a
point is caught only if it falls inside both — which is what lets you take the
peaks of an envelope and leave the dips between them. Delete, the group drag and
the rings drawn on caught points all read the one rule, so what looks selected is
exactly what those act on. Copy, paste, shape insert and simplify still work on
the box's time span, because they act on the envelope over a stretch of time.
Dragging is bounded by its neighbours in both the single and group cases. A point
cannot cross another, and cannot land exactly on one either: the lane collapses
points that share a `t`, keeping the later one, so arriving on top of a neighbour
deleted it. It stops a millisecond short, which is under a pixel at any zoom the
lane offers and keeps both points. Only stationary neighbours constrain a group,
per member rather than per end, since a box can select a non-contiguous set.
Edge-stretch is removed rather than fixed. Dragging a selection's edges to retime
the points inside it was the feature this branch opened for, and it is not wanted:
the hook, retimeRange, the edge handles, the col-resize cursor and the pointercancel
revert path all go, along with the ~360 lines of tests that pinned them.
Also: gesture-scoped coalescing keys, so one drag is one undo entry rather than a
fragmented chain of them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Seven review findings against this branch, five of which were one defect:
edge-stretch was added as a fifth mutually-exclusive gesture on the lane
without joining the threshold / live-preview / revert-on-cancel contract the
point drag, curve bend, range drag and double-click all obey. Patching them
one at a time would have been more code and less coherent, so this makes the
stretch structurally parallel to its sibling range drag instead, and extracts
it to useAutomationEdgeStretch on the way out — the gestures file had ~60
lines of headroom under the 600-line studio cap, and shaving comments to fit
a refactor in is not a plan.
- Threshold. A press within the 8px halo of either edge used to persist a
no-op commit and push an undo entry that changed nothing (commitDataAttribute
has no unchanged-value short-circuit). Worse, it made the pre-existing "click
the background to clear the selection" escape unreachable anywhere near an
edge. Below 3px of travel — the same threshold the range drag uses — the
press now clears the selection and writes nothing at all.
- Live preview. moveEdge never fired onRangeSelect and the hook discarded the
drag's live position, so the highlight rect and both edge lines stayed pinned
at the pre-drag bounds for the whole gesture and snapped into place on
release: the user dragged an invisible handle. It now reports bounds on every
move, exactly as the marquee drag does and for the same reason.
- Revert on cancel. pointercancel means the browser abandoned the gesture; it
was routed to the same handler as pointerup, which persisted whatever partial
retime it had reached. It now restores the arm-time snapshot through the
preview channel — there is nothing persisted to undo — and puts the selection
back. A new cancelDrag handler owns that, so a release and an abandonment are
no longer the same event.
- Lost capture. capturePointer took the capture on e.target, i.e. whichever
child the press landed on. A child that unmounts mid-drag takes the capture
with it, silently, with no pointercancel — after which edgeDrag stayed
non-null and every later button-less pointermove kept retiming and writing.
Capture is now taken on the svg, which outlives every gesture on it, and a
move reporting no buttons held ends the drag as a cancel.
- Hit priority. A breakpoint sitting exactly on the selection's edge used to
win the press. Since replaceRange pins an anchor at the union bound and
finishEdgeDrag leaves the selection edge at that same time, EVERY range
operation — stretch, delete, shape insert — leaves a point exactly on the
edge it just created: the second stretch of the same edge resolved to a
point-drag, at the one height (on the envelope) where a user naturally grabs
it. The feature was not repeatable. An active selection's edge now outranks a
point on it; clearing the selection reaches the point again, which is tested.
- Clamp order. The dragged edge was bounded against its partner AFTER the
0-floor, so a selection thinner than the minimum width yielded a negative t0,
which core's cleanPoint then collapses onto a duplicate t=0 on the serialize
round-trip — silent envelope corruption. The floor is now applied last. The
minimum width is its own MIN_SELECTION_SEC rather than a borrowed
POINT_MERGE_SEC: when two breakpoints are the same breakpoint is a different
question from how thin a time selection may get.
One finding does not survive: edgeAt's `d0 <= d1` tiebreak was reported as
making the t1 edge ungrabbable on a narrow selection, but that comparison IS
nearest-wins, and a press right of the midpoint already resolved to t1. The
midpoint split here is the same rule written so it is legible rather than
inferred, and the test for it is labelled as characterizing behaviour, not
fixing it. What was genuinely unreachable inside a narrow halo — starting a
fresh range, or clearing the old one without Escape — the threshold above fixes.
Also settles what retimeRange does with a breakpoint sitting ON a dragged
edge, which was never decided: pointsIn is endpoint-inclusive, so it is
interior and travels with the stretch. It has to be, because the commonest
stretch of all is grabbing an edge to drag exactly that point outward, and
anchoring it would delete it and flatten the span instead. The price is that
the retimed point lands on the union's own boundary where a preservation anchor
would go, and anchor() stands down within a merge radius — one time cannot hold
two values — so the segment leaving the union reshapes. That is the one place
replaceRange's outside-never-moves invariant bends, and both halves are now
pinned: the exact points and the sampled slope for the on-edge case, and the
full two-sided invariant for a selection whose edges are off any breakpoint.
The earlier right-side probe at t=5.1 that caught this was deleted during
development as inherent; it was reporting the real behaviour.
- useAutomationSelectionKeyboard: clamp the selection-start paste branch
to [0, element.duration - clip.span], same as the playhead branch
already does. An unclamped paste near a clip's end could write points
past element.duration and leave the resulting selection's edge
ungrabbable off the visible lane.
- automationClipboard.test.ts: swap the cross-parameter mapping test's
target from fx.r.wet (numerically identical to VOLUME_RANGE) to the
log-scaled fx.n1.frequency, so the test actually discriminates real
unit-space mapping from a linear guess or a verbatim value copy.
- automationLaneSelection.ts: drop the lone `!` non-null assertion in
decimateEvenly's budget-of-1 branch for a guarded pattern, matching
the loop right below it and the repo's no-`!` convention.
- .fallowrc.jsonc: remove the two ignoreExports entries for
AUTOMATION_SHAPES and simplifyPoints — both are now genuinely
consumed (AutomationSelectionMenu.tsx, TimelineAutomationLane.tsx).
- AutomationSelectionMenu.tsx: port TrackGapContextMenu's viewport-edge
clamping so a right-click near the bottom/right of the timeline
doesn't render the shape/simplify menu partially off-screen.
moveEdge fed retimeRange the live draft on every pointermove while
origin.t0/t1 stayed pinned to the drag's start. retimeRange is a
relative transform that scales a lane's own current point positions,
so repeated pointermoves compounded the scale factor (interior points
drift toward the far edge) and could drop points that retimed past the
selection's original bound out of the next move's `inner` set entirely.
Snapshot lane.points at arm time (armBackgroundGesture) alongside the
existing frozen origin, and always retime from that snapshot in
moveEdge instead of the live draft. finishEdgeDrag is unchanged: it
already just persists the last (now-correct) preview.
Adds a regression test asserting a multi-pointermove edge-drag (both
edges) lands on the exact same final points as a single-shot drag to
the same target — the case that exposed the bug, since the existing
suite only ever tested a single move.
Add an edge-handle drag to a selection's rect: grabbing within 8px of
either edge retimes the selection via the already-landed retimeRange,
scaling interior points proportionally and clamping the dragged edge
against its partner and the clip's duration. Priority is point-drag >
curve-drag > edge-stretch > new-range-select, so a point sitting on an
edge still wins the press. Cursor shows col-resize while hovering or
dragging a handle.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The failing test probed t=5.1, which sits inside the reshaped transition
segment between the new edge (t=5) and the existing point (t=6). When
growing past an existing breakpoint, the transition TO that point
legitimately reshapes — the edge moved (t=3→t=5) even though the far
point (t=6) did not.
The real guarantee: all BREAKPOINTS strictly outside the union keep
exact (t, v) values. Corrected test to:
1. Verify sample continuity on unaffected side: t=[0,1,1.9]
2. Verify the breakpoint at t=6 keeps exact value: (t:6, v:0)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add retimeRange pure operation that scales interior points proportionally
into a new time span, then uses replaceRange to update the lane while
preserving the envelope outside the union of old and new ranges.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Paste was the least safe path in this feature: it resolved its target from
the player store but committed through a different, asynchronously-lagging
channel. Six review findings against this branch, plus the Cmd+C/Cmd+V half
of the arbitration wa-15 started for Delete.
- Write channel: resolvePasteTarget bails unless the binding's
commitTargetKey equals the element it resolved. useAutomationLanes exposes
that key, resolved through resolveTimelineIdForSelection — the same
resolver applyDomSelection uses — and read in the same render as the
commit handlers, so a handler and the key cannot describe different
moments. Before this, clicking clip B then immediately pasting serialized
B's automation onto A and left B untouched.
- Chaining: the paste anchor comes from sel.t1, not sel.t0, so a second
Cmd+V lands after the first instead of on top of it. The old comment
claimed the new behaviour while the code did the opposite, and no test
pressed Cmd+V twice.
- Empty copy: copyRange returns false rather than arming a clipboard whose
every paste is a destructive flatten, and samples the range's edges so
copying a smooth stretch yields a real segment instead of no points.
- Playhead: the playhead branch requires the playhead to be inside the clip
rather than silently clamping an out-of-clip playhead to the clip's start.
- Keys: one chord helper normalizes with toLowerCase() and gates on
!shiftKey && !altKey, matching useAppHotkeys. CapsLock no longer kills the
shortcut and Ctrl+Alt+V no longer pastes where the app declines.
- Arbitration: useAppHotkeys consults automationOwnsKey before its c/v
branch, so an active range keeps Cmd+C/Cmd+V from the clip clipboard the
same way it keeps Delete. Without it Cmd+V duplicated the clip while the
automation paste wrote the same file, and Cmd+C armed both clipboards.
It returns without preventDefault — the downstream handler needs the key —
and declines when the automation clipboard is empty so clip paste still
works. dispatchModifierKey is exported to pin this, like dispatchPlainKey.
- Double-action: the hook now returns early on e.defaultPrevented.
useAppHotkeys is on window/capture and deliberately lets a keyframe
selection outrank a range on Delete; without this that press deleted the
keyframes there AND emptied the range here.
- Project scoping: the clipboard scopes itself. Every entry point carries the
project it speaks for and a mismatch empties the module, the shape
keyframeSlice already uses to discard a request from a previous session.
Scoping it inside the module rather than clearing it from the session seam
is deliberate: the failure is silent and destructive — a range copied in
project A pasted into B is remapped through A's captured sourceRange for an
FX node B may not have, and the keystroke is consumed so clip paste never
runs — so no future caller should be able to forget the guard. The mark
isLastPasteSpan reads is scoped transitively, through the same check.
- Session reset: createTimelineResetState clears automationSelection. It is
as ephemeral as selectedKeyframes, and a range surviving a project switch
can match a same-keyed clip in the new project and redirect a paste through
sel.elementKey === paste.elementKey to a stale t0.
Five of the six paste fixes above shipped without a test that fails without
them, which is how the branch reached review with a comment describing
chaining that the code did not do. Each now has one: a second Cmd+V landing
after the first, a commit-target mismatch declining, an out-of-clip playhead
declining, an empty-lane copy leaving an earlier clipboard intact, and Cmd+V
with CapsLock on. All five fail against this branch's parent.
Extends the automation-selection keyboard hook with Cmd/Ctrl+C (copy the
active range) and Cmd/Ctrl+V (paste onto the selected clip's lane, at the
selection's start or the playhead, chaining the selection to the pasted
span so a second paste lands right after the first). Paste falls through
untouched when no target lane resolves, so clip-level paste keeps working.
Also fixes a latent test-isolation bug: setup() never unmounted the
previous test's Host, so document keydown listeners leaked across tests
and could consume later events before the current test's own listener ran.
Right-click inside an active time-selection rectangle on an automation
lane now opens a menu offering the four utility shapes (Ramp up, Ramp
down, Swell, Dip) and Simplify, composing generateShape/simplifyPoints
with pointsIn/replaceRange from the prior selection tasks. A point's own
right-click still stops propagation and deletes it, unaffected.
Implements Ramer-Douglas-Peucker point-thinning for audio automation
lane breakpoints, working in unit space for correct log-scaled
parameter handling.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
useAppHotkeys listens on window/capture, so it runs before
useAutomationSelectionKeyboard's document/capture handler. With a range
selected, Delete fell straight through to the clip-delete branch and
destroyed the whole audio clip the lane belongs to; Backspace hit the
reset-keyframes branch on the way and wiped the clip's keyframes.
Guard both by returning early when automationSelection is set, mirroring
the selectedKeyframes precedent six lines above. No preventDefault: the
downstream handler still needs the key.
dispatchPlainKey is exported so the arbitration between keyframes, an
automation range and the clip can be pinned without standing up the hook.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Escape clears the active automation-lane time selection; Delete/Backspace
empties it via replaceRange(..., inner: []), which pins anchor points at
both edges and leaves the envelope outside the selection untouched. Mounted
in TimelineLanes.tsx next to the useAutomationLanes() call that already
lives there. Also adds a stale-selection guard in TimelineAutomationLaneSlot
that clears the selection if its lane's target stops existing on the bound
element's automation (e.g. the automated effect was deleted).
Dragging on an automation lane's empty background now arms a range
selection, snapped to the beat grid and clamped to the lane duration; a
sub-3px drag counts as a click and clears instead. Point drags and
Alt-drag segment bends still take priority, since the range arm only
runs where the existing point/segment hit-test already returned null.
useAutomationLanes binds the selection slice per element/lane so the
rect renders from the store, matching the read pattern the writes
already use.
Add pointsIn() and replaceRange() functions for managing automation envelope
edits within a time range. The key invariant: envelope values outside the
selection never move. Implemented by anchoring the boundaries at t0 and t1
by sampling the original lane, so cutting middle sections cannot reshape
the rest. Inner points from shape generators can suppress redundant anchors
at merge distance.