Skip to content

Commit 2998dff

Browse files
committed
it actually works now
1 parent 8329c7a commit 2998dff

File tree

6 files changed

+81
-14
lines changed

6 files changed

+81
-14
lines changed

apps/desktop/src-tauri/src/general_settings.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ pub enum MainWindowRecordingStartBehaviour {
2525
#[serde(rename_all = "camelCase")]
2626
pub enum PostDeletionBehaviour {
2727
#[default]
28-
CloseWindow,
29-
KeepWindowOpen,
28+
Exit,
29+
ReopenRecordingWindow,
3030
}
3131

3232
impl MainWindowRecordingStartBehaviour {
@@ -129,7 +129,7 @@ impl Default for GeneralSettingsStore {
129129
_open_editor_after_recording: false,
130130
enable_native_camera_preview: false,
131131
auto_zoom_on_clicks: false,
132-
post_deletion_behaviour: PostDeletionBehaviour::CloseWindow,
132+
post_deletion_behaviour: PostDeletionBehaviour::Exit,
133133
}
134134
}
135135
}

apps/desktop/src-tauri/src/recording.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ pub async fn start_recording(
485485
// this clears the current recording for us
486486
handle_recording_end(app, None, &mut state).await.ok();
487487
}
488+
// Actor hasn't errored, it's just finished
488489
_ => {}
489490
}
490491
}
@@ -595,16 +596,19 @@ pub async fn delete_recording(app: AppHandle, state: MutableState<'_, App>) -> R
595596
.ok()
596597
.flatten()
597598
.unwrap_or_default();
599+
600+
if let Some(window) = CapWindowId::InProgressRecording.get(&app) {
601+
let _ = window.close();
602+
}
603+
598604
match settings.post_deletion_behaviour {
599-
PostDeletionBehaviour::CloseWindow => {
600-
// Close the in-progress recording window (current behavior)
601-
if let Some(window) = CapWindowId::InProgressRecording.get(&app) {
605+
PostDeletionBehaviour::Exit => {
606+
if let Some(window) = CapWindowId::Main.get(&app) {
602607
let _ = window.close();
603608
}
604609
}
605-
PostDeletionBehaviour::KeepWindowOpen => {
606-
// Keep window open - no action needed, just emit events to reset UI
607-
// The frontend will handle resetting the recording state
610+
PostDeletionBehaviour::ReopenRecordingWindow => {
611+
let _ = ShowCapWindow::Main.show(&app).await;
608612
}
609613
}
610614
}

apps/desktop/src/routes/(window-chrome)/settings/general.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
152152
| PostDeletionBehaviour
153153
| number;
154154
onChange: (
155-
value: MainWindowRecordingStartBehaviour | PostStudioRecordingBehaviour | PostDeletionBehaviour
155+
value:
156+
| MainWindowRecordingStartBehaviour
157+
| PostStudioRecordingBehaviour
158+
| PostDeletionBehaviour
156159
) => void | Promise<void>;
157160
};
158161

@@ -449,8 +452,11 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
449452
() => item.value,
450453
item.onChange,
451454
[
452-
{ text: "Close window", value: "closeWindow" },
453-
{ text: "Keep window open", value: "keepWindowOpen" },
455+
{ text: "Hide Cap", value: "exit" },
456+
{
457+
text: "Open Cap",
458+
value: "reopenRecordingWindow",
459+
},
454460
]
455461
);
456462
}

apps/desktop/src/utils/tauri.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ export type OSPermissionStatus = "notNeeded" | "empty" | "granted" | "denied"
383383
export type OSPermissionsCheck = { screenRecording: OSPermissionStatus; microphone: OSPermissionStatus; camera: OSPermissionStatus; accessibility: OSPermissionStatus }
384384
export type Plan = { upgraded: boolean; manual: boolean; last_checked: number }
385385
export type Platform = "MacOS" | "Windows"
386-
export type PostDeletionBehaviour = "closeWindow" | "keepWindowOpen"
386+
export type PostDeletionBehaviour = "exit" | "reopenRecordingWindow"
387387
export type PostStudioRecordingBehaviour = "openEditor" | "showOverlay"
388388
export type Preset = { name: string; config: ProjectConfiguration }
389389
export type PresetsStore = { presets: Preset[]; default: number | null }

crates/recording/src/studio_recording.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,15 @@ async fn run_actor_iteration(
450450
// Cancel from any state
451451
(Msg::Cancel(tx), state) => {
452452
let result = match state {
453-
State::Recording { mut pipeline, .. } => pipeline.inner.shutdown().await,
453+
State::Recording { mut pipeline, .. } => {
454+
if let Some(cursor) = &mut pipeline.cursor
455+
&& let Some(actor) = cursor.actor.take()
456+
{
457+
actor.stop().await;
458+
}
459+
460+
pipeline.inner.shutdown().await
461+
}
454462
State::Paused { .. } => Ok(()),
455463
};
456464

packages/ui-solid/src/auto-imports.d.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,69 @@
66
// biome-ignore lint: disable
77
export {}
88
declare global {
9+
const IconCapAudioOn: typeof import('~icons/cap/audio-on.jsx')['default']
10+
const IconCapBgBlur: typeof import('~icons/cap/bg-blur.jsx')['default']
911
const IconCapCamera: typeof import('~icons/cap/camera.jsx')['default']
12+
const IconCapCaptions: typeof import('~icons/cap/captions.jsx')['default']
1013
const IconCapChevronDown: typeof import('~icons/cap/chevron-down.jsx')['default']
14+
const IconCapCircleCheck: typeof import('~icons/cap/circle-check.jsx')['default']
15+
const IconCapCirclePlus: typeof import('~icons/cap/circle-plus.jsx')['default']
16+
const IconCapCircleX: typeof import('~icons/cap/circle-x.jsx')['default']
17+
const IconCapCopy: typeof import('~icons/cap/copy.jsx')['default']
18+
const IconCapCorners: typeof import('~icons/cap/corners.jsx')['default']
1119
const IconCapCrop: typeof import('~icons/cap/crop.jsx')['default']
20+
const IconCapCursor: typeof import('~icons/cap/cursor.jsx')['default']
21+
const IconCapEnlarge: typeof import('~icons/cap/enlarge.jsx')['default']
22+
const IconCapFile: typeof import('~icons/cap/file.jsx')['default']
1223
const IconCapFilmCut: typeof import('~icons/cap/film-cut.jsx')['default']
24+
const IconCapGauge: typeof import('~icons/cap/gauge.jsx')['default']
25+
const IconCapHotkeys: typeof import('~icons/cap/hotkeys.jsx')['default']
26+
const IconCapImage: typeof import('~icons/cap/image.jsx')['default']
1327
const IconCapInfo: typeof import('~icons/cap/info.jsx')['default']
1428
const IconCapInstant: typeof import('~icons/cap/instant.jsx')['default']
29+
const IconCapLayout: typeof import('~icons/cap/layout.jsx')['default']
30+
const IconCapLink: typeof import('~icons/cap/link.jsx')['default']
1531
const IconCapLogo: typeof import('~icons/cap/logo.jsx')['default']
1632
const IconCapLogoFull: typeof import('~icons/cap/logo-full.jsx')['default']
1733
const IconCapLogoFullDark: typeof import('~icons/cap/logo-full-dark.jsx')['default']
34+
const IconCapMessageBubble: typeof import('~icons/cap/message-bubble.jsx')['default']
1835
const IconCapMicrophone: typeof import('~icons/cap/microphone.jsx')['default']
36+
const IconCapMoreVertical: typeof import('~icons/cap/more-vertical.jsx')['default']
37+
const IconCapNext: typeof import('~icons/cap/next.jsx')['default']
38+
const IconCapPadding: typeof import('~icons/cap/padding.jsx')['default']
39+
const IconCapPause: typeof import('~icons/cap/pause.jsx')['default']
40+
const IconCapPauseCircle: typeof import('~icons/cap/pause-circle.jsx')['default']
41+
const IconCapPlay: typeof import('~icons/cap/play.jsx')['default']
42+
const IconCapPlayCircle: typeof import('~icons/cap/play-circle.jsx')['default']
43+
const IconCapPresets: typeof import('~icons/cap/presets.jsx')['default']
44+
const IconCapPrev: typeof import('~icons/cap/prev.jsx')['default']
45+
const IconCapRedo: typeof import('~icons/cap/redo.jsx')['default']
46+
const IconCapRestart: typeof import('~icons/cap/restart.jsx')['default']
47+
const IconCapScissors: typeof import('~icons/cap/scissors.jsx')['default']
1948
const IconCapSettings: typeof import('~icons/cap/settings.jsx')['default']
49+
const IconCapShadow: typeof import('~icons/cap/shadow.jsx')['default']
50+
const IconCapStopCircle: typeof import('~icons/cap/stop-circle.jsx')['default']
51+
const IconCapTrash: typeof import('~icons/cap/trash.jsx')['default']
52+
const IconCapUndo: typeof import('~icons/cap/undo.jsx')['default']
53+
const IconCapZoomIn: typeof import('~icons/cap/zoom-in.jsx')['default']
54+
const IconCapZoomOut: typeof import('~icons/cap/zoom-out.jsx')['default']
55+
const IconHugeiconsEaseCurveControlPoints: typeof import('~icons/hugeicons/ease-curve-control-points.jsx')['default']
2056
const IconLucideBell: typeof import('~icons/lucide/bell.jsx')['default']
2157
const IconLucideBug: typeof import('~icons/lucide/bug.jsx')['default']
58+
const IconLucideCheck: typeof import('~icons/lucide/check.jsx')['default']
59+
const IconLucideClock: typeof import('~icons/lucide/clock.jsx')['default']
60+
const IconLucideDatabase: typeof import('~icons/lucide/database.jsx')['default']
61+
const IconLucideFolder: typeof import('~icons/lucide/folder.jsx')['default']
2262
const IconLucideGift: typeof import('~icons/lucide/gift.jsx')['default']
63+
const IconLucideHardDrive: typeof import('~icons/lucide/hard-drive.jsx')['default']
64+
const IconLucideLoaderCircle: typeof import('~icons/lucide/loader-circle.jsx')['default']
65+
const IconLucideMessageSquarePlus: typeof import('~icons/lucide/message-square-plus.jsx')['default']
66+
const IconLucideMicOff: typeof import('~icons/lucide/mic-off.jsx')['default']
67+
const IconLucideMonitor: typeof import('~icons/lucide/monitor.jsx')['default']
68+
const IconLucideRotateCcw: typeof import('~icons/lucide/rotate-ccw.jsx')['default']
69+
const IconLucideSearch: typeof import('~icons/lucide/search.jsx')['default']
2370
const IconLucideSquarePlay: typeof import('~icons/lucide/square-play.jsx')['default']
71+
const IconLucideUnplug: typeof import('~icons/lucide/unplug.jsx')['default']
72+
const IconLucideVolume2: typeof import('~icons/lucide/volume2.jsx')['default']
2473
const IconPhMonitorBold: typeof import('~icons/ph/monitor-bold.jsx')['default']
2574
}

0 commit comments

Comments
 (0)