-
-
Notifications
You must be signed in to change notification settings - Fork 149
fix(insertions): the deleted word stayed in the transcript #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -179,6 +179,35 @@ describe("removeGeneratedClips", () => { | |||||||
| }); | ||||||||
| }); | ||||||||
|
|
||||||||
| describe("deleting the amber clip from the TIMELINE, not from the transcript", () => { | ||||||||
| // The trash icon on the clip calls `removeClip`, and so does the agent's tool. Neither | ||||||||
| // goes through `removeGeneratedClips`, so if the media were only dropped there, the | ||||||||
| // deleted word would still be in the transcript pane and its file still on disk. | ||||||||
| it("takes the generated media with it, like the transcript path does", () => { | ||||||||
| const back = removeClip(withInsertion(), "ext:synth_1"); | ||||||||
| expect(back.assets.map((a) => a.id)).toEqual(["a1"]); | ||||||||
| expect(back.transcripts.map((t) => t.assetId)).toEqual(["a1"]); | ||||||||
| }); | ||||||||
|
|
||||||||
| it("leaves the recording in the document when its LAST clip goes", () => { | ||||||||
| // Why the sweep is scoped to generated ids rather than "anything nothing plays": | ||||||||
| // `restoreFullTimeline` reads the primary asset's duration, so emptying the | ||||||||
| // timeline must not take the recording with it or the button has nothing to | ||||||||
| // restore. This is the branch that empties it. | ||||||||
| const back = removeClip(doc(), "c1"); | ||||||||
| expect(back.timeline.clips).toEqual([]); | ||||||||
| expect(back.assets.map((a) => a.id)).toEqual(["a1"]); | ||||||||
| }); | ||||||||
|
|
||||||||
| it("leaves generated media alone when an ORDINARY clip goes and the insertion stays", () => { | ||||||||
| // The other way an over-eager sweep goes wrong: a delete somewhere else must not | ||||||||
| // collect media that is still on the timeline. | ||||||||
| const back = removeClip(withInsertion(), "c1"); | ||||||||
| expect(back.timeline.clips.some((c) => c.assetId === "ext:synth_1")).toBe(true); | ||||||||
| expect(back.assets.map((a) => a.id)).toEqual(["a1", "ext:synth_1"]); | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Assert that the generated transcript remains. The ordinary-clip control checks the generated asset and clip, but it does not check the generated transcript. If cleanup removes the transcript while the asset remains, this test still passes. Add an assertion for Proposed fix expect(back.assets.map((a) => a.id)).toEqual(["a1", "ext:synth_1"]);
+ expect(back.transcripts.some((t) => t.assetId === "ext:synth_1")).toBe(true);📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||
| }); | ||||||||
| }); | ||||||||
|
|
||||||||
| describe("the join is blind to what made the clips contiguous", () => { | ||||||||
| it("also heals two halves when an ORDINARY clip between them goes", () => { | ||||||||
| // The accepted cost of the rule, on the record. Two clips of one recording whose media | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.