Repository navigation
fix(studio): messages that count clips or keyframes say 1 clip, not 1 clips - #7496
Conversation
Edit accuracy: accurate 267 (base branch 267), smooth 101 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
There was a problem hiding this comment.
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.
What
Messages that count clips or keyframes now say "1 clip" and "2 clips" instead of "1 clips":
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 inpackages/studio/src/utils/countOf.tsreturns the count with its word, plural only when the count is not 1. The four sentences call it. No other wording changes.Test plan
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 threeuseRazorSplittest files anduseGestureCommit.test.tsx, 40 tests in 6 files, all pass. The studio typecheck (tsc --noEmit) passes, andoxfmt --checkandoxlintare 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
After
Size
About 60 lines: a wording fix in four messages with its tests. No open Studio PR touches these sentences to carry it.