feat(desktop): transcript editing - soft delete with ability to restore, deleted words buffers, pause deletion#1880
Open
ganganimaulik wants to merge 37 commits into
Conversation
… ripple editing support
…uct initialization
…ctions, and deleted word shifting
This fixes a boundary math flaw where restoring a word could cause adjacent words exactly at the insert point to stretch their durations instead of simply shifting right, gradually desyncing the timeline.
… for word deletion
- Passing explicit ignoreWords lists to shiftCaptionTimesAfterCut and shiftCaptionTimesAfterInsert - Prevents deleted words from being shifted by their own cut durations if buffer values are negative - Ensures proper tracking of _markForRemoval for restoring words
… clean newly formed gaps
…g timeline adjustments
…acking and insertion
… gap deduplication
…words before anchor
…ct timeline and prevent pause blocks
…econstruct timeline and prevent pause blocks" This reverts commit dfa8dfe.
…ive buffers without desync or pause blocks
…xtended does not have storedEnd, causing NaN timeline corruption
…y search with findIndex in activeWordIndex to support perfect reverse timeline math without pause block corruption
… insertDuration calculation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
right click on deleted word:

This pull request implements comprehensive transcript editing tools for the Cap desktop editor, introducing word/pause deletion, adjustable speech buffers, timeline-wide ripple editing, and an automated "Auto Clean" feature with batch undo/redo.
Key Features
Soft Word Deletion & Restoration
deleted: true) rather than splicing them out.Adjustable Word Buffers (Buffer Popover)
bufferStartandbufferEnd(from-0.5sto1.0s) around any deleted word by right-clicking it.Pause Detection & Deletion
⏸ 1.2s).Auto-Clean with Batch Undo
uh,um,ah,er,hmm,mhm) and pauses exceeding a configurable silence threshold.Greptile Summary
This PR introduces a comprehensive transcript editing layer on top of the existing caption system: words can be soft-deleted (marked
deleted: true) and later restored with full ripple edits across all timeline tracks, pauses between words are surfaced as interactive inline badges, adjustable pre/post buffers let users fine-tune how much silence is removed around each deleted word, and an Auto Clean button batch-deletes filler words and long silences in one click. The Rust backend is updated to carry the new metadata fields through serde and to filter deleted words from the rendered caption output.applyWordDeletionsmarks words deleted and runsrippleDeleteAllTracks;restoreWordsreverses this by inserting the original cut duration back withrippleInsertAllTracks. Timing math is correct when restoring multiple words because processing happens in chronological order so each word's stored position already reflects prior restorations.pausesmemo computes silent gaps between visible words and rendersPauseBadgecomponents;handleDeletePauseinserts a synthetic pause word (alwaysdeleted: true) and performs the ripple cut — these words are filtered from the Rust renderer by the!w.deletedguard.Confidence Score: 4/5
Safe to merge; the ripple-edit math is sound and no data-corruption paths were found.
The core timeline arithmetic is correct and well-covered by inline vitest tests. The four flagged items are all non-blocking: a pause-badge inaccuracy under non-default buffer values, a missing click-outside handler, a misleading variable name/comment, and potentially surprising Backspace behavior on mixed selections. None corrupt project data.
apps/desktop/src/routes/editor/TranscriptPage.tsx contains all four flagged items and is worth a close read before merging.
Important Files Changed
Comments Outside Diff (1)
apps/desktop/src/routes/editor/TranscriptPage.tsx, line 199-254 (link)deletedDurationInGapformula for non-zero buffersprotectedStart = Math.max(0, -bufStart)only contributes whenbufStartis negative (i.e., the cut is smaller than the word). For the common positive-buffer case — where the actual cut extends beyond the word — nothing is added, sodeletedDurationInGapundercounts bybufferStart + bufferEnd. This meanssilentGap = gap - deletedDurationInGapends up larger than the real remaining silence, causing false pause badges to appear between deleted words whenever a user has adjusted buffers to positive values.The effective deleted duration is
curr.storedEnd + bufEnd - Math.max(0, curr.start - bufStart), which should replace the current formula.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix: remove timeline clamping in handleB..." | Re-trigger Greptile