Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(gpui): play screenshot and clipboard completion cues

Richie McIlroy7922d1ee9b32
diff --git a/apps/desktop-gpui/src/screenshot.rs b/apps/desktop-gpui/src/screenshot.rs
index 08805c914..ef966aca1 100644
--- a/apps/desktop-gpui/src/screenshot.rs
+++ b/apps/desktop-gpui/src/screenshot.rs
@@ -8,8 +8,7 @@
//! {name}.cap/` holding `original.png`, a Studio `SingleSegment` meta whose
//! display track is the PNG at `fps: 0`, and a project config whose
//! background is transparent white with no shadow (`recording.rs:2963-2985`).
-//! Known deviations from that command: no capture sound (this app has no
-//! sound assets yet), no native notification, and no `ScreenshotTaken`
+//! Known deviations from that command: no native notification and no `ScreenshotTaken`
//! automations (no automation runner here).
use std::path::PathBuf;
@@ -66,6 +65,8 @@ async fn capture_and_write(target: ScreenCaptureTarget) -> anyhow::Result<PathBu
.await
.context("capturing the screenshot")?;
+ crate::app_sounds::AppSound::Notification.play();
+
let base = crate::library::screenshots_dir();
std::fs::create_dir_all(&base)
.with_context(|| format!("creating screenshots dir {}", base.display()))?;
diff --git a/apps/desktop-gpui/src/screenshot_editor.rs b/apps/desktop-gpui/src/screenshot_editor.rs
index dce5d148a..223d67da6 100644
--- a/apps/desktop-gpui/src/screenshot_editor.rs
+++ b/apps/desktop-gpui/src/screenshot_editor.rs
@@ -2079,6 +2079,7 @@ impl ScreenshotEditorWindow {
cx: &mut Context<Self>,
) {
cx.write_to_clipboard(gpui::ClipboardItem::new_string(link));
+ crate::app_sounds::play_notification();
self.toast_update(
toast,
ToastKind::Success,