refactor(studio): split the track header's lane math out of its JSX

The header file owned value sampling, readout formatting, lane-state
resolution and the JSX at once, so a formatting change and a layout change
edited the same file. Sampling and formatting now live in
trackHeaderLaneValues, lane-state resolution in trackHeaderLaneState, and
resolveLaneHeaderState returns only the four fields its caller reads.

Also shows the track's clip count next to the track identity, which the
header promised but never rendered.
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-27 19:52:06 +02:00
parent c264cf266f
commit 4ac57a5845
6 changed files with 287 additions and 227 deletions
@@ -1,16 +1,19 @@
import { CaretRight } from "@phosphor-icons/react";
import type { TimelineElement } from "../store/playerStore";
import { LABEL_COL_W, TRACK_H } from "./timelineLayout";
import { TrackClipCount } from "./TrackClipCount";
// Layer row (Figma order: disclosure ▸/▾, diamond, name) — the disclosure lives
// here, not on the clip bar, and re-expands a collapsed layer.
export function LayerDisclosureRow({
keyframeClip,
clipCount,
isExpanded,
gutterBackground,
onToggleClipExpanded,
}: {
keyframeClip: TimelineElement;
clipCount: number;
isExpanded: boolean;
gutterBackground: string;
onToggleClipExpanded: () => void;
@@ -53,6 +56,7 @@ export function LayerDisclosureRow({
<span className="min-w-0 flex-1 truncate font-medium" title={name}>
{name}
</span>
<TrackClipCount clipCount={clipCount} />
</div>
);
}