Repository navigation
🔀 chore: sync with CapSoftware/Cap main (2026-11-26) #4559
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
Closed
flyingwebie
wants to merge
34
commits into
CapSoftware:main
from
flyingwebie:chore/sync-upstream-2026-11-26
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
f838d54
feat(desktop-gpui): add Clean Up tab that cuts silences from the time…
flyingwebie 96da237
ci: build an unsigned Apple Silicon release for this fork
flyingwebie 9258ab4
feat(editor): add a preview playback rate with pitch-preserving audio
flyingwebie f9d1106
feat(desktop-gpui): skip silences in playback and add a preview speed…
flyingwebie ac90d6b
fix(desktop-gpui): place windows correctly on displays above or below…
flyingwebie 60fa783
ci: publish a fork release on every merge to main
flyingwebie ec71663
Merge pull request #1 from flyingwebie/feat/clean-up
flyingwebie 0cdb9ea
👷 ci: sign and notarize the fork release with a Developer ID (#2)
flyingwebie f292ee8
🐛 fix(editor): fall back to in-memory audio for short Studio Sound cuts
flyingwebie 7db3508
Merge pull request #3 from flyingwebie/fix/studio-sound-short-cut-export
flyingwebie d5e4cd3
🔀 chore: sync with CapSoftware/Cap main
flyingwebie 5bb7ad7
👷 ci(release): sign the ONNX Runtime dylib before notarizing
flyingwebie bdb678f
Merge pull request #4 from flyingwebie/chore/sync-upstream-2026-10-17
flyingwebie bcaf3bd
🔀 chore: sync with CapSoftware/Cap main
flyingwebie dbad82e
Merge pull request #5 from flyingwebie/chore/sync-upstream-2026-10-20
flyingwebie 0ead67e
Merge branch 'CapSoftware:main' into main
flyingwebie fc12234
Merge remote-tracking branch 'upstream/main' into chore/sync-upstream…
flyingwebie 035c3d1
Merge pull request #6 from flyingwebie/chore/sync-upstream-2026-10-20b
flyingwebie 7355d71
✨ feat(editor): add a preview playback rate with pitch-preserving audio
flyingwebie 6037d3e
✨ feat(desktop-gpui): add Clean Up tab, silence skipping, and preview…
flyingwebie 4280304
🔒️ fix(desktop-gpui): bound the Clean Up envelope against out-of-rang…
flyingwebie 80adb4c
♻️ refactor(editor): return to 1x passthrough and hold the clock at 1…
flyingwebie 4d8565a
⚡️ perf(desktop-gpui): show waveforms before Clean Up analysis and lo…
flyingwebie c7d9b51
Merge remote-tracking branch 'upstream/main' into chore/sync-pr-2774-…
flyingwebie 93ea30d
Merge branch 'fix/gpui-multi-display-placement' into chore/sync-pr-27…
flyingwebie 23eada3
Merge branch 'fix/editor-studio-sound-short-cut-fallback' into chore/…
flyingwebie 1d6f350
Merge branch 'feat/gpui-clean-up-and-preview-speed' into chore/sync-p…
flyingwebie 8696d30
Merge pull request #7 from flyingwebie/chore/sync-pr-2774-review
flyingwebie aa791ce
🔀 chore: merge the PR #2812 review changes into fork main
flyingwebie 43840f1
Merge pull request #8 from flyingwebie/chore/sync-pr-2812-review
flyingwebie 26902e9
🔀 chore: sync with CapSoftware/Cap main
flyingwebie 654e7a4
Merge pull request #9 from flyingwebie/chore/sync-upstream-2026-11-01
flyingwebie 7b365a2
Merge branch 'CapSoftware:main' into main
flyingwebie ef380e1
🔀 chore: sync with CapSoftware/Cap main
flyingwebie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| name: "fork-macos-release" | ||
|
|
||
| # Builds Cap for Apple Silicon and attaches the disk image to a GitHub release | ||
| # on this fork. The app keeps the so.cap.desktop identity, so it installs over | ||
| # the official Cap and reuses its recordings and settings. It is signed with | ||
| # the fork owner's Developer ID and notarized, so macOS keeps its privacy | ||
| # grants across updates. Without the APPLE_* secrets it falls back to an | ||
| # ad-hoc signature, and macOS asks for permissions again after every update. | ||
| # | ||
| # Every merge to main builds and publishes a release tagged | ||
| # fw-v<version>-build.<run>. It also runs from the Actions tab, or when a tag | ||
| # named fw-v<anything> is pushed. The tag the release step creates is pushed | ||
| # with GITHUB_TOKEN, which does not start another run. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - "fw-v*" | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: fork-macos-release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| if: ${{ github.repository != 'CapSoftware/Cap' }} | ||
| runs-on: macos-15 | ||
| timeout-minutes: 360 | ||
| env: | ||
| TARGET: aarch64-apple-darwin | ||
| CAP_BUNDLE: apps/desktop-gpui/target/aarch64-apple-darwin/release/bundle | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Rust setup | ||
| uses: dtolnay/rust-toolchain@1.88.0 | ||
| with: | ||
| targets: aarch64-apple-darwin | ||
|
|
||
| - uses: ./.github/actions/setup-rust-cache | ||
| with: | ||
| target: aarch64-apple-darwin | ||
| prefix-key: v1-rust-fork-release | ||
| save-cache: true | ||
| cache-on-failure: true | ||
| workspaces: | | ||
| . -> target | ||
| apps/desktop-gpui -> target | ||
|
|
||
| - uses: ./.github/actions/setup-js | ||
|
|
||
| - name: Name the release | ||
| id: release | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| version="$(sed -n 's/^version = "\(.*\)"$/\1/p' apps/desktop-gpui/Cargo.toml | head -n 1)" | ||
| if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then | ||
| tag="$GITHUB_REF_NAME" | ||
| else | ||
| tag="fw-v$version-build.$GITHUB_RUN_NUMBER" | ||
| fi | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Check signing secrets | ||
| id: signing | ||
| shell: bash | ||
| env: | ||
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||
| APPLE_API_KEY_FILE: ${{ secrets.APPLE_API_KEY_FILE }} | ||
| run: | | ||
| if [[ -n "$APPLE_CERTIFICATE" && -n "$APPLE_API_KEY_FILE" ]]; then | ||
| echo "signed=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "signed=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Write the notarization key | ||
| if: ${{ steps.signing.outputs.signed == 'true' }} | ||
| shell: bash | ||
| env: | ||
| APPLE_API_KEY_FILE: ${{ secrets.APPLE_API_KEY_FILE }} | ||
| run: printf '%s\n' "$APPLE_API_KEY_FILE" > "$RUNNER_TEMP/api.p8" | ||
|
|
||
| - uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2 | ||
| if: ${{ steps.signing.outputs.signed == 'true' }} | ||
| with: | ||
| p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }} | ||
| p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
|
|
||
| - name: Create .env file in root | ||
| shell: bash | ||
| run: | | ||
| { | ||
| echo "appVersion=${{ steps.release.outputs.version }}" | ||
| echo "VITE_ENVIRONMENT=production" | ||
| echo "RUST_TARGET_TRIPLE=$TARGET" | ||
| } >> .env | ||
|
|
||
| # cap-setup downloads the ONNX Runtime dylib that ships in the app's | ||
| # Resources. Tauri does not sign resources, so cap-setup signs it here. | ||
| # It needs the Developer ID already in the keychain, or notarization | ||
| # rejects the app. | ||
| - name: Run cap-setup | ||
| shell: bash | ||
| run: bun run cap-setup | ||
| env: | ||
| RUST_TARGET_TRIPLE: ${{ env.TARGET }} | ||
| APPLE_SIGNING_IDENTITY: ${{ steps.signing.outputs.signed == 'true' && secrets.APPLE_SIGNING_IDENTITY || '' }} | ||
| APPLE_KEYCHAIN: ${{ steps.signing.outputs.signed == 'true' && format('{0}/build.keychain', runner.temp) || '' }} | ||
|
|
||
| - name: Build desktop binaries | ||
| shell: bash | ||
| env: | ||
| CARGO_PROFILE_RELEASE_DEBUG: "0" | ||
| CARGO_PROFILE_RELEASE_STRIP: symbols | ||
| run: ./scripts/build-desktop-binaries.sh "$TARGET" | ||
|
|
||
| # With the secrets, Tauri signs with the Developer ID and notarizes. The | ||
| # updater archive is skipped because only Cap can sign one. | ||
| - name: Build Cap | ||
| shell: bash | ||
| env: | ||
| CI: false | ||
| CAP_BUILD_REVISION: ${{ github.sha }} | ||
| RUST_TARGET_TRIPLE: ${{ env.TARGET }} | ||
| SIGNED: ${{ steps.signing.outputs.signed }} | ||
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | ||
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | ||
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | ||
| APPLE_API_KEY_PATH: ${{ runner.temp }}/api.p8 | ||
| run: | | ||
| if [[ "$SIGNED" == "true" ]]; then | ||
| config='{"bundle":{"createUpdaterArtifacts":false}}' | ||
| else | ||
| unset APPLE_SIGNING_IDENTITY APPLE_API_ISSUER APPLE_API_KEY APPLE_API_KEY_PATH | ||
| config='{"bundle":{"createUpdaterArtifacts":false,"macOS":{"signingIdentity":"-"}}}' | ||
| fi | ||
| node scripts/bundle-gpui.mjs "$TARGET" --bundles app,dmg --config "$config" | ||
|
|
||
| - name: Verify the app | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| app="$CAP_BUNDLE/macos/Cap.app" | ||
| test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$app/Contents/Info.plist")" = "so.cap.desktop" | ||
| codesign --verify --deep --strict "$app" | ||
| for binary in Cap cap-cli cap-muxer; do | ||
| test -x "$app/Contents/MacOS/$binary" | ||
| done | ||
|
|
||
| - name: Stage the disk image | ||
| id: dmg | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| source="$(find "$CAP_BUNDLE/dmg" -maxdepth 1 -name '*.dmg' | head -n 1)" | ||
| test -n "$source" | ||
| dmg="$RUNNER_TEMP/Cap_${{ steps.release.outputs.tag }}_aarch64.dmg" | ||
| hdiutil convert "$source" -format ULMO -o "$dmg" | ||
| hdiutil verify "$dmg" | ||
| echo "path=$dmg" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Publish the release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ steps.release.outputs.tag }} | ||
| target_commitish: ${{ github.sha }} | ||
| name: Cap ${{ steps.release.outputs.version }} (${{ steps.release.outputs.tag }}) | ||
| files: ${{ steps.dmg.outputs.path }} | ||
| make_latest: true | ||
| body: | | ||
| Cap ${{ steps.release.outputs.version }} built from ${{ github.sha }} for Apple Silicon Macs. | ||
|
|
||
| **Install:** quit Cap, open the disk image and drag Cap to Applications, replacing the existing copy. Recordings and settings carry over. | ||
|
|
||
| **First launch:** macOS asks for Screen Recording, Camera and Microphone access once. If this release was built without the Apple signing secrets it is not notarized: open System Settings → Privacy & Security and click **Open Anyway** next to Cap. | ||
|
|
||
| **Updates:** declining Cap's own update prompts keeps this version. Accepting one replaces it with the official Cap. | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| pub const WINDOW_FRAMES: usize = 480; | ||
| pub const FLOOR_DB: f32 = -100.0; | ||
|
|
||
| pub fn loudness_db<'a>(slices: impl IntoIterator<Item = &'a [f32]>, channels: u16) -> Vec<f32> { | ||
| let window = WINDOW_FRAMES * usize::from(channels.max(1)); | ||
| let mut levels = Vec::new(); | ||
| let mut sum = 0.0_f32; | ||
| let mut count = 0; | ||
| for mut slice in slices { | ||
| while !slice.is_empty() { | ||
| let (chunk, rest) = slice.split_at((window - count).min(slice.len())); | ||
| sum = chunk.iter().fold(sum, |sum, sample| sum + sample * sample); | ||
| count += chunk.len(); | ||
| slice = rest; | ||
| if count == window { | ||
| levels.push(mean_square_db(sum / count as f32)); | ||
| sum = 0.0; | ||
| count = 0; | ||
| } | ||
| } | ||
| } | ||
| if count > 0 { | ||
| levels.push(mean_square_db(sum / count as f32)); | ||
| } | ||
| levels | ||
| } | ||
|
|
||
| fn mean_square_db(mean_square: f32) -> f32 { | ||
| if mean_square.is_finite() && mean_square > 1e-10 { | ||
| (10.0 * mean_square.log10()).max(FLOOR_DB) | ||
| } else { | ||
| FLOOR_DB | ||
| } | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::*; | ||
|
|
||
| fn sine(frames: usize, channels: u16, amplitude: f32) -> Vec<f32> { | ||
| (0..frames) | ||
| .flat_map(|frame| { | ||
| let value = | ||
| amplitude * (frame as f32 * 1_000.0 * std::f32::consts::TAU / 48_000.0).sin(); | ||
| std::iter::repeat_n(value, usize::from(channels)) | ||
| }) | ||
| .collect() | ||
| } | ||
|
|
||
| #[test] | ||
| fn digital_silence_sits_on_the_floor() { | ||
| let samples = vec![0.0; WINDOW_FRAMES * 3]; | ||
| assert_eq!(loudness_db([samples.as_slice()], 1), vec![FLOOR_DB; 3]); | ||
| } | ||
|
|
||
| #[test] | ||
| fn a_full_scale_sine_measures_minus_three_db() { | ||
| let samples = sine(WINDOW_FRAMES * 10, 2, 1.0); | ||
| let levels = loudness_db([samples.as_slice()], 2); | ||
| assert_eq!(levels.len(), 10); | ||
| for level in levels { | ||
| assert!((level + 3.01).abs() < 0.05, "{level}"); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn uneven_blocks_match_one_contiguous_slice() { | ||
| let samples = sine(WINDOW_FRAMES * 7 + 123, 2, 0.25); | ||
| let expected = loudness_db([samples.as_slice()], 2); | ||
| for block in [1, 7, 959, 960, 4_096] { | ||
| let actual = loudness_db(samples.chunks(block), 2); | ||
| assert_eq!(actual.len(), expected.len()); | ||
| for (actual, expected) in actual.iter().zip(&expected) { | ||
| assert!( | ||
| (actual - expected).abs() < 1e-4, | ||
| "{block}: {actual} {expected}" | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn a_trailing_partial_window_is_measured() { | ||
| let samples = sine(WINDOW_FRAMES + 10, 1, 0.5); | ||
| assert_eq!(loudness_db([samples.as_slice()], 1).len(), 2); | ||
| assert!(loudness_db(std::iter::empty::<&[f32]>(), 1).is_empty()); | ||
| } | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added trigger description repeats the workflow's
onsettings. The repository guide forbids comments that merely narrate code or describe the change. This requirement must be satisfied before merging.Remove the routine description, but keep the useful note explaining why a tag pushed with
GITHUB_TOKENdoes not start another run.Context Used: CLAUDE.md (source)
Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!