Repository navigation
refactor: move caption word utilities into cap-project - #3295
Merged
richiemcilroy merged 6 commits intoOct 26, 2026
Merged
Conversation
) caption_text_from_words, the attach-to-previous helpers, normalize_caption_words, caption_word_chunks and the segment size constants were copy-pasted across captions.rs (tauri), transcription.rs (gpui), editor_window.rs (gpui) and caption_timing.rs, and the copies had drifted. They now all consume the single set in cap_project::caption_words. One behavior change: the weak-word boundary check on the Tauri side compared byte length (normalized.len() <= 1), so non-ASCII one letter words like "à" counted as two letters there. The shared version compares chars().count(), matching what CapSoftware#2685 landed in the gpui backend.
Drop the Tauri app changes (apps/desktop no longer ships), the module comment and the comment restating normalize_caption_words, and correct the caption_word_chunks doc: the short tail merge can put a segment over the max, so the doc no longer promises a hard cap.
Contributor
|
@Ker102 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
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.
Sorry for the noise, I put the first version of this up from the wrong account (#3278), it was supposed to go here.
Moves the caption word utilities (caption_text_from_words, the attach-to-previous helpers, normalize_caption_words, caption_word_chunks, and the segment size constants) into cap_project::caption_words and points everything at it. The copies had drifted apart, details in #3290.
Pure refactor: apps/desktop keeps its own copy since that app no longer ships, and the shared module keeps the gpui behavior throughout (the weak-word boundary check compares chars, the #2685 fix). Also folds in the f64 copy of MAX_CAPTION_WORD_DURATION from crates/rendering/src/layers/captions.rs, which now derives from the shared const instead of a comment asking people to keep it in sync.
Tested:
everything ran in an ubuntu 24.04 container with the repo's toolchain.
Closes #3290


Confidence Score: 5/5
The PR appears safe to merge.Summary
Moves caption word helpers and limits into
cap_project::caption_words.Reviews (1) · Last reviewed commit: "fix: address review notes on the shared ..." · Reviewed by Greptile