Repository navigation
Conversation
Adds a segmentWords caption setting (1-8, default 6) that controls how many words a generated caption segment holds, threaded from the captions panels through both transcription pipelines into the shared chunker. At 1 the chunker switches to the one word on screen at a time style: every word becomes its own segment and the multi-word rules (weak boundary extension, short tail merge) are bypassed. Above 1 the existing rules apply relative to the chosen size, so the default of 6 reproduces current behavior exactly. Settings surface: cap_project::CaptionSettings.segmentWords (JSON segmentWords), a Words Per Caption slider in the Tauri editor's captions tab and in the gpui captions sidebar, and the tauri transcribe_audio command gains an optional segmentWords argument.
|
@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. |
| #[serde(alias = "segmentWords")] | ||
| pub segment_words: u32, |
There was a problem hiding this comment.
Adding segment_words breaks the cap-desktop build. The CaptionSettings initializer in apps/desktop/src-tauri/src/captions.rs:1844–1867 lists every field explicitly but omits this new field, so Rust rejects it. That crate remains a workspace member. Update its initializer alongside this shared type, even though the new slider is GPUI-only.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/project/src/configuration.rs
Line: 2358-2359
Comment:
**Desktop build fails**
Adding `segment_words` breaks the `cap-desktop` build. The `CaptionSettings` initializer in `apps/desktop/src-tauri/src/captions.rs:1844–1867` lists every field explicitly but omits this new field, so Rust rejects it. That crate remains a workspace member. Update its initializer alongside this shared type, even though the new slider is GPUI-only.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.) Drop the apps/desktop (Tauri) feature changes, the app no longer ships. Fix the GPUI test targets: verify_tests and the parakeet benchmark now pass a segment size to the reshaped functions. Gate the caption_word_chunks and MAX_CAPTION_WORD_DURATION imports behind cfg(test), only the tests use them. The Words Per Caption slider now seeds the captions block when the project has none, so the size can be picked before the first transcription. cap-desktop keeps building: its CaptionSettings initializer fills segment_words from the settings object, and the legacy serializer keeps the key on round-trip.
8eebbed to
c4a62c7
Compare
|
good catch, that initializer was covered in the first version of this and got dropped with the rest of the Tauri changes. fixed now: the initializer fills segment_words from the settings object and the legacy serializer keeps the key on round-trip, so the shared type change doesn't cost the old app any saved settings. cargo check -p cap-desktop is green for me locally. ready for another look. |
|
greptile re-review |
|
@greptile review |
Sorry for the noise, I put the first version of this up from the wrong account (#3284), it was supposed to go here.
Adds a segmentWords caption setting, 1 to 8, default 6, so words on screen at once is configurable instead of the hardcoded constants. Covers #3291.
How it behaves: at 1 you get the one word at a time style, every word its own segment, and the multi-word rules (weak boundary extension, short tail merge) are bypassed. Above 1 the same rules apply relative to the size you pick, and the default of 6 reproduces today's behavior exactly.
What changed since the review on #3284:
Presets instead of a free number is still open for discussion in #3291, this just exposes the raw knob.
Tested:
everything ran in an ubuntu 24.04 container with the repo's toolchain.
Stacked on #3295. Closes #3291


Confidence Score: 5/5
The PR appears safe to merge; the previous build issue is fixed and no new actionable issues were found.Summary
Adds a saved
segmentWordssetting and a GPUI slider for choosing 1–8 words per generated caption.Reviews (2) · Last reviewed commit: "fix: address review notes on the segment..." · Reviewed by Greptile