Skip to content

fix(studio): messages that count clips or keyframes say 1 clip, not 1 clips - #7496

Merged
miguel-heygen merged 2 commits into
mainfrom
oncall/clip-count-words
Nov 10, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
oncall/clip-count-words

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

What

Messages that count clips or keyframes now say "1 clip" and "2 clips" instead of "1 clips":

  • A timeline Delete the server refuses: "Failed to delete 1 clip from index.html" (was "1 clips"). A single-clip delete goes through the same request as a multi-clip one, so this is the message most people see.
  • Grouping fewer than two audio clips: "Cannot group 1 clip: a group needs at least two" (was "1 clip(s)").
  • The split toast: "Split 1 clip at 2.00s" (was "1 clips").
  • The gesture recording toast: "Recorded 1 keyframe" (was "1 keyframes").

Why

Each of these sentences put a count before a fixed plural word, so a count of 1 read wrong.

Related work

None.

How

A small countOf(n, word) helper in packages/studio/src/utils/countOf.ts returns the count with its word, plural only when the count is not 1. The four sentences call it. No other wording changes.

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

New tests:

  • useTimelineDeleteOps.test.tsx › "a refused delete names its count: 1 clip, 2 clips": the server refuses the removal for one clip, then for two. The toasts read "Failed to delete 1 clip from index.html", then "Failed to delete 2 clips from index.html".
  • countOf.test.ts › "names one thing in the singular and two in the plural".

Fails without the fix: with the four sentences put back to main's wording (tests kept), useTimelineDeleteOps.test.tsx › "a refused delete names its count: 1 clip, 2 clips" fails, receiving "Failed to delete 1 clips from index.html"; the other 11 tests in that file pass.

With the fix: countOf.test.ts, useTimelineDeleteOps.test.tsx, the three useRazorSplit test files and useGestureCommit.test.tsx, 40 tests in 6 files, all pass. The studio typecheck (tsc --noEmit) passes, and oxfmt --check and oxlint are clean on the changed files.

In the editor: Studio's dev server on a two-clip project (one clip 0 to 4 s, the next 4 to 8 s), Razor tool, Shift-click the first clip near 1 s so the split reaches only that clip. The message reads "Split 1 clips at 0.99s" on main and "Split 1 clip at 0.99s" here (captures below).

Not exercised: the gesture and group messages at a count of 1 in the editor (they use the same helper the tests cover).

Before

Before: the split message reads Split 1 clips at 0.99s

After

After: the split message reads Split 1 clip at 0.99s

Size

About 60 lines: a wording fix in four messages with its tests. No open Studio PR touches these sentences to carry it.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 101 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (1)

  • seqplainkeys-none-pct-r0-nested-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head a861f893

The Fails without the fix: claim checks out. With the delete message put back to ${sameFile.length} clips, "a refused delete names its count: 1 clip, 2 clips" fails, receiving "Failed to delete 1 clips from index.html", and the other 11 tests pass. With the fix, countOf.test.ts and useTimelineDeleteOps.test.tsx pass (13 tests). Nothing in packages/*/src matches the old wording, so no caller breaks. CI is green.

Scope

I read the whole diff (7 files). Studio has no shared plural helper to reuse; other sites spell out n === 1 ? "" : "s" inline, and those are out of scope here.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit ec30de0 Nov 10, 2026
123 of 124 checks passed
@miguel-heygen
miguel-heygen deleted the oncall/clip-count-words branch November 10, 2026 12:53
@miguel-heygen miguel-heygen mentioned this pull request Nov 10, 2026
3 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant