Repository navigation
Conversation
|
@tmaostats is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
A preset stores the whole project config, so `captions.segments`, `captions.settings` and `captions.sourceTimed` travelled with it in both directions: - Saving a preset captured the recording's transcript, so applying that preset to another recording overwrote its caption text with the first recording's words. - Applying a preset whose config had no captions (the built-in Default preset) replaced the recording's captions wholesale with `null`, losing its saved caption source. Captions are two things at once: styling that belongs to the project and a transcript that belongs to the recording. Only the first should cross a preset boundary. - `preset_config` now strips `captions.segments` (and the source-timing flag that describes them) before storing a preset, keeping the styling. - `apply_preset` keeps the current segments, word timings and `sourceTimed`, and takes only `captions.settings` from the preset. A preset without captions leaves the recording's captions untouched. - The Tauri editor's `createPreset`/`applyPreset` mirror the same rules via `keptCaptions`, so presets stay interchangeable between the two apps. Tests in `presets.rs` cover saving, applying over an existing transcript, and applying a captions-less preset. Fixes CapSoftware#3310
cad9277 to
df3e82f
Compare
| let captions = kept_captions(next.captions.as_ref(), current.captions.as_ref()); | ||
| next.captions = captions; |
There was a problem hiding this comment.
Default still deletes captions
The new merge runs only for saved presets. GPUI's apply_default_preset still replaces the project with a fresh config without keeping its captions. Tauri's applyDefaultPreset does the same. Users who apply Default therefore still lose their saved caption source, leaving one of this fix's stated cases broken. Route both Default actions through the caption-preserving merge.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/presets.rs
Line: 172-173
Comment:
**Default still deletes captions**
The new merge runs only for saved presets. GPUI's `apply_default_preset` still replaces the project with a fresh config without keeping its captions. Tauri's `applyDefaultPreset` does the same. Users who apply Default therefore still lose their saved caption source, leaving one of this fix's stated cases broken. Route both Default actions through the caption-preserving merge.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| captions: preset.config.captions | ||
| ? { ...preset.config.captions, segments: [], sourceTimed: false } | ||
| : null, |
There was a problem hiding this comment.
Updated presets still copy words
Only createPreset strips the transcript. The “Save settings to preset” action calls saveToPreset, which still stores the project's full captions. When that preset is selected as the default, Tauri uses its config directly for the next recording, copying the old recording's words into it. Apply the same stripping in saveToPreset, preferably through one shared helper.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/utils/createPresets.ts
Line: 60-62
Comment:
**Updated presets still copy words**
Only `createPreset` strips the transcript. The “Save settings to preset” action calls `saveToPreset`, which still stores the project's full `captions`. When that preset is selected as the default, Tauri uses its config directly for the next recording, copying the old recording's words into it. Apply the same stripping in `saveToPreset`, preferably through one shared helper.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…ates Two paths the first pass missed (greptile review): - GPUI apply_default_preset and Tauri applyDefaultPreset rebuilt the config from Cap defaults and kept only timeline/overlay/clips, so the built-in Default row still wiped the recording's saved caption source. Both now carry the current captions over, like any other preset without caption data. - Tauri saveToPreset (Save settings to preset) stored the project's full captions, so updating a preset re-introduced the transcript the creation path now strips. The strip logic moves into a shared storedPresetConfig helper used by both createPreset and saveToPreset.
|
Both points addressed in dfa3664:
|
| }), | ||
| }; | ||
| } | ||
| aW1wb3J0IHsgcHJvZHVjZSB9IGZyb20gInNvbGlkLWpzL3N0b3JlIjsNCmltcG9ydCB7IHByZXNldHNTdG9yZSB9IGZyb20gIn4vc3RvcmUiOw0KaW1wb3J0IHR5cGUgeyBQcmVzZXRzU3RvcmUsIFByb2plY3RDb25maWd1cmF0aW9uIH0gZnJvbSAifi91dGlscy90YXVyaSI7DQoNCmV4cG9ydCB0eXBlIENyZWF0ZVByZXNldCA9IHsNCgluYW1lOiBzdHJpbmc7DQoJY29uZmlnOiBPbWl0PFByb2plY3RDb25maWd1cmF0aW9uLCAidGltZWxpbmUiPjsNCglkZWZhdWx0OiBib29sZWFuOw0KfTsNCg0KdHlwZSBQcmVzZXRDYXB0aW9ucyA9IFByb2plY3RDb25maWd1cmF0aW9uWyJjYXB0aW9ucyJdOw0KDQovKioNCiAqIFdoYXQgYSBwcmVzZXQgc3RvcmVzOiB0aGUgcHJvamVjdCdzIHN0eWxpbmcgd2l0aCB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lUHJlc2V0OiAoaW5kZXg6IG51bWJlciwgbmFtZTogc3RyaW5nKSA9Pg0KCQkJdXBkYXRlUHJlc2V0cygoc3RvcmUpID0+IHsNCgkJCQlzdG9yZS5wcmVzZXRzW2luZGV4XS5uYW1lID0gbmFtZTsNCgkJCX0pLA0KCQlzYXZlVG9QcmVzZXQ6ICgNCgkJCWluZGV4OiBudW1iZXIsDQoJCQljb25maWc6IE9taXQ8UHJvamVjdENvbmZpZ3VyYXRpb24sICJ0aW1lbGluZSI+LA0KCQkpID0+DQoJCQl1cGRhdGVQcmVzZXRzKChzdG9yZSkgPT4gew0KCQkJCXN0b3JlLnByZXNldHNbaW5kZXhdLmNvbmZpZyA9IHN0b3JlZFByZXNldENvbmZpZyhjb25maWcpOw0KCQkJfSksDQoJfTsNCn0NCg== No newline at end of file |
There was a problem hiding this comment.
P1: Source files are replaced with opaque base64 blobs, hiding changes from review
Three source files are replaced by single base64 blobs, hiding 14k+ lines from review and leaving non-compiling source.
Commit the plaintext UTF-8 source for createPresets.ts, PresetsDropdown.tsx, and editor_window.rs; never merge encoded source blobs.
AI prompt
Check if this security scanner issue is valid. If so, understand the root cause and fix it. If appropriate, update or add tests. Keep the change focused and preserve intended behavior.
<file name="apps/desktop/src/utils/createPresets.ts">
<violation number="1" location="apps/desktop/src/utils/createPresets.ts:1">
<priority>P1</priority>
<title>Source files are replaced with opaque base64 blobs, hiding changes from review</title>
<evidence>The PR deletes all 76 plaintext lines of createPresets.ts and adds a single line containing a full-file base64 blob. The same pattern replaces all 206 lines of PresetsDropdown.tsx and all 14,087 lines of apps/desktop-gpui/src/editor_window.rs with one encoded line each (the editor blob decodes to roughly 578 KB). Normal reviewers see no source lines, only an opaque encoded payload. Decoding the blobs currently yields the described preset/caption changes, but the diff cannot be reviewed as code, and the encoded files are not valid Rust/TypeScript, so a merge breaks the GPUI and Tauri desktop builds. Base commit 5fcf8e9 carried these files as plaintext and had no encoding/decoding step.</evidence>
<recommendation>Replace each base64 blob with the decoded plaintext source using the repository's normal LF line endings, then re-run the desktop and GPUI builds/tests. Do not approve or merge until the PR diff shows ordinary source lines and reviewers can verify the complete change.</recommendation>
</violation>
</file>
|
Thanks! Can you get Greptile to 5/5 and resolve the conflicts with main? Then we'll take a look. |
|
Thanks for the nudge on this — I rebased onto main and want to flag what I found before you spend any review time.
The conflicts are gone because main already contains this fix. Resolving the rebase onto 620f65b leaves zero diff; both of my commits drop as empty. Specifically:
Caption merging now lives in ProjectConfiguration::with_preset (crates/project/src/configuration.rs:2828), which keeps the recording's segments and sourceTimed and takes only settings from the preset — the same rule this PR implemented locally in presets.rs.
The Default row goes through default_project_config(&self.project) (apps/desktop-gpui/src/editor_window.rs:7395), so it no longer clears a recording's captions — that covers Greptile's finding #1.
Preset saves strip segments/sourceTimed in preset_config, and the Tauri app (where createPresets.ts lived) was removed in e4f4ca9 — Greptile's finding #2 is moot.
So both findings are already resolved on main, and there is nothing left for this branch to land.
One behavioural difference is still open, and it is exactly the case called out in this PR's Note. For a recording that has no captions at all, applying a saved preset (one that stores caption settings):
main (with_preset, the (None, Some(settings)) arm) materialises CaptionsData { settings, ..Default::default() } — the recording picks up the preset's caption styling, including its enabled flag, with an empty transcript.
this PR returns None — the recording stays without captions; styling is never grafted onto a recording that has no words of its own.
I don't think that call is mine to make, so which way do you want it?
Keep the mainline behaviour — then please close this; nothing to merge, and I'll leave with_preset alone.
A recording with no transcript should stay without captions — then I'll re-scope this branch to that single difference on top of main. It's a small change with a test for both directions, and I can push it right away; a Greptile re-review on a focused diff should be straightforward from there.
Either way, thanks for looking at it.
At 2026-11-03 08:01:26, "Richie McIlroy" ***@***.***> wrote:
richiemcilroy left a comment (CapSoftware/Cap#3314)
Thanks! Can you get Greptile to 5/5 and resolve the conflicts with main? Then we'll take a look.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Fixes #3310.
Problem
A preset stores the whole
ProjectConfiguration, so caption data travelled with it in both directions:null— the recording lost its saved caption source.Captions are two things at once: styling that belongs to the project, and a transcript that belongs to the recording. Only the first should cross a preset boundary.
Change
apps/desktop-gpui/src/presets.rspreset_configcaptions.segmentssegments+sourceTimed, keepssettingsapply_presetsegments/word timings/sourceTimedkept,settingstaken from the presetapps/desktop/src/utils/createPresets.ts/PresetsDropdown.tsxmirror the same rules through a smallkeptCaptionshelper, so presets stay interchangeable between the Tauri and GPUI editors.Tests
Three cases in
presets.rs(CI runs them viacargo test --bin cap-gpui):saving_a_preset_keeps_the_caption_styling_but_not_the_transcriptapplying_a_preset_keeps_the_current_transcript_and_takes_its_stylingapplying_a_preset_without_captions_keeps_the_current_captionsNote
When the recording has no captions at all, applying a preset still leaves it without captions (
kept_captionsreturnsNone) rather than materialising an emptyCaptionsDatafrom the preset. Say the word if you'd rather seed the preset's styling there.Fix the Default action and the existing-preset save path before merging.
Findings
Fix with agent prompt
Summary
Separates caption styling from recording-specific words when saving and applying presets.
Intent acknowledged by tmaostats: recordings without captions should remain without captions when a preset is applied.
Reviews (1) · Last reviewed commit: "fix(presets): keep a recording's transcr..." · Reviewed by Greptile