Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

feat(delete): add delete recordings option

Marc Diazbbfbeff5e945
diff --git a/electron/ai-edition/document-service.ts b/electron/ai-edition/document-service.ts
index 52e1bb97e..dfabb1ef7 100644
--- a/electron/ai-edition/document-service.ts
+++ b/electron/ai-edition/document-service.ts
@@ -385,7 +385,7 @@ export class DocumentService {
}
/** Every project that parses, unrelinked and unannounced: a listing, not an open. */
- private async readAllProjects(): Promise<AxcutDocument[]> {
+ async readAllProjects(): Promise<AxcutDocument[]> {
await this.ensureProjectsDir();
const entries = await fs.readdir(this.projectsRoot);
// ensureProjectsDir (above) already migrated any legacy `.axcut` files.
diff --git a/electron/ai-edition/project-recordings.test.ts b/electron/ai-edition/project-recordings.test.ts
new file mode 100644
index 000000000..3ec7a884c
--- /dev/null
+++ b/electron/ai-edition/project-recordings.test.ts
@@ -0,0 +1,105 @@
+import fs from "node:fs/promises";
+import os from "node:os";
+import path from "node:path";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { DocumentService } from "./document-service";
+import { findProjectRecordings, removeRecordingSets } from "./project-recordings";
+
+async function touch(filePath: string, content = "x"): Promise<string> {
+ await fs.writeFile(filePath, content);
+ return filePath;
+}
+
+describe("project recordings", () => {
+ let root: string;
+ let recordingsDir: string;
+ let elsewhere: string;
+ let documents: DocumentService;
+
+ beforeEach(async () => {
+ root = await fs.mkdtemp(path.join(os.tmpdir(), "openscreen-project-recordings-"));
+ recordingsDir = path.join(root, "recordings");
+ elsewhere = path.join(root, "Desktop");
+ await fs.mkdir(recordingsDir);
+ await fs.mkdir(elsewhere);
+ documents = new DocumentService(path.join(root, "projects"), root);
+ });
+
+ afterEach(async () => {
+ await fs.rm(root, { recursive: true, force: true });
+ });
+
+ async function projectWith(title: string, ...videoPaths: string[]): Promise<string> {
+ const doc = await documents.createProject(title);
+ for (const videoPath of videoPaths) {
+ await documents.addAsset(doc.project.id, {
+ path: videoPath,
+ label: path.basename(videoPath),
+ });
+ }
+ return doc.project.id;
+ }
+
+ it("owns every file recorded beside the screen video", async () => {
+ const video = await touch(path.join(recordingsDir, "recording-12.mp4"), "12345");
+ const companions = [
+ await touch(`${video}.cursor.json`),
+ await touch(path.join(recordingsDir, "recording-12.session.json")),
+ await touch(path.join(recordingsDir, "recording-12-webcam.webm")),
+ ];
+ await touch(path.join(recordingsDir, "recording-123.mp4"));
+ const id = await projectWith("Mine", video);
+
+ const { owned, keptFor } = await findProjectRecordings(id, await documents.readAllProjects(), [
+ recordingsDir,
+ ]);
+
+ expect(owned).toHaveLength(1);
+ expect(owned[0].files.sort()).toEqual([video, ...companions].sort());
+ expect(owned[0].sizeBytes).toBe(5 + 3);
+ expect(keptFor).toEqual([]);
+ });
+
+ it("keeps a recording another project uses, and names that project", async () => {
+ const shared = await touch(path.join(recordingsDir, "recording-1.mp4"));
+ const own = await touch(path.join(recordingsDir, "recording-2.mp4"));
+ const id = await projectWith("Mine", shared, own);
+ await projectWith("Demo v2", shared);
+
+ const { owned, keptFor } = await findProjectRecordings(id, await documents.readAllProjects(), [
+ recordingsDir,
+ ]);
+
+ expect(owned.map((set) => set.stem)).toEqual(["recording-2"]);
+ expect(keptFor).toEqual(["Demo v2"]);
+ });
+
+ it("never owns a video outside the recordings folders", async () => {
+ const imported = await touch(path.join(elsewhere, "recording-5.mp4"));
+ const id = await projectWith("Imported", imported);
+
+ const { owned } = await findProjectRecordings(id, await documents.readAllProjects(), [
+ recordingsDir,
+ ]);
+
+ expect(owned).toEqual([]);
+ });
+
+ it("trashes each file, or removes it for good when asked", async () => {
+ const video = await touch(path.join(recordingsDir, "recording-7.mp4"));
+ const cursor = await touch(`${video}.cursor.json`);
+ const id = await projectWith("Mine", video);
+ const { owned } = await findProjectRecordings(id, await documents.readAllProjects(), [
+ recordingsDir,
+ ]);
+
+ const trashItem = vi.fn(async (_filePath: string) => {});
+ await removeRecordingSets(owned, "trash", trashItem);
+ expect(trashItem.mock.calls.map(([p]) => p).sort()).toEqual([video, cursor].sort());
+ await expect(fs.access(video)).resolves.toBeUndefined();
+
+ await removeRecordingSets(owned, "permanent", trashItem);
+ await expect(fs.access(video)).rejects.toThrow();
+ await expect(fs.access(cursor)).rejects.toThrow();
+ });
+});
diff --git a/electron/ai-edition/project-recordings.ts b/electron/ai-edition/project-recordings.ts
new file mode 100644
index 000000000..6fcedb186
--- /dev/null
+++ b/electron/ai-edition/project-recordings.ts
@@ -0,0 +1,128 @@
+import fs from "node:fs/promises";
+import path from "node:path";
+import type { AxcutDocument } from "../../src/lib/ai-edition/schema";
+
+const RECORDING_STEM = /^recording-\d+/;
+
+/** One take: the screen video and every file recorded beside it (cursor, session, camera). */
+export interface RecordingSet {
+ dir: string;
+ stem: string;
+ files: string[];
+ sizeBytes: number;
+}
+
+export interface ProjectRecordings {
+ owned: RecordingSet[];
+ /** Titles of the other projects that use some of this project's recordings. */
+ keptFor: string[];
+}
+
+export type RecordingsDisposal = "keep" | "trash" | "permanent";
+
+function documentMediaPaths(doc: AxcutDocument): string[] {
+ return doc.assets.flatMap((asset) =>
+ [asset.originalPath, asset.proxyPath, asset.waveformPath, asset.cameraTrack?.sourcePath].filter(
+ (p): p is string => typeof p === "string" && p.length > 0,
+ ),
+ );
+}
+
+// `path.relative` compares case-insensitively on Windows, which a string compare would not.
+function sameDir(a: string, b: string): boolean {
+ return path.relative(path.resolve(a), path.resolve(b)) === "";
+}
+
+function recordingKey(filePath: string, recordingsDirs: readonly string[]): string | null {
+ const dir = path.dirname(path.resolve(filePath));
+ const managedDir = recordingsDirs.find((candidate) => sameDir(candidate, dir));
+ if (!managedDir) return null;
+ const stem = RECORDING_STEM.exec(path.basename(filePath))?.[0];
+ return stem ? path.join(path.resolve(managedDir), stem) : null;
+}
+
+function documentRecordingKeys(doc: AxcutDocument, recordingsDirs: readonly string[]): Set<string> {
+ const keys = new Set<string>();
+ for (const mediaPath of documentMediaPaths(doc)) {
+ const key = recordingKey(mediaPath, recordingsDirs);
+ if (key) keys.add(key);
+ }
+ return keys;
+}
+
+async function readRecordingSet(key: string): Promise<RecordingSet | null> {
+ const dir = path.dirname(key);
+ const stem = path.basename(key);
+ let names: string[];
+ try {
+ names = await fs.readdir(dir);
+ } catch {
+ return null;
+ }
+ const files: string[] = [];
+ let sizeBytes = 0;
+ for (const name of names) {
+ // `recording-12` must not pick up `recording-123`.
+ if (name !== stem && !name.startsWith(`${stem}.`) && !name.startsWith(`${stem}-`)) continue;
+ const filePath = path.join(dir, name);
+ try {
+ const stat = await fs.stat(filePath);
+ if (!stat.isFile()) continue;
+ files.push(filePath);
+ sizeBytes += stat.size;
+ } catch {
+ // Gone between the listing and the stat: nothing left to delete.
+ }
+ }
+ return files.length > 0 ? { dir, stem, files, sizeBytes } : null;
+}
+
+/**
+ * The recordings `projectId` owns: takes in one of OpenScreen's recordings folders that no
+ * other project uses. A video imported from anywhere else is never the project's to delete.
+ */
+export async function findProjectRecordings(
+ projectId: string,
+ documents: readonly AxcutDocument[],
+ recordingsDirs: readonly string[],
+): Promise<ProjectRecordings> {
+ const target = documents.find((doc) => doc.project.id === projectId);
+ if (!target) return { owned: [], keptFor: [] };
+
+ const keys = documentRecordingKeys(target, recordingsDirs);
+ const keptFor = new Set<string>();
+ for (const doc of documents) {
+ if (doc.project.id === projectId) continue;
+ const otherKeys = documentRecordingKeys(doc, recordingsDirs);
+ for (const key of keys) {
+ if (otherKeys.has(key)) {
+ keys.delete(key);
+ keptFor.add(doc.project.title);
+ }
+ }
+ }
+
+ const owned: RecordingSet[] = [];
+ for (const key of keys) {
+ const set = await readRecordingSet(key);
+ if (set) owned.push(set);
+ }
+ return { owned, keptFor: [...keptFor] };
+}
+
+/** Throws on the first file that cannot be removed, so a failed trash can be retried permanently. */
+export async function removeRecordingSets(
+ sets: readonly RecordingSet[],
+ disposal: Exclude<RecordingsDisposal, "keep">,
+ trashItem: (filePath: string) => Promise<void>,
+): Promise<void> {
+ for (const set of sets) {
+ for (const filePath of set.files) {
+ if (disposal === "trash") {
+ await trashItem(filePath);
+ } else {
+ await fs.rm(filePath, { force: true });
+ }
+ }
+ }
+}
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index 7eae3fcaa..dab5284b5 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -5297,6 +5297,10 @@ export function registerIpcHandlers(
}
},
getAiEditionDocuments: () => aiEditionDocuments,
+ getRecordingsDirs: () => ({
+ dirs: getAllowedReadDirs(),
+ registryDir: DEFAULT_RECORDINGS_DIR,
+ }),
getStylePresets: () => stylePresets,
getAiEditionLlmConfig,
runAiEditionChat: (projectId, sessionId, message, document, sink, signal) =>
diff --git a/electron/ipc/nativeBridge.ts b/electron/ipc/nativeBridge.ts
index 602d2925b..fb1a087fb 100644
--- a/electron/ipc/nativeBridge.ts
+++ b/electron/ipc/nativeBridge.ts
@@ -61,6 +61,8 @@ export interface NativeBridgeContext {
*/
getNativeWindowHandle?: (sender: import("electron").WebContents) => Buffer | null;
getAiEditionDocuments: () => DocumentService;
+ /** OpenScreen's recordings folders, the current one first. Absent: deleting a project keeps its recordings. */
+ getRecordingsDirs?: () => { dirs: string[]; registryDir: string };
/** The one shared style preset service — it serialises writes per instance. */
getStylePresets: () => StylePresetService;
getAiEditionLlmConfig: () => import("../ai-edition/llm-config-store").LlmConfigStore;
@@ -247,6 +249,13 @@ export function registerNativeBridgeHandlers(context: NativeBridgeContext) {
// hit the macOS Keychain) while wiring the bridge at startup.
llmConfig: context.getAiEditionLlmConfig,
mcp: context.getMcpController?.(),
+ recordings: context.getRecordingsDirs
+ ? {
+ dirs: () => context.getRecordingsDirs?.().dirs ?? [],
+ registryDir: () => context.getRecordingsDirs?.().registryDir ?? "",
+ trashItem: (filePath) => shell.trashItem(filePath),
+ }
+ : undefined,
runChat: context.runAiEditionChat,
undoLastToolBatch: context.undoAiEditionToolBatch,
rewindToMessage: context.rewindToMessage,
@@ -567,7 +576,15 @@ export function registerNativeBridgeHandlers(context: NativeBridgeContext) {
case "document.delete":
return createSuccessResponse(
requestId,
- await aiEditionService.deleteProject(request.payload.projectId),
+ await aiEditionService.deleteProject(
+ request.payload.projectId,
+ request.payload.recordings,
+ ),
+ );
+ case "document.recordings":
+ return createSuccessResponse(
+ requestId,
+ await aiEditionService.projectRecordings(request.payload.projectId),
);
case "document.addAsset":
return createSuccessResponse(
diff --git a/electron/media/mediaLinksRegistry.test.ts b/electron/media/mediaLinksRegistry.test.ts
index 7c76a7580..dd5570930 100644
--- a/electron/media/mediaLinksRegistry.test.ts
+++ b/electron/media/mediaLinksRegistry.test.ts
@@ -6,6 +6,7 @@ import {
computeFingerprint,
findMediaLinksByFingerprint,
findRelocatedMediaByStoredPath,
+ forgetMediaLinks,
registerMediaLinks,
whenRegistryIdle,
} from "./mediaLinksRegistry";
@@ -59,6 +60,22 @@ describe("mediaLinksRegistry", () => {
await rmBestEffort(tempDir);
});
+ describe("forgetMediaLinks", () => {
+ it("drops only the entries of the deleted recordings", async () => {
+ const kept = path.join(tempDir, "recording-1.mp4");
+ const deleted = path.join(tempDir, "recording-2.mp4");
+ await writeFileOfSize(kept, 1024, "k");
+ await writeFileOfSize(deleted, 2048, "d");
+ await registerMediaLinks(tempDir, kept, { cursorTelemetryPath: `${kept}.cursor.json` });
+ await registerMediaLinks(tempDir, deleted, { cursorTelemetryPath: `${deleted}.cursor.json` });
+
+ await forgetMediaLinks(tempDir, [deleted, `${deleted}.cursor.json`]);
+
+ expect(await findMediaLinksByFingerprint(tempDir, kept)).not.toBeNull();
+ expect(await findMediaLinksByFingerprint(tempDir, deleted)).toBeNull();
+ });
+ });
+
describe("computeFingerprint", () => {
it("never reads more than the head+tail sample regardless of file size", async () => {
const bigPath = path.join(tempDir, "big.webm");
diff --git a/electron/media/mediaLinksRegistry.ts b/electron/media/mediaLinksRegistry.ts
index 92f3c0b19..bcddc5c13 100644
--- a/electron/media/mediaLinksRegistry.ts
+++ b/electron/media/mediaLinksRegistry.ts
@@ -256,6 +256,20 @@ export async function registerMediaLinks(
});
}
+/** Drops the entries of deleted recordings, matched by the path they were last seen at. */
+export async function forgetMediaLinks(
+ baseDir: string,
+ deletedPaths: readonly string[],
+): Promise<void> {
+ if (deletedPaths.length === 0) return;
+ const deleted = deletedPaths.map((p) => path.resolve(p));
+ const isDeleted = (p: string) => deleted.some((d) => path.relative(d, path.resolve(p)) === "");
+ await updateRegistry(baseDir, (file) => ({
+ version: 1,
+ entries: file.entries.filter((e) => !isDeleted(e.lastKnownPath)),
+ }));
+}
+
export interface MediaLinksLookup {
webcamVideoPath?: string;
webcamOffsetMs?: number;
diff --git a/electron/native-bridge/services/aiEditionService.deleteRecordings.test.ts b/electron/native-bridge/services/aiEditionService.deleteRecordings.test.ts
new file mode 100644
index 000000000..44110bbf9
--- /dev/null
+++ b/electron/native-bridge/services/aiEditionService.deleteRecordings.test.ts
@@ -0,0 +1,98 @@
+import fs from "node:fs/promises";
+import os from "node:os";
+import path from "node:path";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { DocumentService } from "../../ai-edition/document-service";
+import { findMediaLinksByFingerprint, registerMediaLinks } from "../../media/mediaLinksRegistry";
+import { AiEditionService, type AiEditionServiceOptions } from "./aiEditionService";
+
+describe("AiEditionService — deleting a project's recordings", () => {
+ let root: string;
+ let recordingsDir: string;
+ let documents: DocumentService;
+ let video: string;
+ let cursor: string;
+ let projectId: string;
+ let trashItem: ReturnType<typeof vi.fn<(filePath: string) => Promise<void>>>;
+
+ function service(): AiEditionService {
+ return new AiEditionService({
+ documents,
+ llmConfig: () => {
+ throw new Error("not used");
+ },
+ recordings: {
+ dirs: () => [recordingsDir],
+ registryDir: () => recordingsDir,
+ trashItem,
+ },
+ } as unknown as AiEditionServiceOptions);
+ }
+
+ beforeEach(async () => {
+ root = await fs.mkdtemp(path.join(os.tmpdir(), "openscreen-delete-recordings-"));
+ recordingsDir = path.join(root, "recordings");
+ await fs.mkdir(recordingsDir);
+ documents = new DocumentService(path.join(root, "projects"), root);
+ video = path.join(recordingsDir, "recording-42.mp4");
+ cursor = `${video}.cursor.json`;
+ await fs.writeFile(video, "video");
+ await fs.writeFile(cursor, "{}");
+ await registerMediaLinks(recordingsDir, video, { cursorTelemetryPath: cursor });
+ const doc = await documents.createProject("Take");
+ await documents.addAsset(doc.project.id, { path: video, label: "recording-42.mp4" });
+ projectId = doc.project.id;
+ trashItem = vi.fn(async (filePath: string) => {
+ await fs.rm(filePath);
+ });
+ });
+
+ afterEach(async () => {
+ await fs.rm(root, { recursive: true, force: true });
+ });
+
+ it("reports what the delete could remove", async () => {
+ await expect(service().projectRecordings(projectId)).resolves.toEqual({
+ success: true,
+ count: 1,
+ sizeBytes: 5 + 2,
+ keptFor: [],
+ });
+ });
+
+ it("keeps the recordings unless asked", async () => {
+ await expect(service().deleteProject(projectId)).resolves.toEqual({ success: true });
+ expect(trashItem).not.toHaveBeenCalled();
+ await expect(fs.access(video)).resolves.toBeUndefined();
+ });
+
+ it("moves them to the Trash, deletes the project and forgets their links", async () => {
+ await fs.writeFile(path.join(root, "probe.mp4"), "video");
+ await expect(service().deleteProject(projectId, "trash")).resolves.toEqual({ success: true });
+
+ expect(trashItem).toHaveBeenCalledTimes(2);
+ await expect(documents.getProject(projectId)).rejects.toThrow();
+ // Same bytes as the deleted take: only its registry entry could match.
+ expect(
+ await findMediaLinksByFingerprint(recordingsDir, path.join(root, "probe.mp4")),
+ ).toBeNull();
+ });
+
+ it("keeps everything when the Trash refuses, then deletes permanently on request", async () => {
+ trashItem.mockRejectedValueOnce(new Error("no trash on this filesystem"));
+
+ await expect(service().deleteProject(projectId, "trash")).resolves.toMatchObject({
+ success: false,
+ trashFailed: true,
+ });
+ await expect(documents.getProject(projectId)).resolves.toBeDefined();
+ await expect(fs.access(video)).resolves.toBeUndefined();
+
+ await expect(service().deleteProject(projectId, "permanent")).resolves.toEqual({
+ success: true,
+ });
+ await expect(fs.access(video)).rejects.toThrow();
+ await expect(fs.access(cursor)).rejects.toThrow();
+ await expect(documents.getProject(projectId)).rejects.toThrow();
+ });
+});
diff --git a/electron/native-bridge/services/aiEditionService.ts b/electron/native-bridge/services/aiEditionService.ts
index 553a049ff..20e2f6b69 100644
--- a/electron/native-bridge/services/aiEditionService.ts
+++ b/electron/native-bridge/services/aiEditionService.ts
@@ -9,12 +9,15 @@ import type {
AiEditionChatRewindResult,
AiEditionChatSession,
AiEditionChatSessionSummary,
+ AiEditionDeleteResult,
AiEditionDocumentResult,
AiEditionLlmConfig,
AiEditionLlmDisconnectResult,
AiEditionLlmSnapshot,
AiEditionMcpStatus,
+ AiEditionProjectRecordingsResult,
AiEditionProjectSummary,
+ AiEditionRecordingsDisposal,
} from "../../../src/native/contracts";
import {
type CaptionTranslateSegment,
@@ -31,8 +34,10 @@ import {
listOpenRouterModels,
probeMiniMaxModels,
} from "../../ai-edition/llm-provider-auth";
+import { findProjectRecordings, removeRecordingSets } from "../../ai-edition/project-recordings";
import { PROVIDER_DEFINITIONS } from "../../ai-edition/provider-registry";
import type { McpController } from "../../mcp/mcp-controller";
+import { forgetMediaLinks } from "../../media/mediaLinksRegistry";
export interface AiEditionServiceOptions {
documents: DocumentService;
@@ -86,6 +91,13 @@ export interface AiEditionServiceOptions {
deleteSession: (projectId: string, sessionId: string) => boolean;
/** The local MCP server. Absent where no server is wired (tests, headless CLI). */
mcp?: McpController;
+ /** OpenScreen's recordings folders. Absent: a project's recordings are always kept. */
+ recordings?: {
+ dirs: () => string[];
+ /** Where `media-links.registry.json` lives. */
+ registryDir: () => string;
+ trashItem: (filePath: string) => Promise<void>;
+ };
}
export class AiEditionService {
@@ -145,7 +157,59 @@ export class AiEditionService {
}
}
- async deleteProject(projectId: string): Promise<AiEditionDocumentResult> {
+ async projectRecordings(projectId: string): Promise<AiEditionProjectRecordingsResult> {
+ const recordings = this.options.recordings;
+ if (!recordings) return { success: true, count: 0, sizeBytes: 0, keptFor: [] };
+ try {
+ const { owned, keptFor } = await findProjectRecordings(
+ projectId,
+ await this.options.documents.readAllProjects(),
+ recordings.dirs(),
+ );
+ return {
+ success: true,
+ count: owned.length,
+ sizeBytes: owned.reduce((sum, set) => sum + set.sizeBytes, 0),
+ keptFor,
+ };
+ } catch (error) {
+ return {
+ success: false,
+ count: 0,
+ sizeBytes: 0,
+ keptFor: [],
+ error: error instanceof Error ? error.message : String(error),
+ };
+ }
+ }
+
+ async deleteProject(
+ projectId: string,
+ disposal: AiEditionRecordingsDisposal = "keep",
+ ): Promise<AiEditionDeleteResult> {
+ const recordings = this.options.recordings;
+ // The recordings go first: a project whose files could not be removed is kept, so
+ // the user can retry, instead of leaving takes that nothing points at any more.
+ if (disposal !== "keep" && recordings) {
+ try {
+ const { owned } = await findProjectRecordings(
+ projectId,
+ await this.options.documents.readAllProjects(),
+ recordings.dirs(),
+ );
+ await removeRecordingSets(owned, disposal, recordings.trashItem);
+ await forgetMediaLinks(
+ recordings.registryDir(),
+ owned.flatMap((set) => set.files),
+ ).catch((error) => console.warn("[ai-edition] could not update media links:", error));
+ } catch (error) {
+ return {
+ success: false,
+ trashFailed: disposal === "trash",
+ error: error instanceof Error ? error.message : String(error),
+ };
+ }
+ }
try {
await this.options.documents.deleteProject(projectId);
} catch (error) {
diff --git a/src/components/ai-edition/Modals.tsx b/src/components/ai-edition/Modals.tsx
index abe259c12..10846c192 100644
--- a/src/components/ai-edition/Modals.tsx
+++ b/src/components/ai-edition/Modals.tsx
@@ -11,9 +11,15 @@ import type { CropRegion } from "@/components/video-editor/types";
import { useScopedT } from "@/contexts/I18nContext";
import type { AxcutClip } from "@/lib/ai-edition/schema";
import { formatSeconds } from "@/lib/ai-edition/timeline/format";
+import type {
+ AiEditionProjectRecordingsResult,
+ AiEditionRecordingsDisposal,
+} from "@/native/contracts";
+import { formatBytes } from "@/utils/formatBytes";
+import { getPlatform } from "@/utils/platformUtils";
import { cropDraftFromRegion, cropDraftToPct, previewBoxStyle } from "./cropDraft";
import styles from "./NewEditorShell.module.css";
-import { ChoiceRow } from "./RightPanes";
+import { ChoiceRow, Toggle } from "./RightPanes";
import type { VideoSource } from "./VirtualPreview";
interface BaseModalProps {
@@ -124,7 +130,12 @@ interface OpenProjectModalProps extends BaseModalProps {
projects: ProjectItem[];
activeProjectId: string | null;
onSelect: (id: string) => void;
- onDelete: (id: string) => void;
+ onDelete: (
+ id: string,
+ recordings: AiEditionRecordingsDisposal,
+ ) => Promise<{ trashFailed?: boolean } | undefined>;
+ /** The recordings deleting `id` could also remove. */
+ loadRecordings: (id: string) => Promise<AiEditionProjectRecordingsResult>;
onBrowse: () => void;
}
@@ -135,6 +146,7 @@ export function OpenProjectModal({
activeProjectId,
onSelect,
onDelete,
+ loadRecordings,
onBrowse,
}: OpenProjectModalProps) {
const t = useScopedT("editor");
@@ -144,9 +156,48 @@ export function OpenProjectModal({
// confirm on its own row instead of deleting on the first click. One row at a
// time, and closing the dialog disarms it.
const [confirmId, setConfirmId] = useState<string | null>(null);
+ const [recordings, setRecordings] = useState<AiEditionProjectRecordingsResult | null>(null);
+ const [trashRecordings, setTrashRecordings] = useState(false);
+ const [trashFailed, setTrashFailed] = useState(false);
+ const [deleting, setDeleting] = useState(false);
+ const armedIdRef = useRef<string | null>(null);
+ const arm = (id: string | null) => {
+ armedIdRef.current = id;
+ setConfirmId(id);
+ setRecordings(null);
+ setTrashRecordings(false);
+ setTrashFailed(false);
+ if (!id) return;
+ void loadRecordings(id)
+ .then((result) => {
+ if (armedIdRef.current === id && result.success) setRecordings(result);
+ })
+ // Without the answer the row offers no toggle, and the delete keeps the recordings.
+ .catch(() => undefined);
+ };
+ // biome-ignore lint/correctness/useExhaustiveDependencies: disarm only when the dialog closes
useEffect(() => {
- if (!open) setConfirmId(null);
+ if (!open) arm(null);
}, [open]);
+ const recycleBin = getPlatform() === "win32";
+ const confirmDelete = async (id: string) => {
+ const disposal: AiEditionRecordingsDisposal = trashFailed
+ ? "permanent"
+ : trashRecordings && recordings && recordings.count > 0
+ ? "trash"
+ : "keep";
+ setDeleting(true);
+ try {
+ const result = await onDelete(id, disposal);
+ if (result?.trashFailed) {
+ setTrashFailed(true);
+ return;
+ }
+ arm(null);
+ } finally {
+ setDeleting(false);
+ }
+ };
const filtered = projects.filter((p) => p.title.toLowerCase().includes(query.toLowerCase()));
// The row ↑↓ moved to, or null for the default: the open project, or the first match once a
// search narrows the list. Enter opens it, as the footer says (#1135).
@@ -261,26 +312,75 @@ export function OpenProjectModal({
marginTop: 2,
}}
>
- {t("openProjectDialog.confirmDelete")}
+ {trashFailed
+ ? t(
+ recycleBin
+ ? "openProjectDialog.recycleFailed"
+ : "openProjectDialog.trashFailed",
+ )
+ : recordings && recordings.count > 0
+ ? t("openProjectDialog.confirmDeleteProject")
+ : t("openProjectDialog.confirmDelete")}
</div>
+ {!trashFailed && recordings && recordings.count > 0 ? (
+ <div
+ style={{
+ display: "flex",
+ alignItems: "center",
+ gap: 8,
+ marginTop: 8,
+ font: "400 12px/1.4 var(--font-body)",
+ }}
+ >
+ <Toggle
+ checked={trashRecordings}
+ onChange={setTrashRecordings}
+ ariaLabel={t(
+ recycleBin
+ ? "openProjectDialog.alsoRecycle"
+ : "openProjectDialog.alsoTrash",
+ { size: formatBytes(recordings.sizeBytes) },
+ )}
+ />
+ <span>
+ {t(
+ recycleBin
+ ? "openProjectDialog.alsoRecycle"
+ : "openProjectDialog.alsoTrash",
+ { size: formatBytes(recordings.sizeBytes) },
+ )}
+ </span>
+ </div>
+ ) : null}
+ {!trashFailed && recordings && recordings.keptFor.length > 0 ? (
+ <div
+ style={{
+ font: "400 12px/1.4 var(--font-body)",
+ color: "var(--muted)",
+ marginTop: 4,
+ }}
+ >
+ {t("openProjectDialog.recordingsKeptFor", {
+ projects: recordings.keptFor.join(", "),
+ })}
+ </div>
+ ) : null}
</div>
<button
type="button"
className={`${styles.btn} ${styles.btnSecondary}`}
- onClick={() => setConfirmId(null)}
+ onClick={() => arm(null)}
>
{tc("actions.cancel")}
</button>
<button
type="button"
className={`${styles.btn} ${styles.dangerBtn}`}
- onClick={() => {
- setConfirmId(null);
- onDelete(p.id);
- }}
+ disabled={deleting}
+ onClick={() => void confirmDelete(p.id)}
>
<Trash2 size={14} />
- {tc("actions.delete")}
+ {trashFailed ? t("openProjectDialog.deletePermanently") : tc("actions.delete")}
</button>
</div>
);
@@ -360,7 +460,7 @@ export function OpenProjectModal({
<button
type="button"
className={styles.iconBtn}
- onClick={() => setConfirmId(p.id)}
+ onClick={() => arm(p.id)}
title={t("openProjectDialog.deleteProject")}
aria-label={t("openProjectDialog.deleteProject")}
>
diff --git a/src/components/ai-edition/NewEditorShell.tsx b/src/components/ai-edition/NewEditorShell.tsx
index ea4b9904a..2a417df39 100644
--- a/src/components/ai-edition/NewEditorShell.tsx
+++ b/src/components/ai-edition/NewEditorShell.tsx
@@ -56,7 +56,7 @@ import {
import { firstTimelineBusyView } from "@/lib/ai-edition/transcription/status";
import { matchesShortcut } from "@/lib/shortcuts";
import { nativeBridgeClient } from "@/native";
-import type { AiEditionProjectSummary } from "@/native/contracts";
+import type { AiEditionProjectSummary, AiEditionRecordingsDisposal } from "@/native/contracts";
import { resolveVisibleClips } from "@/native/sceneDescription";
import { useNativePlaybackSync } from "@/native/useNativePlaybackSync";
import { ExportDialog } from "./ExportDialog";
@@ -891,26 +891,30 @@ export function NewEditorShell() {
[createProject],
);
- // The only way to get rid of a project short of deleting its file by hand.
- // Media is left alone on purpose: a recording can back several projects, and
- // the dialog says so before it asks.
- const handleDeleteProject = useCallback(async (id: string) => {
- try {
- const result = await nativeBridgeClient.aiEdition.delete(id);
- if (!result.success) throw new Error(result.error ?? "Failed to delete project");
- setProjectSummaries((prev) => prev.filter((p) => p.id !== id));
- // Deleting the project that is open leaves the editor pointing at a file
- // that no longer exists — any save from there would recreate it.
- if (useProjectStore.getState().projectId === id) {
- useProjectStore.getState().clear();
+ // Recordings are kept unless the user opts in, and even then only the ones no other
+ // project uses (`electron/ai-edition/project-recordings.ts`).
+ const handleDeleteProject = useCallback(
+ async (id: string, recordings: AiEditionRecordingsDisposal) => {
+ try {
+ const result = await nativeBridgeClient.aiEdition.delete(id, recordings);
+ if (!result.success && result.trashFailed) return { trashFailed: true };
+ if (!result.success) throw new Error(result.error ?? "Failed to delete project");
+ setProjectSummaries((prev) => prev.filter((p) => p.id !== id));
+ // Deleting the project that is open leaves the editor pointing at a file
+ // that no longer exists — any save from there would recreate it.
+ if (useProjectStore.getState().projectId === id) {
+ useProjectStore.getState().clear();
+ }
+ toast.success("Project deleted");
+ } catch (err) {
+ toast.error("Could not delete project", {
+ description: err instanceof Error ? err.message : String(err),
+ });
}
- toast.success("Project deleted");
- } catch (err) {
- toast.error("Could not delete project", {
- description: err instanceof Error ? err.message : String(err),
- });
- }
- }, []);
+ return undefined;
+ },
+ [],
+ );
const handleSave = useCallback(async () => {
const doc = useProjectStore.getState().document;
@@ -1824,6 +1828,7 @@ export function NewEditorShell() {
activeProjectId={projectId}
onSelect={handleSelectProject}
onDelete={handleDeleteProject}
+ loadRecordings={nativeBridgeClient.aiEdition.recordings}
onBrowse={handleBrowseProject}
/>
<NewProjectModal
diff --git a/src/components/ai-edition/OpenProjectModal.test.tsx b/src/components/ai-edition/OpenProjectModal.test.tsx
index ccc48c6db..cbc576b3d 100644
--- a/src/components/ai-edition/OpenProjectModal.test.tsx
+++ b/src/components/ai-edition/OpenProjectModal.test.tsx
@@ -1,11 +1,16 @@
// @vitest-environment jsdom
import "@testing-library/jest-dom";
-import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
import type { ReactElement } from "react";
import { afterEach, describe, expect, it, vi } from "vitest";
import { I18nProvider } from "@/contexts/I18nContext";
+import type { AiEditionProjectRecordingsResult } from "@/native/contracts";
import { OpenProjectModal } from "./Modals";
+// The Trash is called the Recycle Bin on Windows: pin the platform rather than inherit the host's.
+const platform = vi.hoisted(() => ({ current: "darwin" as NodeJS.Platform }));
+vi.mock("@/utils/platformUtils", () => ({ getPlatform: () => platform.current }));
+
function renderWithI18n(ui: ReactElement) {
return render(<I18nProvider>{ui}</I18nProvider>);
}
@@ -15,9 +20,23 @@ const projects = [
{ id: "proj_two", title: "Second project", updatedAt: "2026-08-13T10:00:00.000Z" },
];
-function renderModal(overrides: { onSelect?: () => void; onDelete?: () => void } = {}) {
+const noRecordings: AiEditionProjectRecordingsResult = {
+ success: true,
+ count: 0,
+ sizeBytes: 0,
+ keptFor: [],
+};
+
+function renderModal(
+ overrides: {
+ onSelect?: () => void;
+ onDelete?: (...args: unknown[]) => Promise<{ trashFailed?: boolean } | undefined>;
+ recordings?: AiEditionProjectRecordingsResult;
+ } = {},
+) {
const onSelect = overrides.onSelect ?? vi.fn();
- const onDelete = overrides.onDelete ?? vi.fn();
+ const onDelete = vi.fn(overrides.onDelete ?? (async () => undefined));
+ const loadRecordings = vi.fn(async () => overrides.recordings ?? noRecordings);
renderWithI18n(
<OpenProjectModal
open={true}
@@ -26,16 +45,25 @@ function renderModal(overrides: { onSelect?: () => void; onDelete?: () => void }
activeProjectId={null}
onSelect={onSelect}
onDelete={onDelete}
+ loadRecordings={loadRecordings}
onBrowse={vi.fn()}
/>,
);
- return { onSelect, onDelete };
+ return { onSelect, onDelete, loadRecordings };
}
+const ownRecordings: AiEditionProjectRecordingsResult = {
+ success: true,
+ count: 2,
+ sizeBytes: 24 * 1024 * 1024,
+ keptFor: [],
+};
+
describe("OpenProjectModal delete", () => {
afterEach(() => {
cleanup();
vi.clearAllMocks();
+ platform.current = "darwin";
});
it("asks before deleting instead of deleting on the first click", () => {
@@ -53,7 +81,58 @@ describe("OpenProjectModal delete", () => {
fireEvent.click(screen.getAllByRole("button", { name: /delete project/i })[1]);
fireEvent.click(screen.getByRole("button", { name: /^delete$/i }));
- expect(onDelete).toHaveBeenCalledWith("proj_two");
+ expect(onDelete).toHaveBeenCalledWith("proj_two", "keep");
+ });
+
+ it("offers to trash the project's recordings, off by default", async () => {
+ const { onDelete, loadRecordings } = renderModal({ recordings: ownRecordings });
+
+ fireEvent.click(screen.getAllByRole("button", { name: /delete project/i })[0]);
+ expect(loadRecordings).toHaveBeenCalledWith("proj_one");
+ const toggle = await screen.findByRole("button", {
+ name: /move its recordings to the trash \(24 MB\)/i,
+ });
+ expect(toggle).toHaveAttribute("aria-pressed", "false");
+ expect(screen.queryByText(/recordings are kept/i)).not.toBeInTheDocument();
+
+ fireEvent.click(toggle);
+ fireEvent.click(screen.getByRole("button", { name: /^delete$/i }));
+
+ await waitFor(() => expect(onDelete).toHaveBeenCalledWith("proj_one", "trash"));
+ });
+
+ it("says Recycle Bin on Windows", async () => {
+ platform.current = "win32";
+ renderModal({ recordings: ownRecordings });
+
+ fireEvent.click(screen.getAllByRole("button", { name: /delete project/i })[0]);
+
+ expect(await screen.findByText(/recycle bin \(24 MB\)/i)).toBeInTheDocument();
+ });
+
+ it("names the projects whose recordings are kept", async () => {
+ renderModal({ recordings: { ...ownRecordings, keptFor: ["Demo v2"] } });
+
+ fireEvent.click(screen.getAllByRole("button", { name: /delete project/i })[0]);
+
+ expect(await screen.findByText(/used by Demo v2 are kept/i)).toBeInTheDocument();
+ });
+
+ it("asks to delete permanently when the Trash refuses", async () => {
+ const { onDelete } = renderModal({
+ recordings: ownRecordings,
+ onDelete: async (_id, disposal) => (disposal === "trash" ? { trashFailed: true } : undefined),
+ });
+
+ fireEvent.click(screen.getAllByRole("button", { name: /delete project/i })[0]);
+ fireEvent.click(await screen.findByRole("button", { name: /move its recordings/i }));
+ fireEvent.click(screen.getByRole("button", { name: /^delete$/i }));
+
+ const permanent = await screen.findByRole("button", { name: /delete permanently/i });
+ expect(screen.getByText(/couldn't move the recordings to the trash/i)).toBeInTheDocument();
+ fireEvent.click(permanent);
+
+ await waitFor(() => expect(onDelete).toHaveBeenLastCalledWith("proj_one", "permanent"));
});
it("cancels back to the row", () => {
diff --git a/src/i18n/locales/ar/editor.json b/src/i18n/locales/ar/editor.json
index 293429b03..de4aa282f 100644
--- a/src/i18n/locales/ar/editor.json
+++ b/src/i18n/locales/ar/editor.json
@@ -346,7 +346,14 @@
"openHint": "للفتح",
"browseFiles": "تصفح الملفات…",
"deleteProject": "حذف المشروع",
- "confirmDelete": "هل تريد حذف هذا المشروع؟ سيتم الاحتفاظ بتسجيلاتك."
+ "confirmDelete": "هل تريد حذف هذا المشروع؟ سيتم الاحتفاظ بتسجيلاتك.",
+ "confirmDeleteProject": "هل تريد حذف هذا المشروع؟",
+ "alsoTrash": "نقل تسجيلاته أيضًا إلى سلة المهملات ({{size}})",
+ "alsoRecycle": "نقل تسجيلاته أيضًا إلى سلة المحذوفات ({{size}})",
+ "recordingsKeptFor": "يتم الاحتفاظ بالتسجيلات التي يستخدمها {{projects}}.",
+ "trashFailed": "تعذّر نقل التسجيلات إلى سلة المهملات. هل تريد حذفها نهائيًا؟",
+ "recycleFailed": "تعذّر نقل التسجيلات إلى سلة المحذوفات. هل تريد حذفها نهائيًا؟",
+ "deletePermanently": "حذف نهائي"
},
"editClipDialog": {
"title": "تعديل المقطع",
diff --git a/src/i18n/locales/cs/editor.json b/src/i18n/locales/cs/editor.json
index c4a15bc10..40dd022bb 100644
--- a/src/i18n/locales/cs/editor.json
+++ b/src/i18n/locales/cs/editor.json
@@ -346,7 +346,14 @@
"openHint": "pro otevření",
"browseFiles": "Procházet soubory…",
"deleteProject": "Smazat projekt",
- "confirmDelete": "Smazat tento projekt? Vaše nahrávky budou zachovány."
+ "confirmDelete": "Smazat tento projekt? Vaše nahrávky budou zachovány.",
+ "confirmDeleteProject": "Smazat tento projekt?",
+ "alsoTrash": "Přesunout také jeho nahrávky do koše ({{size}})",
+ "alsoRecycle": "Přesunout také jeho nahrávky do koše ({{size}})",
+ "recordingsKeptFor": "Nahrávky používané projektem {{projects}} zůstanou zachovány.",
+ "trashFailed": "Nahrávky se nepodařilo přesunout do koše. Smazat je trvale?",
+ "recycleFailed": "Nahrávky se nepodařilo přesunout do koše. Smazat je trvale?",
+ "deletePermanently": "Smazat trvale"
},
"editClipDialog": {
"title": "Upravit klip",
diff --git a/src/i18n/locales/de/editor.json b/src/i18n/locales/de/editor.json
index b2343eae0..3a88dcc8b 100644
--- a/src/i18n/locales/de/editor.json
+++ b/src/i18n/locales/de/editor.json
@@ -346,7 +346,14 @@
"openHint": "zum Öffnen",
"browseFiles": "Dateien durchsuchen…",
"deleteProject": "Projekt löschen",
- "confirmDelete": "Dieses Projekt löschen? Deine Aufnahmen bleiben erhalten."
+ "confirmDelete": "Dieses Projekt löschen? Deine Aufnahmen bleiben erhalten.",
+ "confirmDeleteProject": "Dieses Projekt löschen?",
+ "alsoTrash": "Auch die Aufnahmen in den Papierkorb legen ({{size}})",
+ "alsoRecycle": "Auch die Aufnahmen in den Papierkorb verschieben ({{size}})",
+ "recordingsKeptFor": "Aufnahmen, die {{projects}} verwendet, bleiben erhalten.",
+ "trashFailed": "Die Aufnahmen konnten nicht in den Papierkorb gelegt werden. Endgültig löschen?",
+ "recycleFailed": "Die Aufnahmen konnten nicht in den Papierkorb verschoben werden. Endgültig löschen?",
+ "deletePermanently": "Endgültig löschen"
},
"editClipDialog": {
"title": "Clip bearbeiten",
diff --git a/src/i18n/locales/en/editor.json b/src/i18n/locales/en/editor.json
index 654c987e6..4944dcccf 100644
--- a/src/i18n/locales/en/editor.json
+++ b/src/i18n/locales/en/editor.json
@@ -346,7 +346,14 @@
"openHint": "to open",
"browseFiles": "Browse files…",
"deleteProject": "Delete project",
- "confirmDelete": "Delete this project? Your recordings are kept."
+ "confirmDelete": "Delete this project? Your recordings are kept.",
+ "confirmDeleteProject": "Delete this project?",
+ "alsoTrash": "Also move its recordings to the Trash ({{size}})",
+ "alsoRecycle": "Also move its recordings to the Recycle Bin ({{size}})",
+ "recordingsKeptFor": "Recordings used by {{projects}} are kept.",
+ "trashFailed": "Couldn't move the recordings to the Trash. Delete them permanently?",
+ "recycleFailed": "Couldn't move the recordings to the Recycle Bin. Delete them permanently?",
+ "deletePermanently": "Delete permanently"
},
"editClipDialog": {
"title": "Edit clip",
diff --git a/src/i18n/locales/es/editor.json b/src/i18n/locales/es/editor.json
index 10ef581c6..4dddbad0b 100644
--- a/src/i18n/locales/es/editor.json
+++ b/src/i18n/locales/es/editor.json
@@ -346,7 +346,14 @@
"openHint": "para abrir",
"browseFiles": "Explorar archivos…",
"deleteProject": "Eliminar proyecto",
- "confirmDelete": "¿Eliminar este proyecto? Tus grabaciones se conservan."
+ "confirmDelete": "¿Eliminar este proyecto? Tus grabaciones se conservan.",
+ "confirmDeleteProject": "¿Eliminar este proyecto?",
+ "alsoTrash": "Mover también sus grabaciones a la Papelera ({{size}})",
+ "alsoRecycle": "Mover también sus grabaciones a la Papelera de reciclaje ({{size}})",
+ "recordingsKeptFor": "Se conservan las grabaciones que usa {{projects}}.",
+ "trashFailed": "No se pudieron mover las grabaciones a la Papelera. ¿Eliminarlas definitivamente?",
+ "recycleFailed": "No se pudieron mover las grabaciones a la Papelera de reciclaje. ¿Eliminarlas definitivamente?",
+ "deletePermanently": "Eliminar definitivamente"
},
"editClipDialog": {
"title": "Editar clip",
diff --git a/src/i18n/locales/fr/editor.json b/src/i18n/locales/fr/editor.json
index 6c145d57d..d06dd8154 100644
--- a/src/i18n/locales/fr/editor.json
+++ b/src/i18n/locales/fr/editor.json
@@ -346,7 +346,14 @@
"openHint": "pour ouvrir",
"browseFiles": "Parcourir les fichiers…",
"deleteProject": "Supprimer le projet",
- "confirmDelete": "Supprimer ce projet ? Vos enregistrements sont conservés."
+ "confirmDelete": "Supprimer ce projet ? Vos enregistrements sont conservés.",
+ "confirmDeleteProject": "Supprimer ce projet ?",
+ "alsoTrash": "Placer aussi ses enregistrements dans la Corbeille ({{size}})",
+ "alsoRecycle": "Placer aussi ses enregistrements dans la Corbeille ({{size}})",
+ "recordingsKeptFor": "Les enregistrements utilisés par {{projects}} sont conservés.",
+ "trashFailed": "Impossible de placer les enregistrements dans la Corbeille. Les supprimer définitivement ?",
+ "recycleFailed": "Impossible de placer les enregistrements dans la Corbeille. Les supprimer définitivement ?",
+ "deletePermanently": "Supprimer définitivement"
},
"editClipDialog": {
"title": "Modifier le clip",
diff --git a/src/i18n/locales/it/editor.json b/src/i18n/locales/it/editor.json
index ef4a46b4c..79977a9fb 100644
--- a/src/i18n/locales/it/editor.json
+++ b/src/i18n/locales/it/editor.json
@@ -346,7 +346,14 @@
"openHint": "per aprire",
"browseFiles": "Sfoglia file…",
"deleteProject": "Elimina progetto",
- "confirmDelete": "Eliminare questo progetto? Le tue registrazioni vengono conservate."
+ "confirmDelete": "Eliminare questo progetto? Le tue registrazioni vengono conservate.",
+ "confirmDeleteProject": "Eliminare questo progetto?",
+ "alsoTrash": "Sposta anche le registrazioni nel Cestino ({{size}})",
+ "alsoRecycle": "Sposta anche le registrazioni nel Cestino ({{size}})",
+ "recordingsKeptFor": "Le registrazioni usate da {{projects}} vengono mantenute.",
+ "trashFailed": "Impossibile spostare le registrazioni nel Cestino. Eliminarle definitivamente?",
+ "recycleFailed": "Impossibile spostare le registrazioni nel Cestino. Eliminarle definitivamente?",
+ "deletePermanently": "Elimina definitivamente"
},
"editClipDialog": {
"title": "Modifica clip",
diff --git a/src/i18n/locales/ja-JP/editor.json b/src/i18n/locales/ja-JP/editor.json
index da28ac389..fc033cccd 100644
--- a/src/i18n/locales/ja-JP/editor.json
+++ b/src/i18n/locales/ja-JP/editor.json
@@ -346,7 +346,14 @@
"openHint": "で開く",
"browseFiles": "ファイルを参照…",
"deleteProject": "プロジェクトを削除",
- "confirmDelete": "このプロジェクトを削除しますか?録画ファイルは保持されます。"
+ "confirmDelete": "このプロジェクトを削除しますか?録画ファイルは保持されます。",
+ "confirmDeleteProject": "このプロジェクトを削除しますか?",
+ "alsoTrash": "録画もゴミ箱に移動する({{size}})",
+ "alsoRecycle": "録画もごみ箱に移動する({{size}})",
+ "recordingsKeptFor": "{{projects}} で使われている録画は残ります。",
+ "trashFailed": "録画をゴミ箱に移動できませんでした。完全に削除しますか?",
+ "recycleFailed": "録画をごみ箱に移動できませんでした。完全に削除しますか?",
+ "deletePermanently": "完全に削除"
},
"editClipDialog": {
"title": "クリップを編集",
diff --git a/src/i18n/locales/ko-KR/editor.json b/src/i18n/locales/ko-KR/editor.json
index e77b0e817..929b122f3 100644
--- a/src/i18n/locales/ko-KR/editor.json
+++ b/src/i18n/locales/ko-KR/editor.json
@@ -346,7 +346,14 @@
"openHint": "열기",
"browseFiles": "파일 찾아보기…",
"deleteProject": "프로젝트 삭제",
- "confirmDelete": "이 프로젝트를 삭제할까요? 녹화 파일은 유지됩니다."
+ "confirmDelete": "이 프로젝트를 삭제할까요? 녹화 파일은 유지됩니다.",
+ "confirmDeleteProject": "이 프로젝트를 삭제할까요?",
+ "alsoTrash": "녹화 파일도 휴지통으로 이동 ({{size}})",
+ "alsoRecycle": "녹화 파일도 휴지통으로 이동 ({{size}})",
+ "recordingsKeptFor": "{{projects}}에서 사용 중인 녹화 파일은 유지됩니다.",
+ "trashFailed": "녹화 파일을 휴지통으로 이동하지 못했습니다. 영구적으로 삭제할까요?",
+ "recycleFailed": "녹화 파일을 휴지통으로 이동하지 못했습니다. 영구적으로 삭제할까요?",
+ "deletePermanently": "영구 삭제"
},
"editClipDialog": {
"title": "클립 편집",
diff --git a/src/i18n/locales/pt-BR/editor.json b/src/i18n/locales/pt-BR/editor.json
index d79f9a2f1..445c58538 100644
--- a/src/i18n/locales/pt-BR/editor.json
+++ b/src/i18n/locales/pt-BR/editor.json
@@ -346,7 +346,14 @@
"openHint": "para abrir",
"browseFiles": "Procurar arquivos…",
"deleteProject": "Excluir projeto",
- "confirmDelete": "Excluir este projeto? Suas gravações são mantidas."
+ "confirmDelete": "Excluir este projeto? Suas gravações são mantidas.",
+ "confirmDeleteProject": "Excluir este projeto?",
+ "alsoTrash": "Mover também as gravações para a Lixeira ({{size}})",
+ "alsoRecycle": "Mover também as gravações para a Lixeira ({{size}})",
+ "recordingsKeptFor": "As gravações usadas por {{projects}} são mantidas.",
+ "trashFailed": "Não foi possível mover as gravações para a Lixeira. Excluí-las permanentemente?",
+ "recycleFailed": "Não foi possível mover as gravações para a Lixeira. Excluí-las permanentemente?",
+ "deletePermanently": "Excluir permanentemente"
},
"editClipDialog": {
"title": "Editar clipe",
diff --git a/src/i18n/locales/ru/editor.json b/src/i18n/locales/ru/editor.json
index 4b81e7597..921b984fb 100644
--- a/src/i18n/locales/ru/editor.json
+++ b/src/i18n/locales/ru/editor.json
@@ -346,7 +346,14 @@
"openHint": "чтобы открыть",
"browseFiles": "Обзор файлов…",
"deleteProject": "Удалить проект",
- "confirmDelete": "Удалить этот проект? Ваши записи сохранятся."
+ "confirmDelete": "Удалить этот проект? Ваши записи сохранятся.",
+ "confirmDeleteProject": "Удалить этот проект?",
+ "alsoTrash": "Также переместить его записи в Корзину ({{size}})",
+ "alsoRecycle": "Также переместить его записи в Корзину ({{size}})",
+ "recordingsKeptFor": "Записи, используемые в {{projects}}, сохраняются.",
+ "trashFailed": "Не удалось переместить записи в Корзину. Удалить их безвозвратно?",
+ "recycleFailed": "Не удалось переместить записи в Корзину. Удалить их безвозвратно?",
+ "deletePermanently": "Удалить безвозвратно"
},
"editClipDialog": {
"title": "Изменить клип",
diff --git a/src/i18n/locales/tr/editor.json b/src/i18n/locales/tr/editor.json
index bb248a352..b9cdf815e 100644
--- a/src/i18n/locales/tr/editor.json
+++ b/src/i18n/locales/tr/editor.json
@@ -346,7 +346,14 @@
"openHint": "açmak için",
"browseFiles": "Dosyalara göz at…",
"deleteProject": "Projeyi sil",
- "confirmDelete": "Bu proje silinsin mi? Kayıtlarınız korunur."
+ "confirmDelete": "Bu proje silinsin mi? Kayıtlarınız korunur.",
+ "confirmDeleteProject": "Bu proje silinsin mi?",
+ "alsoTrash": "Kayıtlarını da Çöp Sepeti'ne taşı ({{size}})",
+ "alsoRecycle": "Kayıtlarını da Geri Dönüşüm Kutusu'na taşı ({{size}})",
+ "recordingsKeptFor": "{{projects}} tarafından kullanılan kayıtlar korunur.",
+ "trashFailed": "Kayıtlar Çöp Sepeti'ne taşınamadı. Kalıcı olarak silinsin mi?",
+ "recycleFailed": "Kayıtlar Geri Dönüşüm Kutusu'na taşınamadı. Kalıcı olarak silinsin mi?",
+ "deletePermanently": "Kalıcı olarak sil"
},
"editClipDialog": {
"title": "Klibi düzenle",
diff --git a/src/i18n/locales/vi/editor.json b/src/i18n/locales/vi/editor.json
index c9940ac9b..d3fb571a6 100644
--- a/src/i18n/locales/vi/editor.json
+++ b/src/i18n/locales/vi/editor.json
@@ -346,7 +346,14 @@
"openHint": "để mở",
"browseFiles": "Duyệt tệp…",
"deleteProject": "Xoá dự án",
- "confirmDelete": "Xoá dự án này? Các bản ghi của bạn vẫn được giữ lại."
+ "confirmDelete": "Xoá dự án này? Các bản ghi của bạn vẫn được giữ lại.",
+ "confirmDeleteProject": "Xóa dự án này?",
+ "alsoTrash": "Đồng thời chuyển các bản ghi của dự án vào Thùng rác ({{size}})",
+ "alsoRecycle": "Đồng thời chuyển các bản ghi của dự án vào Thùng rác ({{size}})",
+ "recordingsKeptFor": "Các bản ghi được {{projects}} sử dụng sẽ được giữ lại.",
+ "trashFailed": "Không thể chuyển các bản ghi vào Thùng rác. Xóa vĩnh viễn?",
+ "recycleFailed": "Không thể chuyển các bản ghi vào Thùng rác. Xóa vĩnh viễn?",
+ "deletePermanently": "Xóa vĩnh viễn"
},
"editClipDialog": {
"title": "Chỉnh sửa clip",
diff --git a/src/i18n/locales/zh-CN/editor.json b/src/i18n/locales/zh-CN/editor.json
index 322a2566c..400710408 100644
--- a/src/i18n/locales/zh-CN/editor.json
+++ b/src/i18n/locales/zh-CN/editor.json
@@ -346,7 +346,14 @@
"openHint": "打开",
"browseFiles": "浏览文件…",
"deleteProject": "删除项目",
- "confirmDelete": "删除此项目?您的录制文件会保留。"
+ "confirmDelete": "删除此项目?您的录制文件会保留。",
+ "confirmDeleteProject": "删除此项目?",
+ "alsoTrash": "同时将其录制文件移到废纸篓({{size}})",
+ "alsoRecycle": "同时将其录制文件移到回收站({{size}})",
+ "recordingsKeptFor": "{{projects}} 使用的录制文件会保留。",
+ "trashFailed": "无法将录制文件移到废纸篓。要永久删除吗?",
+ "recycleFailed": "无法将录制文件移到回收站。要永久删除吗?",
+ "deletePermanently": "永久删除"
},
"editClipDialog": {
"title": "编辑片段",
diff --git a/src/i18n/locales/zh-TW/editor.json b/src/i18n/locales/zh-TW/editor.json
index 1e3bc73e0..020a5f080 100644
--- a/src/i18n/locales/zh-TW/editor.json
+++ b/src/i18n/locales/zh-TW/editor.json
@@ -346,7 +346,14 @@
"openHint": "開啟",
"browseFiles": "瀏覽檔案…",
"deleteProject": "刪除專案",
- "confirmDelete": "刪除此專案?您的錄影檔案會保留。"
+ "confirmDelete": "刪除此專案?您的錄影檔案會保留。",
+ "confirmDeleteProject": "要刪除此專案嗎?",
+ "alsoTrash": "同時將其錄製檔案移到垃圾桶({{size}})",
+ "alsoRecycle": "同時將其錄製檔案移到資源回收筒({{size}})",
+ "recordingsKeptFor": "{{projects}} 使用的錄製檔案會保留。",
+ "trashFailed": "無法將錄製檔案移到垃圾桶。要永久刪除嗎?",
+ "recycleFailed": "無法將錄製檔案移到資源回收筒。要永久刪除嗎?",
+ "deletePermanently": "永久刪除"
},
"editClipDialog": {
"title": "編輯片段",
diff --git a/src/native/browserShim.ts b/src/native/browserShim.ts
index 64b70a0d9..dda3fc007 100644
--- a/src/native/browserShim.ts
+++ b/src/native/browserShim.ts
@@ -549,6 +549,8 @@ function createShimBridgeClient() {
saveProjectsState();
return Promise.resolve({ success: true });
},
+ recordings: (_projectId: string) =>
+ Promise.resolve({ success: true, count: 0, sizeBytes: 0, keptFor: [] }),
addAsset: (projectId: string, path: string, label?: string, kind?: "video" | "audio") => {
const doc = documentsByProject[projectId];
if (!doc) return Promise.resolve({ assetId: "", document: null });
diff --git a/src/native/client.ts b/src/native/client.ts
index 779054801..bc012f2fb 100644
--- a/src/native/client.ts
+++ b/src/native/client.ts
@@ -7,13 +7,16 @@ import {
type AiEditionChatRewindResult,
type AiEditionChatSession,
type AiEditionChatSessionSummary,
+ type AiEditionDeleteResult,
type AiEditionDocumentResult,
type AiEditionLlmConfig,
type AiEditionLlmDisconnectResult,
type AiEditionLlmProviderModelsResult,
type AiEditionLlmSnapshot,
type AiEditionMcpStatus,
+ type AiEditionProjectRecordingsResult,
type AiEditionProjectSummary,
+ type AiEditionRecordingsDisposal,
type CursorCapabilities,
type CursorRecordingData,
type CursorTelemetryPoint,
@@ -204,10 +207,16 @@ export const nativeBridgeClient = {
action: "document.save",
payload: { document },
}),
- delete: (projectId: string) =>
- requireNativeBridgeData<AiEditionDocumentResult>({
+ delete: (projectId: string, recordings?: AiEditionRecordingsDisposal) =>
+ requireNativeBridgeData<AiEditionDeleteResult>({
domain: "aiEdition",
action: "document.delete",
+ payload: { projectId, recordings },
+ }),
+ recordings: (projectId: string) =>
+ requireNativeBridgeData<AiEditionProjectRecordingsResult>({
+ domain: "aiEdition",
+ action: "document.recordings",
payload: { projectId },
}),
addAsset: (projectId: string, path: string, label?: string, kind?: "video" | "audio") =>
diff --git a/src/native/contracts.ts b/src/native/contracts.ts
index 0e72ef45a..bb3c27924 100644
--- a/src/native/contracts.ts
+++ b/src/native/contracts.ts
@@ -283,6 +283,23 @@ export interface AiEditionDocumentResult {
error?: string;
}
+/** What happens to the recordings a project owns when it is deleted. */
+export type AiEditionRecordingsDisposal = "keep" | "trash" | "permanent";
+
+export interface AiEditionDeleteResult extends AiEditionDocumentResult {
+ /** The recordings could not go to the Trash; nothing was deleted, and a permanent delete may be offered. */
+ trashFailed?: boolean;
+}
+
+export interface AiEditionProjectRecordingsResult {
+ success: boolean;
+ count: number;
+ sizeBytes: number;
+ /** Titles of the other projects that keep some of this project's recordings in use. */
+ keptFor: string[];
+ error?: string;
+}
+
export interface AiEditionLlmConfig {
provider: string;
model: string;
@@ -646,6 +663,12 @@ export type NativeBridgeRequest =
| {
domain: "aiEdition";
action: "document.delete";
+ payload: { projectId: string; recordings?: AiEditionRecordingsDisposal };
+ requestId?: string;
+ }
+ | {
+ domain: "aiEdition";
+ action: "document.recordings";
payload: { projectId: string };
requestId?: string;
}
diff --git a/technical-documentation/testing/manual-e2e-checklist.md b/technical-documentation/testing/manual-e2e-checklist.md
index 213c06806..d2ab194b7 100644
--- a/technical-documentation/testing/manual-e2e-checklist.md
+++ b/technical-documentation/testing/manual-e2e-checklist.md
@@ -823,6 +823,13 @@ The mask comes from the native compositor (ONNX Runtime + the vendored selfie-se
- [ ] Choose a language, regenerate, and confirm the new transcript replaces the old one.
- [ ] Hover the inspector's switches and choice rows, in *Composition*, *Camera layout* and *Cursor*, with real mouse moves and again with the keyboard. Confirm no tooltip only repeats a visible label, that the icon-only options (camera preset, camera position, frame) each show their name, and that *Depth of field*, *Auto-hide when inactive*, *3D cursor*, *Click impact* and *Shrink on zoom* each show one line saying what they do, on the switch itself. See [tooltips.md](../engineering/tooltips.md).
+### Deleting a project's recordings — post-2.0.0
+
+- [ ] Record a take, open **Load Project**, click the trash icon on its row, and confirm the row offers *Also move its recordings to the Trash* (*Recycle Bin* on Windows) with a size, switched **off**. Delete with it off and confirm the files are still in the recordings folder.
+- [ ] Record again, delete with the switch **on**, and confirm the `.mp4`, its `.cursor.json`, its `.session.json` and any `-webcam` file are in the system Trash and can be restored from there.
+- [ ] Add one recording to two projects, delete one of them with the switch on, and confirm the row says the recording is kept for the other project by name, and that the other project still opens with its media.
+- [ ] Import a video from outside the recordings folder into a project, delete it, and confirm the dialog offers no switch and the file is untouched.
+
### Editor window bounds — post-1.10.0
- [ ] Move and resize the editor window, close it, reopen it, and confirm it returns at the same position and size.
@@ -960,6 +967,7 @@ These checks are the human slice: an agent cannot click Apple's picker (see abov
- [ ] Confirm the native compositor preview loads without a blank surface or renderer crash.
- [ ] Export MP4 and GIF and confirm the files open in a system media player.
- [ ] Close and relaunch the app and confirm a saved project can be reopened without data loss.
+- [ ] **post-2.0.0** — Run [Deleting a project's recordings](#deleting-a-projects-recordings--post-200) on GNOME and on KDE, and in the Flatpak build if it ships, and confirm the files land in the desktop's own Trash. Where the Trash refuses (a recordings folder on a drive with no Trash), confirm the row turns to *Delete them permanently?* and nothing is deleted until that is confirmed.
## Results log
diff --git a/website/docs/media-library.md b/website/docs/media-library.md
index ab8bddae5..20aab3c24 100644
--- a/website/docs/media-library.md
+++ b/website/docs/media-library.md
@@ -51,3 +51,5 @@ The **Format** control in the **Composition** facet sets the shape of the frame;
- **Import media** — opens the file picker.
**Open project** lists your recent `.openscreen` files with a search box, keyboard navigation, and a **Browse files…** escape hatch. You can also drop a `.openscreen` file onto the empty editor.
+
+The trash icon on a project's row deletes the project after a confirm. Its recordings are kept unless you switch on **Also move its recordings to the Trash** (**Recycle Bin** on Windows): that sends the takes in OpenScreen's recordings folder to the system Trash, except any another project still uses, which the row names. If the Trash refuses, as it can on some Linux setups and drives, OpenScreen asks before deleting them permanently.
diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/media-library.md b/website/i18n/de/docusaurus-plugin-content-docs/current/media-library.md
index 64e8edcd4..7b9ffa641 100644
--- a/website/i18n/de/docusaurus-plugin-content-docs/current/media-library.md
+++ b/website/i18n/de/docusaurus-plugin-content-docs/current/media-library.md
@@ -51,3 +51,5 @@ Die Einstellung **Format** im Tab **Composition** legt die Form des Bildes fest;
- **Import media**: öffnet die Dateiauswahl.
**Open project** listet deine zuletzt verwendeten `.openscreen`-Dateien mit Suchfeld, Tastaturnavigation und der Ausweichmöglichkeit **Browse files…**. Du kannst eine `.openscreen`-Datei auch auf den leeren Editor ziehen.
+
+Das Papierkorb-Symbol in der Zeile eines Projekts löscht das Projekt nach einer Rückfrage. Seine Aufnahmen bleiben erhalten, es sei denn, du schaltest **Auch die Aufnahmen in den Papierkorb legen** ein: Dann landen die Aufnahmen aus dem Aufnahmeordner von OpenScreen im Papierkorb des Systems, außer denen, die ein anderes Projekt noch verwendet; die Zeile nennt dieses Projekt. Verweigert der Papierkorb das, wie auf manchen Linux-Systemen und Laufwerken, fragt OpenScreen nach, bevor die Dateien endgültig gelöscht werden.
diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/media-library.md b/website/i18n/es/docusaurus-plugin-content-docs/current/media-library.md
index b2f15a9c1..d5dcced63 100644
--- a/website/i18n/es/docusaurus-plugin-content-docs/current/media-library.md
+++ b/website/i18n/es/docusaurus-plugin-content-docs/current/media-library.md
@@ -51,3 +51,5 @@ El control **Formato** del panel **Composición** define la forma del cuadro; **
- **Importar contenido**: abre el selector de archivos.
**Abrir proyecto** muestra tus archivos `.openscreen` recientes con un cuadro de búsqueda, navegación con el teclado y, como alternativa, **Explorar archivos…**. También puedes soltar un archivo `.openscreen` en el editor vacío.
+
+El icono de papelera en la fila de un proyecto lo elimina tras una confirmación. Sus grabaciones se conservan salvo que actives **Mover también sus grabaciones a la Papelera** (**Papelera de reciclaje** en Windows): las tomas de la carpeta de grabaciones de OpenScreen van a la Papelera del sistema, excepto las que otro proyecto todavía usa, que la fila nombra. Si la Papelera las rechaza, como puede ocurrir en algunos sistemas Linux y unidades, OpenScreen pregunta antes de eliminarlas definitivamente.
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/media-library.md b/website/i18n/fr/docusaurus-plugin-content-docs/current/media-library.md
index e317c5a20..0df291460 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/media-library.md
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/media-library.md
@@ -51,3 +51,5 @@ Le réglage **Format** de l'onglet **Composition** définit la forme du cadre 
- **Importer un média** : ouvre le sélecteur de fichiers.
**Ouvrir un projet** liste vos fichiers `.openscreen` récents avec un champ de recherche, la navigation au clavier et un bouton **Parcourir les fichiers…** pour chercher ailleurs. Vous pouvez aussi déposer un fichier `.openscreen` sur l'éditeur vide.
+
+L'icône de corbeille sur la ligne d'un projet le supprime après confirmation. Ses enregistrements sont conservés, sauf si vous activez **Placer aussi ses enregistrements dans la Corbeille** : les prises du dossier d'enregistrements d'OpenScreen partent alors dans la Corbeille du système, sauf celles qu'un autre projet utilise encore, que la ligne nomme. Si la Corbeille les refuse, comme sur certains systèmes Linux et certains disques, OpenScreen demande avant de les supprimer définitivement.
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/media-library.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/media-library.md
index 481eeee25..b84bbfefc 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/media-library.md
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/media-library.md
@@ -51,3 +51,5 @@ keywords:
- **メディアをインポート**:ファイルピッカーを開きます。
**プロジェクトを開く**には、最近使った `.openscreen` ファイルが一覧表示されます。検索ボックスとキーボード操作に対応し、一覧にないファイルは **ファイルを参照…** から選べます。空のエディターに `.openscreen` ファイルをドロップして開くこともできます。
+
+プロジェクトの行にあるゴミ箱アイコンを押すと、確認のあとでプロジェクトが削除されます。**録画もゴミ箱に移動する**をオンにしない限り、録画は残ります(Windows では**ごみ箱**)。オンにすると、OpenScreen の録画フォルダーにある録画がシステムのゴミ箱に移動します。ただし、ほかのプロジェクトがまだ使っている録画は残り、そのプロジェクト名が行に表示されます。一部の Linux 環境やドライブのようにゴミ箱へ移動できない場合は、完全に削除する前に OpenScreen が確認します。
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/media-library.md b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/media-library.md
index 1770bced4..c4a78d7af 100644
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/media-library.md
+++ b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/media-library.md
@@ -51,3 +51,5 @@ O controle **Formato** na aba **Composição** define a proporção do quadro; *
- **Importar mídia** — abre o seletor de arquivos.
**Abrir projeto** lista seus arquivos `.openscreen` recentes, com caixa de busca, navegação pelo teclado e a opção **Procurar arquivos…** como alternativa. Você também pode soltar um arquivo `.openscreen` no editor vazio.
+
+O ícone de lixeira na linha de um projeto o exclui após uma confirmação. As gravações dele são mantidas, a menos que você ative **Mover também as gravações para a Lixeira**: as tomadas da pasta de gravações do OpenScreen vão para a Lixeira do sistema, exceto as que outro projeto ainda usa, que a linha nomeia. Se a Lixeira recusar, como pode acontecer em alguns sistemas Linux e unidades, o OpenScreen pergunta antes de excluí-las permanentemente.
diff --git a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/media-library.md b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/media-library.md
index 8c4ecc5aa..aedf7c95f 100644
--- a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/media-library.md
+++ b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/media-library.md
@@ -51,3 +51,5 @@ keywords:
- **导入媒体**:打开文件选择器。
**打开项目**会列出你最近使用的 `.openscreen` 文件,提供搜索框、键盘导航,以及作为备用入口的**浏览文件…**。你也可以把 `.openscreen` 文件拖放到空白的编辑器中。
+
+点击项目行上的垃圾桶图标,确认后即可删除该项目。除非你打开**同时将其录制文件移到废纸篓**(Windows 上为**回收站**),否则录制文件会保留。打开后,OpenScreen 录制文件夹中的录制会被移到系统的废纸篓,但其他项目仍在使用的录制除外,该行会列出这些项目的名称。如果无法移到废纸篓(某些 Linux 环境和磁盘上可能出现这种情况),OpenScreen 会先询问你,再永久删除。
diff --git a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/media-library.md b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/media-library.md
index 270c34789..1938b74e6 100644
--- a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/media-library.md
+++ b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/media-library.md
@@ -51,3 +51,5 @@ keywords:
- **匯入媒體**:開啟檔案選擇器。
**開啟專案**會列出你最近使用的 `.openscreen` 檔案,並提供搜尋框、鍵盤導覽,以及 **瀏覽檔案…** 作為另一條路。你也可以將 `.openscreen` 檔案直接拖放到空白的編輯器上。
+
+按下專案列上的垃圾桶圖示,確認後即可刪除該專案。除非你開啟**同時將其錄製檔案移到垃圾桶**(Windows 上為**資源回收筒**),否則錄製檔案會保留。開啟後,OpenScreen 錄製資料夾中的錄製會移到系統的垃圾桶,但其他專案仍在使用的錄製除外,該列會列出那些專案的名稱。如果無法移到垃圾桶(某些 Linux 環境和磁碟上可能發生),OpenScreen 會先詢問你,再永久刪除。