Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix(desktop-gpui): open screenshot bundles in the screenshot editor from recents
Ilya894d8b024b21
diff --git a/apps/desktop-gpui/src/deeplink.rs b/apps/desktop-gpui/src/deeplink.rsindex 8a1523477..cd4ee07a9 100644--- a/apps/desktop-gpui/src/deeplink.rs+++ b/apps/desktop-gpui/src/deeplink.rs@@ -540,6 +540,11 @@ impl DeepLinkAction {DeepLinkAction::OpenEditor { project_path } => {use cap_project::{RecordingMeta, RecordingMetaInner, StudioRecordingStatus};+ if crate::library::is_screenshot_bundle(&project_path) {+ cx.defer(move |cx| app_windows::open_screenshot_editor(project_path, cx));+ return Ok(());+ }+let meta =RecordingMeta::load_for_project(&project_path).map_err(|v| v.to_string())?;match &meta.inner {diff --git a/apps/desktop-gpui/src/library.rs b/apps/desktop-gpui/src/library.rsindex 5e3f9c31f..8c4906d58 100644--- a/apps/desktop-gpui/src/library.rs+++ b/apps/desktop-gpui/src/library.rs@@ -754,6 +754,14 @@ fn screenshot_items_in(dir: &Path) -> impl Iterator<Item = ScreenshotItem> {})}+/// Whether a `.cap` directory is a screenshot rather than a recording. The+/// same rule `list_screenshots` uses, so the two never disagree on a bundle.+pub fn is_screenshot_bundle(bundle: &Path) -> bool {+ bundle.extension().and_then(|ext| ext.to_str()) == Some("cap")+ && bundle.is_dir()+ && screenshot_png(bundle).is_some()+}+fn screenshot_png(bundle: &Path) -> Option<(PathBuf, f64)> {let original = bundle.join("original.png");if let Ok(metadata) = original.metadata() {