feat(electron): project import/new-project IPC, menu wiring, HUD/editor anti-flash

- preload + native bridge: getPathForFile, loadProjectFileFromPath, and
  onMenuNewProject / onMenuImportVideo listeners.
- main process: New Project File-menu item (Cmd/Ctrl+N) + menu-new-project.
- handlers: broaden import video formats (.m4v, .wmv, .flv, .ts).
- windows: keep main's HUD geometry + draggable handler; re-apply the
  show-on-ready-to-show anti-flash for the HUD and editor windows.
This commit is contained in:
makaradam
2026-05-31 09:40:21 +02:00
parent 1f43ef8004
commit 34ef71b363
9 changed files with 159 additions and 16 deletions
@@ -16,6 +16,7 @@ interface ProjectServiceOptions {
) => Promise<ProjectFileResult>;
loadProjectFile: () => Promise<ProjectFileResult>;
loadCurrentProjectFile: () => Promise<ProjectFileResult>;
loadProjectFileFromPath: (path: string) => Promise<ProjectFileResult>;
setCurrentVideoPath: (path: string) => ProjectPathResult | Promise<ProjectPathResult>;
getCurrentVideoPathResult: () => ProjectPathResult;
clearCurrentVideoPath: () => ProjectPathResult;
@@ -60,6 +61,12 @@ export class ProjectService {
return result;
}
async loadProjectFileFromPath(path: string) {
const result = await this.options.loadProjectFileFromPath(path);
this.getCurrentContext();
return result;
}
async setCurrentVideoPath(path: string) {
const result = await this.options.setCurrentVideoPath(path);
this.getCurrentContext();