Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/workflows/discord.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,21 @@ jobs:
return;
}

if (context.eventName === "pull_request_target" && ["edited", "labeled", "unlabeled", "ready_for_review", "converted_to_draft"].includes(action)) {
if (context.eventName === "pull_request_target" && ["edited", "labeled", "unlabeled", "ready_for_review", "converted_to_draft", "closed"].includes(action)) {
const isMergedAction = action === "closed" ? !!pr.merged : false;
const isClosedAction = action === "closed";
const statusTag = desiredStatusTag({
draft: action === "converted_to_draft" ? true : pr.draft,
reviewState,
merged: false,
closed: false,
merged: isMergedAction,
closed: isClosedAction,
});
const mappedLabelTags = tagIdsFromLabels(labels);
const appliedTags = [...new Set([statusTag, ...mappedLabelTags].filter(Boolean))];
await patchDiscordThread(threadId, {
name: trimThreadName(`PR #${number} - ${title}`),
...(appliedTags.length ? { applied_tags: appliedTags } : {}),
...(isMergedAction ? { archived: true, locked: true } : {}),
});
}

Expand Down Expand Up @@ -347,14 +350,6 @@ jobs:
};
} else if (action === "closed") {
const isMerged = !!pr.merged;
const statusTag = desiredStatusTag({ draft: false, reviewState, merged: isMerged, closed: true });
const mappedLabelTags = tagIdsFromLabels(labels);
const appliedTags = [...new Set([statusTag, ...mappedLabelTags].filter(Boolean))];
await patchDiscordThread(threadId, {
...(appliedTags.length ? { applied_tags: appliedTags } : {}),
...(isMerged ? { archived: true, locked: true } : {}),
});

updateMessage = isMerged
? `✅ PR #${number} was merged`
: `🛑 PR #${number} was closed without merge`;
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dist-ssr
*.sw?
release/**
*.kiro/
.claude/
CLAUDE.md
# npx electron-builder --mac --win

# Playwright
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" />
</a>
&nbsp;
<a href="https://discord.gg/yAQQhRaEeg">
<a href="https://discord.gg/B9W8BJ2V5U">
<img src="https://img.shields.io/discord/pHAUbcqNd?logo=discord&label=Discord&color=5865F2" alt="Join Discord" />
</a>
</p>
Expand Down
4 changes: 4 additions & 0 deletions electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
{
"from": "public/wallpapers",
"to": "assets/wallpapers"
},
{
"from": "public/audio",
"to": "assets/audio"
}
],

Expand Down
7 changes: 7 additions & 0 deletions electron/electron-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ interface Window {
fileName: string,
) => Promise<{ success: boolean; path?: string; message?: string; canceled?: boolean }>;
openVideoFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>;
openAudioFilePicker: () => Promise<{
success: boolean;
path?: string;
message?: string;
error?: string;
canceled?: boolean;
}>;
setCurrentVideoPath: (path: string) => Promise<{ success: boolean }>;
setCurrentRecordingSession: (
session: import("../src/lib/recordingSession").RecordingSession | null,
Expand Down
81 changes: 81 additions & 0 deletions electron/ipc/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ const PROJECT_FILE_EXTENSION = "openscreen";
const SHORTCUTS_FILE = path.join(app.getPath("userData"), "shortcuts.json");
const RECORDING_SESSION_SUFFIX = ".session.json";
const ALLOWED_IMPORT_VIDEO_EXTENSIONS = new Set([".webm", ".mp4", ".mov", ".avi", ".mkv"]);
const ALLOWED_IMPORT_AUDIO_EXTENSIONS = new Set([
".mp3",
".wav",
".m4a",
".aac",
".ogg",
".flac",
".webm",
]);

/**
* Paths explicitly approved by the user via file picker dialogs or project loads.
Expand Down Expand Up @@ -56,6 +65,10 @@ function hasAllowedImportVideoExtension(filePath: string): boolean {
return ALLOWED_IMPORT_VIDEO_EXTENSIONS.has(path.extname(filePath).toLowerCase());
}

function hasAllowedImportAudioExtension(filePath: string): boolean {
return ALLOWED_IMPORT_AUDIO_EXTENSIONS.has(path.extname(filePath).toLowerCase());
}

async function approveReadableVideoPath(
filePath?: string | null,
trustedDirs?: string[],
Expand Down Expand Up @@ -97,6 +110,33 @@ async function approveReadableVideoPath(
return normalizedPath;
}

async function approveReadableAudioPath(filePath?: string | null): Promise<string | null> {
const normalizedPath = normalizeVideoSourcePath(filePath);
if (!normalizedPath) {
return null;
}

if (isPathAllowed(normalizedPath)) {
return normalizedPath;
}

if (!hasAllowedImportAudioExtension(normalizedPath)) {
return null;
}

try {
const stats = await fs.stat(normalizedPath);
if (!stats.isFile()) {
return null;
}
} catch {
return null;
}

approveFilePath(normalizedPath);
return normalizedPath;
}

function resolveRecordingOutputPath(fileName: string): string {
const trimmed = fileName.trim();
if (!trimmed) {
Expand Down Expand Up @@ -769,6 +809,47 @@ export function registerIpcHandlers(
}
});

ipcMain.handle("open-audio-file-picker", async () => {
try {
const result = await dialog.showOpenDialog({
title: "Select audio",
defaultPath: app.getPath("music"),
filters: [
{
name: "Audio Files",
extensions: ["mp3", "wav", "m4a", "aac", "ogg", "flac", "webm"],
},
{ name: "All Files", extensions: ["*"] },
],
properties: ["openFile"],
});

if (result.canceled || result.filePaths.length === 0) {
return { success: false, canceled: true };
}

const approvedPath = await approveReadableAudioPath(result.filePaths[0]);
if (!approvedPath) {
return {
success: false,
message: "Selected file is not a supported audio file",
};
}

return {
success: true,
path: approvedPath,
};
} catch (error) {
console.error("Failed to open audio file picker:", error);
return {
success: false,
message: "Failed to open audio file picker",
error: String(error),
};
}
});

ipcMain.handle("reveal-in-folder", async (_, filePath: string) => {
try {
// shell.showItemInFolder doesn't return a value, it throws on error
Expand Down
3 changes: 3 additions & 0 deletions electron/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ contextBridge.exposeInMainWorld("electronAPI", {
openVideoFilePicker: () => {
return ipcRenderer.invoke("open-video-file-picker");
},
openAudioFilePicker: () => {
return ipcRenderer.invoke("open-audio-file-picker");
},
Comment thread
imAaryash marked this conversation as resolved.
setCurrentVideoPath: (path: string) => {
return ipcRenderer.invoke("set-current-video-path", path);
},
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"dnd-timeline": "^2.2.0",
"emoji-picker-react": "^4.16.1",
"fix-webm-duration": "^1.0.6",
"fuse.js": "^7.3.0",
"gif.js": "^0.2.0",
"gsap": "^3.13.0",
"lucide-react": "^0.545.0",
Expand Down
Binary file added public/audio/hooks/annotation.mp3
Binary file not shown.
Binary file added public/audio/hooks/blur.wav
Binary file not shown.
Binary file added public/audio/hooks/speed.mp3
Binary file not shown.
Binary file added public/audio/hooks/trim.wav
Binary file not shown.
Binary file added public/audio/hooks/zoom.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components/launch/LaunchWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export function LaunchWindow() {
};

return (
<div className={`w-screen h-screen overflow-hidden bg-transparent ${styles.electronDrag}`}>
<div className={`w-screen h-screen overflow-x-hidden bg-transparent ${styles.electronDrag}`}>
{systemLocaleSuggestion && (
<div
className={`fixed top-8 left-1/2 z-30 w-[calc(100vw-1rem)] max-w-[520px] -translate-x-1/2 rounded-xl border border-white/15 bg-[rgba(20,20,28,0.95)] p-3 shadow-2xl backdrop-blur-xl text-white animate-in fade-in-0 zoom-in-95 duration-200 ${styles.electronNoDrag}`}
Expand Down
Loading
Loading