forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 2c8e3aa151eb0ab655f319f6cdc69a4f66f2b3ffFiltered to crates/engine/src/project.rsClear filter

2026-08-12

✨ feat(subtitles): as many tracks as you want, embedded in the exportAhmet Kaan Gümüş · 28e2853
✨ feat(subtitles): as many tracks as you want, embedded in the export

Subtitle tracks now work the way audio and video tracks do: add as many
as you like, remove any of them, and every track with cues on the
timeline is written into the exported file.

Add and remove
- "+ S" beside "+ V"/"+ A" imports every subtitle track in a picked
  file; each row carries its own "x". Pointer and keyboard doors share
  one implementation and refuse identically, before any chooser opens.
- Project::remove_subtitles / PlaybackSession::remove_subtitles, with
  the index fixup in one place so a removal cannot repoint the overlay.

Embedded in the output
- ExportSettings.subtitles is a list; the Matroska muxer writes N tracks
  from number 3 up, ceiling derived from the encoding (0x7F -
  SUB_TRACK_FIRST) because track 127 is the all-ones VINT our own reader
  maps to "unknown" and would silently lose.
- mp4 carries them too, as real tx3g timed text. The old "an mp4 carries
  none" was a false refusal: mp4 0.14 has MediaConfig::TtxtConfig all
  along. Samples are built from cue boundaries, so gaps are empty
  samples and the track spans the film.
- of_mp4 reads them back, so edith re-imports its own output. Verified
  against a file ffmpeg muxed, which writes mdhd in microseconds where
  we write milliseconds.
- The export set is derived from timeline_cues per call, so it cannot
  desync; the card names a track it leaves off, and counts past the
  width budget rather than eating the card.

Language and title
- SubtitleTrack carries language and name apart; the guess-them-back
  heuristic is gone. LanguageBCP47 is read and mapped to a 3-letter code
  (ffmpeg reads no BCP-47 at all, so writing it would have made the
  language invisible). A 17-track subtitle library file and a
  dual-language one no longer read "und".

Media bitrate in properties
- engine::probe_bitrate opens no decoder; all three numbers share the
  container's duration, so total >= video + audio holds by construction.
  Within 0.004% of ffprobe across the library.
- Both properties cards show it; a dual-audio file says which of how
  many. The line picks one unit off its smallest stated component, so a
  real value never renders as 0.00.

Off the render thread
- The subtitle walk moved to the background executor at every door:
  1324ms -> 0.1ms on a 3.1GB film, 234ms -> 5.0ms on a 25.4GB/35-track
  one. (The media walk is still on the render thread; separate slice.)

False refusals removed
- .mks and .mka were refused while the compiled-in Matroska reader
  parses them; is_matroska now takes the standard's closed set.
- The audio-only "sound alone" sentence was unreachable when every pick
  was a bitmap track.

Subtitle-free exports stay byte-identical: 294a8b0c (hevc mkv),
8c16b8b1 (default mp4).

2026-08-11

🐛 fix(project): the undo stack stops at 100 steps and an export clones the timeline, not the sessionAhmet Kaan Gümüş · 2504de7
🐛 fix(project): the undo stack stops at 100 steps and an export clones the timeline, not the session

snapshot() drops the oldest step at the cap: one gesture is one step, so 100 is
past any chain walked back by hand, and a 1394-clip jumpcut timeline's history is
a bounded ~10 MB instead of one that grows for as long as the session lasts.

export_to_with hands export::start a Project::export_snapshot() -- lanes and
sources with the history left behind. The clone is taken on the UI thread and an
export never walks the history back; the written bytes are unchanged.
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for youAhmet Kaan Gümüş · 09671f7
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for you

BT.2446 Method A's assumed mastering peak was a constant in the module: 400
cd/m^2, one exposure decided for everybody. It is a matter of taste, not of
correctness -- a reference rendition and a vivid one are both honest pictures of
the same film -- so it becomes a project setting with three renditions through
the very same curve, which is what keeps the hues right whichever is picked:

  Reference  1000 nits, chroma 1.0   the published conversion (diffuse white 166)
  Standard    400 nits, chroma 1.0   display-referred, as bright as a player
  Vivid       250 nits, chroma 1.10  brightest, and a tenth more colour

The chroma gain is a scale about 128 in the SDR codes, after the map and clamped
to the legal range: a grey stays exactly grey at any gain, and at 1.0 it is a
clamp the maths cannot reach, so the other two presets are byte for byte what
Method A produced. HLG's OOTF gain is guarded at black -- below a 1000 cd/m^2
peak the system gamma is under 1, and the 0 * inf that follows byte-cast to 0
and put a hole where black belongs.

The preset lives on the Project beside the limiter (a setting, not an undo step),
reaches the decode workers and the export through the same value, and is saved as
a `tonemap` line in edith 11 -- left out when it is the default, so a project
holding no HDR media is the bytes it was, and a v10 file loads as the reference
rendition, which is the only one it ever had. Picking one rebuilds the picture
under the playhead the way a resize does; an SDR project is unmoved.

The panel names it beside the resolution and the rate -- the third thing that is
the project's rather than the media's -- and a click opens the three renditions
with the one in force marked. No stroke: this is a list to look at.
🐛 fix(timeline): a dropped row lands where the hand let it go, not after the last clipAhmet Kaan Gümüş · 0d1c2c1
🐛 fix(timeline): a dropped row lands where the hand let it go, not after the last clip

A library row dragged onto the open bed past the last clip was appended to
the end of the timeline wherever it was released: the ghost promised one
frame and the release committed another.

`Project::paste` clamped the frame it was asked for to `timeline_frames()`
-- the clipboard's rule ("put it here", never "here with black in front"),
imposed on every caller of the primitive. A drop names a place on the bed
and means it, and `Project::place` (the audio/further-lane half of the same
drop) already honoured one, so V1 was the odd lane out.

The clamp moves to the clipboard's own door, `PlaybackSession::paste_at`,
and the grouped branch of `place_stream_at` goes to `Project::paste`
directly with the frame the pointer named. Nothing else changes: a paste at
the playhead cannot be past the end anyway.

Pinned by `a_row_dropped_on_the_open_bed_lands_under_the_pointer`, which
walks the release's own chain -- `landing` as `place_frame` composes it,
the frame back through the rate as `insert_source` hands it over, and the
one engine door a row goes through -- and lands frame 300 where it used to
land 150.
✨ feat(export): the subtitles leave with the fileAhmet Kaan Gümüş · df92458
✨ feat(export): the subtitles leave with the file

A Matroska export now carries the picked subtitle track as S_TEXT/UTF8:
a TrackEntry beside the picture and the sound, and one BlockGroup per cue
— Block plus BlockDuration, because a SimpleBlock has nowhere to say when
a line goes away. Interleaved into the clusters as the AAC packets are,
so a player has the cue by the time it needs it.

The cues are put on the exported timeline first. A track that came out of
a media file is timed against that file, so it is carried through the
spans that still play it: a cue over a stretch that was cut out is gone,
one straddling the cut keeps the half that is still there, and everything
after a rippled delete moves back with the picture it belongs to. A
standalone .srt has no clip to hang on and no offset to shift by, so it
stays on the timeline's own clock — the one the overlay drew it at —
clipped to the exported length. A cue nothing clipped keeps its own
microseconds, so an untouched timeline exports the times the source
states, to the millisecond the file is written in.

An mp4 says so instead of pretending: tx3g is a different beast and
nothing here writes one, so the export card carries a Subtitles row that
reads "test_subs.srt → embedded", "mkv only — an mp4 carries none" or
"none" before the button is pressed.

Exports without a picked track are the files they always were: the track
entry and the blocks are written only when there is one.
✨ feat(rate): the project frame rate is a list to pick fromAhmet Kaan Gümüş · d2e25cc
✨ feat(rate): the project frame rate is a list to pick from

The panel could only ever read the rate out. Now it opens the rates the
way the resolution button opens the sizes -- 23.976 through 60 with the
media's own cycled in and the one in force marked -- and picking one
conforms the whole timeline to it.

PlaybackSession::set_frame_rate maps every frame number on every lane
through one Rate (Project::retime), so a take keeps its seconds, its
footage and its sync while being counted on the new grid; every source is
re-read through a Rate against it and an export comes out at it. The v9
fps line now governs a video-scaffolded project too, so a project cut at
24 reopens at 24 instead of at the media's 30 with every clip number
still counted in 24ths.
✨ feat(engine): subtitles come in with the film or beside itAhmet Kaan Gümüş · f4b5fd8
✨ feat(engine): subtitles come in with the film or beside it

A subtitle track was a track this engine walked past: the Matroska track
walk kept video and audio and dropped type 0x11, and a `.srt` next to the
media was a file with no door. Now both arrive as the same thing -- a
list of timed cues -- and a project keeps them.

`subtitle`: the cue model plus the two ways in. Standalone `.srt`,
`.vtt` and `.ass`/`.ssa` go through `oxideav-subtitle` and `oxideav-ass`
rather than through a fresh parser here; an embedded track carries its
timing on the block and its text in it, so each codec is put back into
the shape its own parser reads -- which is what makes an embedded track
and the file it was muxed from come back as the same cues.

What cannot be read is refused by name and still listed: the four PGS
tracks of a BluRay remux are four rows saying they are pictures, not an
empty list and not a file that would not open. A `.srt` that has gone
missing since the save is the same story, and a re-save keeps its row.

`.edith` 10 writes `subtitle <track> <path>` -- the reference only, the
cues stay in the file they came from. v9 and every older dialect load as
the projects with no subtitles that they are.
✨ feat(mix): every track has its own volume and the mix has a ceilingAhmet Kaan Gümüş · dc7d07d
✨ feat(mix): every track has its own volume and the mix has a ceiling

A fader per audio track and one master limiter over the sum of them, both
applied where the lanes are added and nowhere else -- so what an export
writes is what the room heard, by construction rather than by two call
sites agreeing.

A track's fader moves everything on it, every frequency: it is not the
equalizer (one take, one band) and not the panel's volume (this machine's
monitoring, which no file carries). The limiter is lookahead, soft-knee
and per sample: the peak of an exported file is a measurement, not a hope,
and the hard clamp stays behind it as the backstop.

Flat settings are still the bit-exact passthrough: one lane at unity with
the limiter off never opens a mixer thread, and an mp4 of such a timeline
is still a packet copy. A mixed one re-encodes, and the card says so
before the export starts.

Both belong to the project, so `.edith` is v9: `fps`, `limiter` and `gain`
lines, every older dialect still loading flat. The rate line pays an old
debt with it -- a timeline of nothing but stills and songs now comes back
at the rate it was cut at instead of the one its scaffold implied.

UI: the mix card (f, or an audio track's own header), rows with steppers
and hold-to-run arrows, and the track's level on its header.
✨ feat(timeline): a clip goes where you drop it, along its track or across themAhmet Kaan Gümüş · cdb0c4b
✨ feat(timeline): a clip goes where you drop it, along its track or across them

A clip dragged along its own lane now lands on the frame the pointer let it go
on, and a library row dropped on a lane goes in under the pointer instead of at
the playhead.

Project::move_to_lane becomes Project::move_clip(from, idx, to, start): the
whole group travels the same distance, each half on its own lane, and start is
clamped to the gap every member lands in -- a clip butts up against the take
next door instead of overwriting it, and the tightest member's wall wins. A drop
that changes neither lane nor frame is a click and costs no undo step.

The front-end reads the frame under the pointer through the same View the boxes
are drawn through, so it lands where it was let go at any zoom, less the offset
the hand grabbed the box at, and snaps to a neighbour edge or the playhead
within a few pixels.
🔀 merge(T3): mixed frame rates meet mkv HEVC, zero-source survival and the zoomAhmet Kaan Gümüş · 6b5fa2e
🔀 merge(T3): mixed frame rates meet mkv HEVC, zero-source survival and the zoom

`main`'s `open_project` now walks every source with the scaffold in its own
slot (T6), so the per-source `rates` table is built there frame by frame beside
`counts` -- one table in two vectors, grown and shortened together. The codec
gate T1 leans on stays; the frame-rate gate is still gone, and a Matroska file
shot at another rate imports through the very same door an mp4 does, its rate
read off the demuxer's `default_duration`.

Grafted from the losing branch, which had the better arithmetic:

* `Rate::from_fps` is exact. Built on `mux::frame_timing` -- the pair the muxer
  already counts an export's frames in -- divided by that pair and reduced, so
  24000/1001 over 30 is `800/1001` and stays it however far the timeline runs.
  The milli-fps rounding it replaces was a frame off after seven hours; that
  ponytail is gone rather than documented.
* A rate no timescale can *name* is an `Err` in `frame_timing`'s own words
  rather than a silent 1:1, and `matches_timeline` is where a file carrying one
  is refused -- it hands back the `Rate` it accepted the file at, so the number
  the refusal was decided on is the number the file plays by.
* `file_frames` and `file_rate` ask one `source_of`, so a path that names a
  length names a rate too.
* Five more tests in `tests/mixed_fps.rs`, in timeline frames: the exactness of
  the NTSC ratio, a trim of an off-rate clip to the room it was dragged to, the
  neighbouring 30 fps clip still read frame for frame, the linked sound placed
  at its picture's length, and the exported pictures measured against the
  file's own frames rather than merely counted.

...and the note the next builder needs in `copy_audio`: a lane holding a clip
at another rate stays a packet copy on purpose. A clip counts the *timeline's*
frames, so the window the copy trims a source's sound to is whole timeline
seconds and the packets are already in sync; re-encoding it would buy nothing
and cost a generation of loss. A speed is different, and still refused there.

2026-08-10

✨ feat(timeline): a clip shot at another rate plays at the speed it was shot atAhmet Kaan Gümüş · 26af1e4
✨ feat(timeline): a clip shot at another rate plays at the speed it was shot at

A frame rate of its own is no longer a refusal at import. Every frame
number in the edit list counts the *timeline's* frames -- a clip's
in/out included -- and a file shot at another rate is converted once, at
the decoder's door: `Rate` (milli-fps rational, `Speed`'s floor/ceil
pair) says which frame of the file a timeline-rate frame is. Playback
opens its worker through it and stamps the pictures coming back through
its inverse; the export walks its span through it after the speed, so a
2x 24 fps clip on a 30 fps timeline is exactly both.

Nothing in `project.rs` changed: placement, trim, split, paste and speed
are the same arithmetic on one clock, and a single-rate project takes
the identity map everywhere it used to take nothing.

A library row now names the *file's* rate rather than the timeline's,
which was true only while every source shared it.
🔀 merge(T6): the last media leaves, and nothing assumes source 0 stayedAhmet Kaan Gümüş · 7e4ead7
🔀 merge(T6): the last media leaves, and nothing assumes source 0 stayed

Both sides kept: the library-removal slice (a project may name no file, the
audio reference is never a still, the clipboard follows its file down the
list, a silence edit drops the selection) and main's EQ audio export, image
left-trim, track removal, volume slider, hold-repeat and EQ spectrum.

The one textual conflict was the test import list; close_session now also
drops the gestures and caches those slices added.
🔀 merge(T9): track removalAhmet Kaan Gümüş · b631892Browse files
✨ feat(timeline): a jumpcut reaches as far as you tell it toAhmet Kaan Gümüş · 88fbed0
✨ feat(timeline): a jumpcut reaches as far as you tell it to

A ripple used to be the whole timeline's business. It is a choice now:
the card's first row says whether an apply reaches this take (its picture
and its sound), this track alone, or every track -- and a track nobody
named does not move, which is how a podcast track loses its silences
while the music under it stays where it was.

The engine takes an arbitrary set of lanes, not a kind or a range, so
what "selected" means stays the front-end's business. It refuses, by
name, a scope that would take one half of a take with it rather than
quietly widening to the other half: widening would edit a track the user
did not name, which is the surprise scoping exists to end. Naming the
take is a row, and detaching is the other answer -- the refusal says both.

The notice names what it reached: "5 SILENCES CUT on A1 — other tracks
untouched".
🐛 fix(timeline): a silence refusal names the file and the frame it meansAhmet Kaan Gümüş · 564ba30
🐛 fix(timeline): a silence refusal names the file and the frame it means

A still handed to the silence card answered in the mp4 demuxer's words
("a box with a larger size than it"), which is true of a container and
useless to a person: a picture has no sound for the same reason a silent
video has none, so it is refused in the same sentence, by name.

And a rate that cannot be cut at the *end* of a silence said the start
instead -- a frame the cut would have been fine at, and the wrong place to
send anyone looking.
✨ feat(timeline): silences are cut out or played fast in one pressAhmet Kaan Gümüş · d4ac3fc
✨ feat(timeline): silences are cut out or played fast in one press

A scan of the selected clip's own sound (RMS dBFS over 20 ms windows, off
the decode path the waveform already takes) marks every silence on the
lane before anything moves; `enter` cuts them all out with a ripple, `f`
plays them at 4x with the room they no longer need closed behind them.
Either way it is one edit and one undo press, however many it found.

Four numbers, all keyboard-driven from the card: the threshold, the quiet
short enough to forgive, the padding kept either side of speech, and the
kept sliver short enough to swallow -- the last of which is what stops a
breath between two silences surviving as one-frame confetti.

`set_speed` does not ripple, so speed mode closes the gaps itself; a clip
on another lane lapping over a silence is refused by name, because the
lanes would shrink by different amounts. A source with no audio track at
all is refused by name too rather than read as one long silence.

Output is ordinary clips: `.edith` stays v8.
🐛 fix(timeline): a hole punched into a slow clip leaves no overlapAhmet Kaan Gümüş · c892972
🐛 fix(timeline): a hole punched into a slow clip leaves no overlap

`place` punches a hole with `clear`, and `clear` handed the remainder
whatever source range rounding produced. At a quarter speed one source
frame *is* four timeline frames, so a punch three frames into such a clip
left a head that reached past the hole and overlapped what was placed --
the lane invariant, broken by the one edit that is allowed to overwrite.
`Speed::fit` now answers `None` for a room nothing fits in and both
remainders go through it: no fit, no remainder.

The sweep that found it found a second of the same shape. `set_speed` put
one rate on a whole linked group without asking whether the group still
covered one span: two halves of *different source lengths* can occupy the
same frames at 4x (rounding collapses neighbouring lengths onto one
footprint) and re-rating them pulls the halves apart, which is a project
that will not load again. Refused by name now, like the collision is.

The trim walls move with it: one frame of clip always survives, and at a
rate below real time one frame of clip is several frames of timeline
(`Speed::room`). A trim that cannot fit refuses before it snapshots rather
than writing a range wider than its room.

Both fuzz sweeps go to 2000 seeds -- 200 walked straight past this, and a
sweep this cheap has no business being the narrow one -- and place now
lands speeded clips over speeded clips on purpose. Falsified: with the
guard removed, `place`'s own `sorted_disjoint` assert fires.

Grafted from the rival build of this feature, which the judge preferred on
these three points:

- floor/ceil pairing on `Speed`: `source_at` (floor) is what an export
  encodes, `timeline_at` (ceil) is the stamp playback puts on a decoded
  frame, and the pair makes the frame the pump is holding *exactly* the
  frame the export writes, at every rate (`speed_maps_both_ways`, 3751
  speeds). The floor/floor this had put the preview a whole held frame off
  the export at slow rates.
- the picture now **honours** a rate: the export walk takes the source
  frame each timeline frame shows and encodes a held one again rather than
  decoding it twice. `Span::source_len` reads the last shown frame's own
  source frame and not one more.
- the refusal narrows to the mp4's *copied audio lane* only. AV1 has no
  audio to copy and honours a speeded take whole; WAV and FLAC always did.

EVIDENCE: a mixed-rate mp4 (2x then 1x on one lane) reopens as 135 frames
at 30 fps and its bright frames are exactly [15, 16, 75, 76, 77, 78] --
the fixture's four-frame flash halved inside the fast clip, whole inside
the slow one -- read back both by the engine's own decoder and by ffmpeg.
✨ feat(timeline): clips play at a speed of their ownAhmet Kaan Gümüş · f8effe8
✨ feat(timeline): clips play at a speed of their own

A clip gains a rate (`Speed`, thousandths of real time, 0.25x to 4x) and
every speed question is answered at the mapping seams that were already
there: `Clip::frames` is the source range divided by the rate, `end` is
built on it, and `map`/`span_at`/`composite_span_at` walk the offset
through `Speed::source_at`. `in_frame`/`out_frame` stay *source* frames,
so a trim and a split still address the file.

The picture needs no new decoder: the span says how many source frames it
reads, and `try_frame` brings the decoder's numbers back through the same
rate -- at 2x two decoded frames land on one timeline frame and the
display's drop-when-behind policy takes it from there. The sound is
resampled per segment inside the worker playback and the audio export
already share (linear interpolation, carried across packet seams), so the
pitch moves with the rate: tape, not pitch-preserve, and the card says so.
Each segment is told how much timeline it owes and pads or trims to it,
which is what keeps a run of speeded cuts from drifting.

Rounding is where a rate could break the lane, so it does not: `Speed::fit`
never hands a trim more source than its room holds, and `Speed::split_at`
refuses a cut a slow clip's rate cannot address rather than leaving two
halves that no longer add up. The fuzz sweeps set_speed in with the rest.

- card in the eq/colour pattern, on `j` and in the clip menu; a drag is one
  undo step for the whole linked group, 1.00x reachable by hand and by `r`
- clip boxes carry a "2.00x" mark, and their width, waveform and details
  row are the timeline length
- WAV/FLAC honour it; mp4 and AV1 *refuse* by name -- that path copies AAC
  packets and a resample is not a copy (ponytail names the upgrade path)
- .edith v8 carries the rate; v7 and older load at 1.00x
- `assets/test_speed_sync.mp4`: one flash, one beep, same instant. At 2x
  they still land together, to the frame.
🐛 fix(timeline): a pasted still never lands on the audio laneAhmet Kaan Gümüş · b586b85
🐛 fix(timeline): a pasted still never lands on the audio lane

`Project::paste` routed by `is_audio` alone, so a *copied* still clip --
the one door that does not go through `place_stream_at` -- was pasted as
a grouped take across `V1` and `A1`. The A1 half is a PNG the audio
worker demuxes: "file contains a box with a larger size than it", which
silences the whole session rather than that clip, and the save it writes
is one `open_project` then refuses by name. An `is_image` arm mirrors the
audio-only one.

Same-shape sweep of every clip-level door that routes by source kind:
- `Project::paste` (project.rs) -- this defect, fixed.
- `PlaybackSession::place_stream_at` -- already routed, image arm returns
  on the video lane before the audio fork.
- `PlaybackSession::open`/`open_project` -- both directions refused by
  name at load.
- `Project::move_to_lane` -- refuses a move across kinds, so no clip can
  cross by drag. Clean.
- `Project::place`, `split`, `regroup`, `lift`, `delete_in`, `trim` --
  the caller names the lane or the lane never changes. Clean, and the
  loader is the backstop for a hand-written file either way.
- `Player::insert_source` (app) -- guarded both ways already.

Falsification: with the `(_, true) => &[LaneKind::Video]` arm removed the
new test fails at the lane count (A1 1 -> 2), and with that assertion
lifted it fails on the WAV export with the demux error above -- the two
consequences the test names, both reachable.

Two doc corrections found with it: `Still::open` now says alpha is
dropped by `to_rgb8` (a transparent PNG lands opaque, with the blend as
the ponytail), and `first_audio_of` no longer implies an image-first
timeline accepts a later audio import -- it widens which source is
asked, not what "the timeline is silent" means.

tests: images 7/7 (new `pasting_a_copied_still_never_reaches_the_audio_lane`
asserts no A1 clip, no audio clip from a picture, the WAV export still
carries the sound, and the save reopens), engine lib 155, saveload 12,
audio_files 16, lanes 5 (serial), bin 56.
🔀 merge(main): library row menu meets the edge-trim source lengthsAhmet Kaan Gümüş · 5f60e19
🔀 merge(main): library row menu meets the edge-trim source lengths

Both sides appended a test at the same place in the app suite; both kept.

Seam: `PlaybackSession::counts` (the per-source frame lengths a trim is
walled by) is indexed exactly as `sources` is, and `remove_source` is the
one thing that shortens that list -- so it takes the matching count out
too. Left behind, the gone file's length walled the survivor and the next
import landed its count one index late, tripping `note_frames`'s
alignment assert.
🔀 merge(main): detach and group beside the colour drag and the edge trimAhmet Kaan Gümüş · 7cce619
🔀 merge(main): detach and group beside the colour drag and the edge trim

The one conflict is the test module's import list: both sides added names to
it, so the resolution is the union of the two.
🔀 merge(main): edge trim beside the colour drag on the root carriersAhmet Kaan Gümüş · dcd2d0f
🔀 merge(main): edge trim beside the colour drag on the root carriers

Both features hang a drag off the root's mouse-move and mouse-up, which is
where they collided. Kept both, in press-target order: equalizer, trim,
colour, scrub. They cannot overlap -- a gesture belongs to whatever was
pressed, and no two of those hitboxes are the same element.
✨ feat(timeline): a take detaches into halves and groups back togetherAhmet Kaan Gümüş · 0c00d5c
✨ feat(timeline): a take detaches into halves and groups back together

A music video's picture and its sound come apart on demand: Detach hands every
half of the group an id of its own, so each one selects, moves, trims and is
removed alone, and Group puts two clips covering the same frames back into one
take. Both are menu items and both are keys ("d" and ctrl+g), like every other
gesture here.

Engine: Project::ungroup(lane, idx) and Project::group(a, a_idx, b, b_idx), one
snapshot each, metadata only. A group id is one span on however many lanes
(links_are_consistent), so group refuses clips whose bounds disagree and names
the bounds to trim to; two clips of one lane, an index that is not there and a
pair that is already one take are refused in the engine's own words. Whatever
either side was grouped with is merged in, since all of it covers that span.

whole_take now reads the same rule on the picture as on the sound: a group id no
other lane carries is half a take on either lane, so Delete on a detached half
leaves the other half exactly where it is instead of rippling it away.
🐛 fix(timeline): a ripple-closed clip's head no longer overflows on grabAhmet Kaan Gümüş · affa0a3
🐛 fix(timeline): a ripple-closed clip's head no longer overflows on grab

`trim_room` read a clip's head room as `start - in_frame`, which assumes a
clip never carries more source in front of it than the timeline has room for.
A ripple delete leaves exactly that: cut at 5, delete the first piece, and
the survivor slides back to frame 0 still holding in-point 5. Grabbing its
left edge then subtracted with overflow -- a panic in debug on every pointer
sample of the drag, and a wrapped `lo` in release, which is a clamp that
means nothing.

Saturating, because frame 0 is the other wall that room was always bounded
by: a head can be pulled back to the start of the timeline and no further,
whatever the file still has behind it.
✨ feat(timeline): clips are trimmed by dragging their edgesAhmet Kaan Gümüş · 222336b
✨ feat(timeline): clips are trimmed by dragging their edges

A 6 px strip at each end of a clip box takes the press the body-drag would
otherwise take (gpui `occlude`), so one gesture stays one thing: an edge
trims, the middle still moves the clip to another lane, and both ends still
select and open the clip menu. The box follows the pointer while the button
is down and the engine hears about it once, at the release -- one edit, one
undo step for the whole drag, exactly as an equalizer gesture works.

`Project::trim` clamps rather than refuses: one frame of clip always
survives, an edge never crosses its neighbour on the lane, an in-point never
walks back past the source's first frame, and an out-point never runs past
the file's own last frame -- a clip ending past it is a project that will not
open again. `Project` does not know how long a file is, so `PlaybackSession`
now keeps the frame counts it already computes at every import and fills them
in. Linked halves trim together to one clamped edge, the tightest wall of the
group winning, because a link is one span on however many lanes.

`trim_room` is the same clamp without the mutation: the drag asks it where
the edge may land, so the width drawn is the width the release commits. A
timeline drawn to fit the window has no room past its own last frame, so
while a tail is dragged the bed is drawn out to as far as that tail may go --
without it the last clip could be pulled in and never let back out.
✨ feat(colour): sliders are dragged and the graded frame is drawn over themAhmet Kaan Gümüş · 8d8d880
✨ feat(colour): sliders are dragged and the graded frame is drawn over them

The colour card loses its stepper buttons: each row's bar is now pressed and
pulled straight to a value, which is what a slider is for. The press takes the
undo step and every sample after it is a live write (`set_color_live`), so a
whole drag is one `z` rather than one per pixel -- and because a live write
reseeks like any other edit, the picture regrades under the hand.

Above the rows, an RGB histogram of the frame on screen: counted off the BGRA
the decoder handed over, which is already through the grade, so pulling
brightness tilts the graph as it moves. Every 253rd pixel of a 1080p frame
(HIST_SAMPLES), 64 bins a channel, square-rooted so a flat black area does not
draw the rest as a line.

The arrow keys still move the same values, on the same 0.05 grid a drag snaps
to, and the bar is 4 px to look at but a whole row to hit.
✨ feat(library): a right-click on a media row opens its own menuAhmet Kaan Gümüş · 97d941e
✨ feat(library): a right-click on a media row opens its own menu

Add at playhead, Remove from library, Reveal in files and Properties,
built like the clip menu down to the scrim and the clamp -- a click away
or any stroke closes it.

Remove goes through a new `Project::remove_source`, which refuses by name
while clips still play from the file (the refusal names the lanes and how
many clips each holds), keeps the last entry standing, and renumbers every
clip that indexed past the one that went. It retires the undo stack: the
history holds lanes alone, so a snapshot older than the removal could name
a source that is gone -- the notice says so, and the ponytail names the
upgrade path.
✨ feat(timeline): the last clip deletes and the timeline emptiesAhmet Kaan Gümüş · 9a6ef81
✨ feat(timeline): the last clip deletes and the timeline empties

The never-empty-TIMELINE invariant is gone: an emptied timeline is now a
state of the model, not an edge case a refusal kept unreachable. Emptiness
is honest all the way down -- `PlaybackSession::span` is an `Option<Span>`
whose `None` *is* the empty timeline, and `start_span` feeds it one black
frame, so the viewer shows the nothing that is there rather than the last
picture of the clip that was deleted.

* `Project::lift` and `Project::ripple_delete` refuse only what is not an
  edit (a bad index, an empty range, a delete with nothing left to take --
  the last so a no-op still costs no undo step);
* `Project::from_parts` and the `.edith` loader take an all-empty project
  and refuse a *laneless* one instead, which is the invariant that was
  really being defended;
* `without_orphan_sources` keeps source 0 when no clip names anything: it
  carries the frame rate the timeline counts in, and pruning it wrote a
  project that could not be loaded back;
* the app's two "the timeline cannot be emptied" notices are gone, and an
  export of an empty timeline is refused by name instead of writing a file
  of no frames.

The never-empty-CLIP invariant (len >= 1) is untouched.
✨ feat(timeline): clips drag from one track to anotherAhmet Kaan Gümüş · 28fe52d
✨ feat(timeline): clips drag from one track to another

A clip already on the timeline is now a drag source, and a lane bed takes
one: dropped on another lane of the same kind it moves there, keeping the
timeline frames it covered, as a single undo step.

Its group id travels with it, which desyncs nothing -- a link means "one
span, however many lanes" and names no lane -- so a picture moved to V2 is
still the take its sound belongs to.

Refused by name rather than overwriting: a picture let go on an audio lane
(and the other way round), and a landing that would touch a clip already
there, which `place` would have painted over.
🐛 fix(engine,ui): paste respects lane kinds; bounds and rebind capture hardenedAhmet Kaan Gümüş · 11603ec
🐛 fix(engine,ui): paste respects lane kinds; bounds and rebind capture hardened

Four bugs a hunter sweep found, each with the door it comes in through:

- `Project::paste` put the clipboard clip in the first lane of *every* kind,
  so an audio-only clip copied off A1 landed on V1 too: a wav as a video
  source, a decode that fails, and a save the next open refuses. It now asks
  the source what it is, the same question `place_stream_at` asks an import,
  and reaches A1 only when there is no picture.
- The `resolution` line was applied unbounded while the keystroke capped at
  8K, so a crafted `resolution 4294967295 4294967295` panicked `open_black`
  with a capacity overflow. One bound now (`engine::is_resolution`) with both
  doors asking it, and the load door refuses by line like every other
  malformed line.
- `open_room` shifted starts unbounded, and the file format permits a clip
  ending at the very last frame: a paste wrapped it round to the front of the
  lane -- a debug panic, or in release an overlap no reload accepts. The edit
  door refuses the paste that would push anything past `u32::MAX`; the load
  bound stays where it is, since the wrap was the edit's to prevent.
- A rebind captured whatever gpui reported, so shift+= wrote `play +` and the
  next load threw the *whole* keybindings file away, losing every other
  rebind. Capture now takes only a chord the file can spell and read back, and
  a line the parser cannot use costs that line alone -- the magic line is the
  only thing that still refuses the file.
✨ feat(timeline): clips select from the keyboardAhmet Kaan Gümüş · cc90921
✨ feat(timeline): clips select from the keyboard

tab selects the clip under the playhead -- again for the next lane's --
and [ / ] walk the selection along its own lane, wrapping at both ends.
shift+tab stays unspellable (a chord carries only ctrl and parse refuses
an uppercase key), so the brackets are the pair.

One selection and not a second: every door -- click, right-click, all
three keys -- goes through Player::select, so the group-scoped tint a
click draws is the tint a key draws. Project::lane_clip_at is what the
walk asks, per lane, rather than the UI re-deriving where a clip ends.

This is what makes delete, lift, the equalizer and the grade reachable
with no pointer at all: the equalizer card had never been rendered live,
because nothing but a click could select the audio clip it needs.
✨ feat(engine): project resolution stands apart from media resolutionAhmet Kaan Gümüş · 19e294a
✨ feat(engine): project resolution stands apart from media resolution

A timeline had one resolution because its first source did: import refused
anything else by name, and there was nowhere to say otherwise. A project now
carries its own picture size and every clip is composed onto it, so media of
different resolutions share a timeline the way they do in any editor.

* scale::Composer is the one definition of that composition -- fit_rect,
  scale_i420, compose_i420 onto a black canvas -- and both playback and export
  call it, so what is written is what was watched. A canvas of the picture's
  own size is a pass-through that allocates nothing and touches no byte.
* Grade first, place second: a grade belongs to the clip's pixels at the
  resolution they were shot at, and the letterbox bars are not the clip.
* Per-clip fit policy (fit/fill/stretch/centre), one byte inline in Clip -- it
  lands in padding the clip already had.
* .edith v7: a `resolution <w> <h>` line and a fit word per clip line. v6..v1
  still load, defaulting to source 0's picture and Fit, which is what those
  projects always meant.
* The fps refusal stays: mixing frame rates is resampling the timeline, a
  different problem, and a refusal is the honest answer until it is solved.
* UI: `p` cycles the fit policy of the clip on screen (and a clip-menu item),
  ctrl+r cycles the project resolution through the usual sizes with the media's
  own among them, and the export card says which size it writes.
✨ feat(video): per-clip color grade is live in render and exportAhmet Kaan Gümüş · bd89527
✨ feat(video): per-clip color grade is live in render and export

The grade a clip carries now reaches the picture. `Project::composite_clip_at`
names the clip the composite shows at a frame and `composite_color_at` its
grade, so playback's decode worker (folded into `i420_to_bgra_with`, free in
the loop that was reading those samples anyway) and the export's encoder (onto
per-span scratch, since the planes are borrowed) grade from one answer.

`PlaybackSession::set_color` is an edit like any other, so it reseeks -- which
is what repaints the frame already on screen, paused or playing.

The card: `k` (or the clip menu's Colour…) opens four sliders on the selected
video clip, or on the clip under the playhead when nothing is selected, so it
is reachable with no pointer at all. Arrows pick and move a slider, r resets,
esc closes; a slider walked back to the middle takes the grade off, which keeps
an ungraded project byte-identical -- verified: the same two-clip export before
and after this slice is md5 98522c19cefac2f7851b51de6416a493 both times.
✨ feat(audio): per-clip equalizer is live in playback and exportAhmet Kaan Gümüş · 4d92155
✨ feat(audio): per-clip equalizer is live in playback and export

The model, the format and the filter have all existed with no callers. This
wires them: `Project::audio_eqs_from` hands one curve per segment beside the
play list `audio_segments_from` already builds, `open_mixed_streams_eq` gives
each lane's worker those curves, and `emit` -- the one place both readers hand
their samples over -- filters a segment after it is trimmed and before it is
sent. Playback and an audio export therefore get the same filtered stream by
construction rather than by two call sites agreeing.

A parallel list, not a fourth element of the segment tuple: that tuple is what
every opener, the packet-copy path and a dozen tests speak, and an effect is not
part of which samples a segment names. A short list plays flat, so a mismatch
can neither panic nor shift a curve onto the wrong clip.

Live editing needs no channel into a running worker: `set_eq` is an edit and
every edit reseeks, so the workers are rebuilt from the new curves where the
playhead is standing.

An mp4 export copies AAC packets and no filter can reach a copy, so an
equalized clip is refused by name and by timecode rather than written flat.

The card is the third of its kind (same scrim, width and rows as keys and
export): a row per band, dragged from the middle out, with `q` to open it and
1-5 / up / down / r as its own keyboard, every one of them listed in the keys
menu by the registry the guard test reads.
✨ feat(timeline): every lane draws and tracks can be addedAhmet Kaan Gümüş · 30e8aae
✨ feat(timeline): every lane draws and tracks can be added

The panel drew V1 and A1 and nothing else, so the N-lane model, the
composite playback and the v6 format had no way into the window. It now
draws a row per project lane, labelled from Lane::label, and grows the
panel per row up to a cap past which the lane column scrolls.

+ V / + A -- and the v / a chords, in the registry so the keys menu lists
them -- add a track; undo takes one back like any other edit.

The V1/A1 pinning the last two slices flagged is gone: delete_clip takes
the lane its index belongs to (Project::delete_in), a drop names the lane
it was let go over (place_stream_at's onto), and whole_take decides
ripple-or-lift per lane -- a clip on an added track is a layer and is
lifted, while the first pair keeps exactly the semantics it had.
Project::paste now inserts into V1/A1 only while still opening room
everywhere, or an Add with three lanes would have played one sound twice.

The export card greys MP4 out with its reason when more than one audio
lane carries sound, on the row and on the m chord both, so the engine's
refusal arrives before a destination is picked.
✨ feat(engine): per-clip color persists in .edith v6Ahmet Kaan Gümüş · 0530fc9
✨ feat(engine): per-clip color persists in .edith v6

A clip names a colour grade the way it names an equalizer: an index into an append-only Project table, deduped on set, pruned at save, inherited by both halves of a split and carried by copy, paste and undo.

The file format grows a color <b>:<c>:<s>:<t> line and a 7th clip field; v5..v1 still load and every one of them re-saves as v6. Clip grew from 32 to 40 bytes -- the eq index fit the padding hole, the colour one did not.
✨ feat(engine): N-lane compositing in playback and exportAhmet Kaan Gümüş · 08af6bc
✨ feat(engine): N-lane compositing in playback and export

Video: the topmost video lane with a clip there wins, topmost being the last
lane in display order (V2 over V1, the overlay convention). No blending, so
exactly one lane is visible per frame and the composite is itself a span list
-- Project::composite_span_at -- which one decoder plays. N video lanes never
mean N decoders; a lane change costs the one decoder reopen a cut already
costs.

Audio: every audio lane that holds something gets a play list
(Project::audio_segments_from) and AudioSession::open_mixed_streams sums them,
clamped, each lane keeping its own gap rule so the master clock counts a sample
per sample of timeline. One lane skips the mixer entirely and is the byte-for-
byte path it always was.

Export walks the same composite and mixes the same lanes for WAV/FLAC. The mp4
path copies AAC packets and cannot mix, so a timeline whose sound is spread
over two lanes is refused there by name rather than silently exported without
half of it.
✨ feat(engine): per-clip EQ persists in .edith v5Ahmet Kaan Gümüş · 782fc53
✨ feat(engine): per-clip EQ persists in .edith v5

A clip names its equalizer by index into a project-level table, the way it
already names its source: `Clip` stays `Copy`, so a split hands both halves the
same settings, a clipboard copy carries them and an undo restores whichever
index the clip had. The table is append-only within a session -- an index on a
clipboard clip or in an undo snapshot can never dangle -- and only a save prunes
it, exactly as an undone import leaves its source entry behind.

The file grows `eq <band>...` lines (freq:gain:q:shape, printed `{:?}` so every
f32 comes back bit for bit) and one more clip field naming one of them. v4, v3,
v2 and v1 still load and re-save as v5.