Skip to content

Commit 46ca2f3

Browse files
vanceingallsclaude
andcommitted
feat(studio): wrap gutter names instead of truncating them
A truncated name needs a hover to be read at all, and a tooltip is no use for a name you are scanning a column of. All three gutter labels — the plain track header, the group header, and the keyframe layer row — now wrap and drop their `title`. `break-words` so a long single token breaks rather than forcing the column wider. Measured at the 232px gutter: a name long enough to wrap takes two lines (28px) inside the 48px row with room to spare; a third line would overflow, which is what the row affords either way. One test located the name by its `title` and now reads the rendered text. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent b6e5afd commit 46ca2f3

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

‎packages/studio/src/player/components/LayerDisclosureRow.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ export function LayerDisclosureRow({
9595
<span aria-hidden="true" className="shrink-0 text-[13px] leading-none text-white/40">
9696
◇
9797
</span>
98-
<span className="min-w-0 flex-1 truncate font-medium" title={name}>
99-
{name}
100-
</span>
98+
{/* Wraps rather than truncating: a truncated name needs a hover to be
99+
read, which a scanned column cannot rely on. */}
100+
<span className="min-w-0 flex-1 break-words font-medium leading-tight">{name}</span>
101101
<TrackClipCount clipCount={clipCount} />
102102
{children}
103103
{/* Anchored right, on every header that has one: the lane toggle is the

‎packages/studio/src/player/components/TimelineGroupHeader.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ function GroupNameButton({
6565
<span aria-hidden="true" className="shrink-0 text-[12px] leading-none text-white/50">
6666
▤
6767
</span>
68-
<span className="min-w-0 truncate font-medium">{label}</span>
68+
{/* Wraps rather than truncating — a name that needs a hover to be read
69+
is no use in a column you scan. */}
70+
<span className="min-w-0 break-words text-left font-medium leading-tight">{label}</span>
6971
<span
7072
className="shrink-0 rounded-full bg-white/10 px-1 text-[9px] leading-[14px] tabular-nums text-white/55"
7173
aria-hidden="true"
@@ -107,7 +109,7 @@ export function TimelineGroupHeader({
107109
}}
108110
>
109111
{/* One line, like a track header's: caret and name, then every control
110-
anchored to the right edge. The name truncates and the controls are
112+
anchored to the right edge. The name wraps and the controls are
111113
`shrink-0`, so they hold the edge and the name gives way — no second
112114
line needed to keep five controls off the label. */}
113115
<button

‎packages/studio/src/player/components/TimelineTrackHeader.test.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,15 +747,17 @@ describe("TimelineTrackHeader", () => {
747747
it("names the header for the track, not for one of the clips on it", () => {
748748
const view = renderHeader({ ...ROW, keyframeClip: NARRATION_2 });
749749
expect(view.host.textContent).not.toContain("narration-2");
750-
expect(view.host.querySelector('[title="Track 1"]')?.textContent).toBe("Track 1");
750+
// Asserted on the rendered text, not a `title`: the name wraps now rather
751+
// than truncating, so it no longer carries a tooltip to be found by.
752+
expect(view.host.textContent).toContain("Track 1");
751753
// Alone on the track it is still named for itself.
752754
view.rerender({
753755
...ROW,
754756
keyframeClip: NARRATION_2,
755757
trackElements: [NARRATION_2],
756758
clipCount: 1,
757759
});
758-
expect(view.host.querySelector('[title="narration-2"]')?.textContent).toBe("narration-2");
760+
expect(view.host.textContent).toContain("narration-2");
759761
act(() => view.root.unmount());
760762
});
761763
});

‎packages/studio/src/player/components/TimelineTrackPlainHeader.tsx‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,16 @@ export function PlainTrackHeader({
8989
{isAudioTrack && (
9090
<Music size={12} weight="fill" aria-hidden="true" className="text-white/35" />
9191
)}
92-
{/* No `flex-1`: the name takes only the width it needs (still
93-
truncating at `min-w-0` when the row is narrow) so the clip count
94-
sits against it rather than being pushed out to meet the controls.
95-
The slack goes to the `ml-auto` group below instead. */}
92+
{/* No `flex-1`: the name takes only the width it needs, so the clip
93+
count sits against it rather than being pushed out to meet the
94+
controls. The slack goes to the `ml-auto` group below instead.
95+
96+
Wraps rather than truncating: a truncated name needs a hover to be
97+
read at all, and a tooltip is no use to a name you are scanning a
98+
column of. `break-words` so a long single token breaks instead of
99+
forcing the column wider. */}
96100
{showTrackLabel && (
97-
<span className="min-w-0 truncate text-[11px]" title={trackLabel}>
98-
{trackLabel}
99-
</span>
101+
<span className="min-w-0 break-words text-[11px] leading-tight">{trackLabel}</span>
100102
)}
101103
{showTrackLabel && <TrackClipCount clipCount={clipCount} />}
102104
{/* `ml-auto` is what anchors the group right: it absorbs the slack the

0 commit comments

Comments
 (0)