Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

Show the Home dashboard skeleton throughout startup loading

webadderall2b90824289d7
diff --git a/electron/editorStartupView.test.ts b/electron/editorStartupView.test.ts
new file mode 100644
index 00000000..db1aa14e
--- /dev/null
+++ b/electron/editorStartupView.test.ts
@@ -0,0 +1,17 @@
+import { expect, it } from "vitest";
+import { resolveEditorStartupView } from "./editorStartupView";
+
+it("shows Home for an empty app session", () => {
+ expect(resolveEditorStartupView({})).toBe("home");
+});
+for (const source of [
+ { projectPath: "/projects/demo.recordly" },
+ { videoPath: "/recordings/demo.mp4" },
+ { recordingVideoPath: "/recordings/fresh.mp4" },
+ { devInput: "/fixtures/demo.mp4" },
+ { smokeExport: true },
+]) {
+ it(`uses the editor skeleton for ${Object.keys(source)[0]}`, () => {
+ expect(resolveEditorStartupView(source)).toBe("editor");
+ });
+}
diff --git a/electron/editorStartupView.ts b/electron/editorStartupView.ts
new file mode 100644
index 00000000..18636f58
--- /dev/null
+++ b/electron/editorStartupView.ts
@@ -0,0 +1,18 @@
+/** Resolve the destination before renderer code or project hydration runs. */
+export function resolveEditorStartupView({
+ projectPath,
+ videoPath,
+ recordingVideoPath,
+ devInput,
+ smokeExport,
+}: {
+ projectPath?: string | null;
+ videoPath?: string | null;
+ recordingVideoPath?: string | null;
+ devInput?: string;
+ smokeExport?: boolean;
+}): "home" | "editor" {
+ return projectPath || videoPath || recordingVideoPath || devInput || smokeExport
+ ? "editor"
+ : "home";
+}
diff --git a/electron/electron-env.d.ts b/electron/electron-env.d.ts
index 4fe2ecd4..c98cad95 100644
--- a/electron/electron-env.d.ts
+++ b/electron/electron-env.d.ts
@@ -1015,6 +1015,7 @@ interface Window {
}>;
getShortcuts: () => Promise<Record<string, unknown> | null>;
saveShortcuts: (shortcuts: unknown) => Promise<{ success: boolean; error?: string }>;
+ getEditorStartupView: () => "home" | "editor";
getAppSetting: (key: string) => unknown;
setAppSetting: (key: string, value: unknown) => boolean;
setHasUnsavedChanges: (hasChanges: boolean) => void;
diff --git a/electron/preload.ts b/electron/preload.ts
index 014914fc..46cef83c 100644
--- a/electron/preload.ts
+++ b/electron/preload.ts
@@ -1076,6 +1076,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
saveShortcuts: (shortcuts: unknown) => {
return ipcRenderer.invoke("save-shortcuts", shortcuts);
},
+ getEditorStartupView: (): "home" | "editor" => ipcRenderer.sendSync("get-editor-startup-view"),
getAppSetting: (key: string) => {
const result = ipcRenderer.sendSync("app-settings:get", key) as {
success?: boolean;
diff --git a/electron/windows.ts b/electron/windows.ts
index 4d1a52dc..745d6caa 100644
--- a/electron/windows.ts
+++ b/electron/windows.ts
@@ -1,3 +1,5 @@
+import { resolveEditorStartupView } from "./editorStartupView";
+import { currentProjectPath, currentVideoPath, currentRecordingSession } from "./ipc/state";
import { isHudInEditorMode } from "./hudEditorMode";
import fs from "node:fs";
import { createRequire } from "node:module";
@@ -54,6 +56,18 @@ const UPDATE_TOAST_HEIGHT = 172;
/** Shows a capture picker that never reported ready. */
const CAPTURE_PICKER_READY_TIMEOUT_MS = 1500;
+// Synchronous and metadata-only so the HTML boot shell matches its destination,
+// including reloads of a Home window after a fresh recording finishes.
+ipcMain.on("get-editor-startup-view", (event) => {
+ event.returnValue = resolveEditorStartupView({
+ projectPath: currentProjectPath,
+ videoPath: currentVideoPath,
+ recordingVideoPath: currentRecordingSession?.videoPath,
+ devInput: process.env.RECORDLY_DEV_OPEN_RECORDING_INPUT,
+ smokeExport: process.env.RECORDLY_SMOKE_EXPORT === "1",
+ });
+});
+
function getEditorWindowQuery(): Record<string, string> {
const query: Record<string, string> = {
windowType: "editor",
diff --git a/index.html b/index.html
index 60e65502..ebcb3cc7 100644
--- a/index.html
+++ b/index.html
@@ -6,11 +6,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Recordly</title>
<script>
- // Paint the editor shell before the renderer bundle is downloaded or evaluated.
+ // Paint the destination shell before the renderer bundle is downloaded or evaluated.
// Keep recording overlays transparent during their own startup.
document.documentElement.dataset.windowType =
new URLSearchParams(location.search).get("windowType") || "";
if (document.documentElement.dataset.windowType === "editor") {
+ let startupView = new URLSearchParams(location.search).get("startupView");
+ try { startupView = window.electronAPI?.getEditorStartupView?.() || startupView; }
+ catch { /* Fall back to the explicit destination if the bridge is unavailable. */ }
+ try { if (localStorage.getItem("recordly.open-dashboard")) startupView = "home"; }
+ catch { /* Home metadata can still be resolved through the desktop bridge. */ }
+ document.documentElement.dataset.startupView = startupView === "home" ? "home" : "editor";
let preference = "system";
try {
preference = window.electronAPI?.getAppSetting("recordly.theme") ||
@@ -28,11 +34,32 @@
html[data-window-type="editor"][data-theme="dark"] { background: #171719; }
html[data-window-type="editor"] .boot-shell {
--boot-block: #e5e5e9;
- position: fixed; inset: 0; display: flex; flex-direction: column;
+ position: fixed; inset: 0; flex-direction: column;
padding: 0 20px 20px; gap: 16px; box-sizing: border-box;
background: #f6f6f7; overflow: hidden;
}
html[data-theme="dark"] .boot-shell { --boot-block: #303034; background: #171719; }
+ html[data-window-type="editor"] .boot-editor { display: flex; }
+ html[data-window-type="editor"][data-startup-view="home"] .boot-editor { display: none; }
+ html[data-window-type="editor"][data-startup-view="home"] .boot-home { display: flex; flex-direction: row; padding: 0; gap: 0; }
+ .boot-home-sidebar { width: 192px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; padding: 48px 16px 20px; box-sizing: border-box; }
+ .boot-home-sidebar i { height: 32px; flex-shrink: 0; }
+ .boot-home-sidebar i:first-child { width: 128px; height: 40px; }
+ .boot-home-sidebar i:nth-child(2) { height: 40px; }
+ .boot-home-sidebar i:last-child { margin-top: auto; }
+ .boot-home-panel { flex: 1; min-width: 0; margin: 12px 12px 12px 0; padding: 0 28px; border-radius: 16px; background: #fff; box-shadow: 0 1px 3px #0001; }
+ html[data-theme="dark"] .boot-home-panel { background: #202023; }
+ .boot-home-toolbar { display: flex; gap: 20px; height: 96px; align-items: center; padding-top: 20px; box-sizing: border-box; }
+ .boot-home-toolbar i:first-child { flex: 1; height: 44px; }
+ .boot-home-toolbar i:last-child { width: 96px; height: 40px; }
+ .boot-home-filters { display: flex; gap: 12px; padding: 20px 0 28px; }
+ .boot-home-filters i { width: 80px; height: 28px; border-radius: 20px; }
+ .boot-home-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,280px),1fr)); gap: 40px 28px; }
+ .boot-home-grid > div { display: flex; flex-direction: column; gap: 16px; }
+ .boot-home-grid i:first-child { aspect-ratio: 4/3; border-radius: 12px; }
+ .boot-home-grid i:nth-child(2) { width: 75%; height: 16px; }
+ .boot-home-grid i:nth-child(3) { width: 33%; height: 12px; }
+ @media (min-width: 1024px) { .boot-home-sidebar { width: 224px; } .boot-home-panel { padding: 0 40px; } .boot-home-grid { column-gap: 36px; } }
.boot-shell i { display: block; background: var(--boot-block); border-radius: 8px; }
.boot-header { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }
.boot-header i { width: 96px; height: 28px; }
@@ -55,7 +82,7 @@
</head>
<body>
<div id="root">
- <div class="boot-shell" role="status" aria-label="Loading editor" aria-busy="true">
+ <div class="boot-shell boot-editor" role="status" aria-label="Loading editor" aria-busy="true">
<div class="boot-header" aria-hidden="true"><i></i><i></i><i></i></div>
<div class="boot-body" aria-hidden="true">
<div class="boot-rail"><i></i><i></i><i></i><i></i><i></i><i></i></div>
@@ -64,6 +91,14 @@
</div>
<div class="boot-timeline" aria-hidden="true"><i></i><i></i><i></i><i></i></div>
</div>
+ <div class="boot-shell boot-home" role="status" aria-label="Loading home" aria-busy="true">
+ <div class="boot-home-sidebar" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>
+ <div class="boot-home-panel" aria-hidden="true">
+ <div class="boot-home-toolbar"><i></i><i></i></div>
+ <div class="boot-home-filters"><i></i><i></i></div>
+ <div class="boot-home-grid"><div><i></i><i></i><i></i></div><div><i></i><i></i><i></i></div><div><i></i><i></i><i></i></div></div>
+ </div>
+ </div>
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
diff --git a/src/App.tsx b/src/App.tsx
index da0899f5..c3782661 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,6 +1,8 @@
import { Card } from "@heroui/react";
import { lazy, Suspense, useEffect, useState } from "react";
import { useI18n } from "./contexts/I18nContext";
+import { getStartupView } from "./lib/startupView";
+import { HomeLoadingSkeleton } from "./components/video-editor/dashboard/HomeLoadingSkeleton";
import { EditorLoadingSkeleton } from "./components/video-editor/layout/EditorLoadingSkeleton";
const HudWindow = lazy(() => import("./components/launch/HudWindow"));
@@ -106,7 +108,17 @@ export default function App() {
}
return (
- <Suspense fallback={windowType === "editor" ? <EditorLoadingSkeleton /> : null}>
+ <Suspense
+ fallback={
+ windowType === "editor" ? (
+ getStartupView() === "home" ? (
+ <HomeLoadingSkeleton />
+ ) : (
+ <EditorLoadingSkeleton />
+ )
+ ) : null
+ }
+ >
{content}
</Suspense>
);
diff --git a/src/components/video-editor/dashboard/HomeLoadingSkeleton.tsx b/src/components/video-editor/dashboard/HomeLoadingSkeleton.tsx
new file mode 100644
index 00000000..d948316a
--- /dev/null
+++ b/src/components/video-editor/dashboard/HomeLoadingSkeleton.tsx
@@ -0,0 +1,54 @@
+import { Card, Skeleton } from "@heroui/react";
+import { LibrarySkeleton } from "./LibrarySkeleton";
+
+/** Match the Home sidebar, search row and project cards while startup loads. */
+export function HomeLoadingSkeleton() {
+ return (
+ <div
+ role="status"
+ aria-label="Loading home"
+ aria-busy="true"
+ className="dashboard-shell flex h-screen overflow-hidden bg-background text-foreground"
+ >
+ <span className="sr-only">Loading home…</span>
+ <div
+ aria-hidden="true"
+ className="flex w-48 shrink-0 flex-col gap-5 px-4 pb-5 pt-12 lg:w-56"
+ >
+ <Skeleton className="h-10 w-32 rounded-lg" />
+ <Skeleton className="h-10 w-full rounded-lg" />
+ <div className="space-y-3">
+ {[0, 1, 2].map((key) => (
+ <Skeleton key={key} className="h-8 w-full rounded-lg" />
+ ))}
+ </div>
+ <div className="mt-4 space-y-4">
+ <Skeleton className="h-4 w-20" />
+ {[0, 1, 2].map((key) => (
+ <Skeleton key={key} className="h-6 w-full rounded-lg" />
+ ))}
+ </div>
+ <div className="mt-auto space-y-3">
+ <Skeleton className="h-8 w-full rounded-lg" />
+ <Skeleton className="h-8 w-full rounded-lg" />
+ </div>
+ </div>
+ <Card
+ aria-hidden="true"
+ className="my-3 mr-3 min-w-0 flex-1 gap-0 overflow-hidden rounded-2xl bg-background p-0 shadow-sm"
+ >
+ <div className="flex h-24 shrink-0 items-center gap-5 px-7 pt-5 lg:px-10">
+ <Skeleton className="h-11 min-w-0 flex-1 rounded-lg" />
+ <Skeleton className="h-10 w-24 rounded-lg" />
+ </div>
+ <div className="flex gap-3 px-7 pb-7 pt-5 lg:px-10">
+ <Skeleton className="h-7 w-20 rounded-full" />
+ <Skeleton className="h-7 w-28 rounded-full" />
+ </div>
+ <div className="overflow-hidden px-7 pb-10 lg:px-10">
+ <LibrarySkeleton />
+ </div>
+ </Card>
+ </div>
+ );
+}
diff --git a/src/components/video-editor/layout/EditorShell.tsx b/src/components/video-editor/layout/EditorShell.tsx
index b4e24c09..2ff5d67d 100644
--- a/src/components/video-editor/layout/EditorShell.tsx
+++ b/src/components/video-editor/layout/EditorShell.tsx
@@ -26,6 +26,8 @@ import type { useProjectState } from "../state/useProjectState";
import type { useTimelineState } from "../state/useTimelineState";
import { CropEditorDialog } from "./CropEditorDialog";
import { EditorDialogs } from "./EditorDialogs";
+import { getStartupView } from "@/lib/startupView";
+import { HomeLoadingSkeleton } from "../dashboard/HomeLoadingSkeleton";
import { EditorLoadingSkeleton } from "./EditorLoadingSkeleton";
import { EditorHeader } from "./EditorHeader";
import { EditorPreviewPanel } from "./EditorPreviewPanel";
@@ -207,7 +209,7 @@ export function EditorShell(props: Props) {
if (project.loading && !project.error)
return (
<>
- <EditorLoadingSkeleton />
+ {getStartupView() === "home" ? <HomeLoadingSkeleton /> : <EditorLoadingSkeleton />}
<RecordlySignInDialog
open={signInOpen}
onOpenChange={setSignInOpen}
diff --git a/src/lib/startupView.ts b/src/lib/startupView.ts
new file mode 100644
index 00000000..cc8d7a17
--- /dev/null
+++ b/src/lib/startupView.ts
@@ -0,0 +1,3 @@
+export function getStartupView(): "home" | "editor" {
+ return document.documentElement.dataset.startupView === "home" ? "home" : "editor";
+}
diff --git a/tests/ui/startup-loading.spec.ts b/tests/ui/startup-loading.spec.ts
index d470438c..c7afa90e 100644
--- a/tests/ui/startup-loading.spec.ts
+++ b/tests/ui/startup-loading.spec.ts
@@ -1,5 +1,5 @@
import { expect, test } from "@playwright/test";
-import { installDesktopBridge } from "./bridge";
+import { installDesktopBridge, installDesktopBridgeOverrides } from "./bridge";
test("editor paints a wireframe before JavaScript loads", async ({ page }) => {
await page.route("**/src/main.tsx*", (route) => route.abort());
@@ -8,7 +8,8 @@ test("editor paints a wireframe before JavaScript loads", async ({ page }) => {
await expect(page.locator(".boot-preview i").first()).toBeVisible();
await page.screenshot({ path: "test-results/startup-wireframe.png" });
await page.goto("/?windowType=hud-overlay");
- await expect(page.locator(".boot-shell")).not.toBeVisible();
+ await expect(page.locator(".boot-editor")).not.toBeVisible();
+ await expect(page.locator(".boot-home")).not.toBeVisible();
});
test("wireframe stays visible while the editor module loads, then gives way to the app", async ({
@@ -30,3 +31,149 @@ test("wireframe stays visible while the editor module loads, then gives way to t
await expect(page.getByRole("button", { name: "Home", exact: true })).toBeVisible();
await expect(page.getByRole("status", { name: "Loading editor" })).toHaveCount(0);
});
+
+for (const colorScheme of ["light", "dark"] as const) {
+ test(`Home paints a dashboard wireframe before JavaScript loads in ${colorScheme} mode`, async ({
+ page,
+ }) => {
+ await page.emulateMedia({ colorScheme });
+ await page.route("**/src/main.tsx*", (route) => route.abort());
+ await page.goto("/?windowType=editor&startupView=home");
+ await expect(page.getByRole("status", { name: "Loading home", exact: true })).toBeVisible();
+ await expect(page.locator(".boot-home-sidebar")).toBeVisible();
+ await expect(page.locator(".boot-home-grid > div")).toHaveCount(3);
+ await expect(page.locator(".boot-timeline")).not.toBeVisible();
+ await page.screenshot({ path: `test-results/home-startup-${colorScheme}.png` });
+ });
+}
+
+test("Home keeps its dashboard skeleton while the shared editor module loads", async ({ page }) => {
+ await installDesktopBridge(page);
+ await installDesktopBridgeOverrides(page, () => {
+ window.electronAPI.getEditorStartupView = () => "home";
+ });
+ let release!: () => void;
+ const paused = new Promise<void>((resolve) => {
+ release = resolve;
+ });
+ await page.route("**/components/video-editor/EditorWindow.tsx*", async (route) => {
+ await paused;
+ await route.continue();
+ });
+ await page.goto("/?windowType=editor", { waitUntil: "domcontentloaded" });
+ await expect(page.locator(".boot-shell")).toHaveCount(0);
+ await expect(page.getByRole("status", { name: "Loading home", exact: true })).toBeVisible();
+ await expect(page.getByRole("status", { name: "Loading editor", exact: true })).toHaveCount(0);
+ await page.screenshot({ path: "test-results/home-react-loading.png", animations: "disabled" });
+ release();
+ await expect(page.getByRole("button", { name: "Home", exact: true })).toBeVisible();
+});
+
+test("Home retains its skeleton during session lookup and then opens the dashboard", async ({
+ page,
+}) => {
+ await installDesktopBridge(page);
+ await installDesktopBridgeOverrides(page, () => {
+ window.electronAPI.getEditorStartupView = () => "home";
+ window.electronAPI.loadCurrentProjectFile = async () => {
+ await new Promise<void>((resolve) => {
+ window.addEventListener("test-release-initial-project", () => resolve(), {
+ once: true,
+ });
+ document.documentElement.dataset.homeLookupPending = "true";
+ });
+ return { success: false };
+ };
+ window.electronAPI.getCurrentRecordingSession = async () => ({
+ success: false,
+ session: null,
+ });
+ window.electronAPI.getCurrentVideoPath = async () => ({ success: false, path: null });
+ });
+ await page.goto("/?windowType=editor");
+ await expect(page.locator("html")).toHaveAttribute("data-home-lookup-pending", "true");
+ await expect(page.getByRole("status", { name: "Loading home", exact: true })).toBeVisible();
+ await expect(page.getByRole("status", { name: "Loading editor", exact: true })).toHaveCount(0);
+ await page.evaluate(() => window.dispatchEvent(new Event("test-release-initial-project")));
+ await expect(
+ page.getByRole("dialog", { name: "Projects dashboard", exact: true }),
+ ).toBeVisible();
+ await expect(page.getByRole("status", { name: "Loading home", exact: true })).toHaveCount(0);
+});
+
+test("a Home window switches to the editor wireframe on reload after a recording", async ({
+ page,
+}) => {
+ await installDesktopBridge(page);
+ await installDesktopBridgeOverrides(page, () => {
+ window.electronAPI.getEditorStartupView = () =>
+ localStorage.getItem("test.recording-present") ? "editor" : "home";
+ });
+ await page.route("**/src/main.tsx*", (route) => route.abort());
+ await page.goto("/?windowType=editor&startupView=home");
+ await expect(page.getByRole("status", { name: "Loading home", exact: true })).toBeVisible();
+ await page.evaluate(() => localStorage.setItem("test.recording-present", "true"));
+ await page.reload();
+ await expect(page.getByRole("status", { name: "Loading editor", exact: true })).toBeVisible();
+ await expect(page.locator(".boot-home")).not.toBeVisible();
+});
+
+test("an explicit Home navigation request uses the dashboard wireframe even with an existing source", async ({
+ page,
+}) => {
+ await installDesktopBridge(page);
+ await installDesktopBridgeOverrides(page, () => {
+ localStorage.setItem("recordly.open-dashboard", "true");
+ window.electronAPI.getEditorStartupView = () => "editor";
+ });
+ await page.route("**/src/main.tsx*", (route) => route.abort());
+ await page.goto("/?windowType=editor");
+ await expect(page.getByRole("status", { name: "Loading home", exact: true })).toBeVisible();
+ await expect(page.locator(".boot-timeline")).not.toBeVisible();
+});
+
+test("Home navigation keeps the Home skeleton while a retained project finishes hydration", async ({
+ page,
+}) => {
+ await installDesktopBridge(page);
+ await installDesktopBridgeOverrides(page, () => {
+ localStorage.setItem("recordly.open-dashboard", "true");
+ window.electronAPI.getEditorStartupView = () => "editor";
+ window.electronAPI.loadCurrentProjectFile = async () => ({
+ success: true,
+ path: "/projects/retained.recordly",
+ project: {
+ version: 2,
+ videoPath: `${location.origin}/tests/ui/fixtures/preview.mp4`,
+ editor: {},
+ },
+ });
+ window.electronAPI.setCurrentVideoPath = async () => {
+ document.documentElement.dataset.retainedProjectApplied = "true";
+ return { success: true };
+ };
+ let released = false;
+ window.addEventListener("test-release-retained-library", () => {
+ released = true;
+ });
+ window.electronAPI.listProjectFiles = async () => {
+ if (document.documentElement.dataset.retainedProjectApplied && !released) {
+ await new Promise<void>((resolve) => {
+ window.addEventListener("test-release-retained-library", () => resolve(), {
+ once: true,
+ });
+ document.documentElement.dataset.retainedLibraryPending = "true";
+ });
+ }
+ return { success: true, projects: [], entries: [] };
+ };
+ });
+ await page.goto("/?windowType=editor");
+ await expect(page.locator("html")).toHaveAttribute("data-retained-library-pending", "true");
+ await expect(page.getByRole("status", { name: "Loading home", exact: true })).toBeVisible();
+ await expect(page.getByRole("status", { name: "Loading editor", exact: true })).toHaveCount(0);
+ await page.evaluate(() => window.dispatchEvent(new Event("test-release-retained-library")));
+ await expect(
+ page.getByRole("dialog", { name: "Projects dashboard", exact: true }),
+ ).toBeVisible();
+});