Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

Add Reel page to the web studio

Nika Siradzed62ee529151e
diff --git a/src/ui/client/Layout.tsx b/src/ui/client/Layout.tsx
index 6d898b6..3b1fd2b 100644
--- a/src/ui/client/Layout.tsx
+++ b/src/ui/client/Layout.tsx
@@ -49,6 +49,7 @@ export default function Layout() {
<NavLink to="/" end className="sidebar-link"><Icon name="library" /> Library</NavLink>
<NavLink to="/episode" className="sidebar-link"><Icon name="episode" /> New episode</NavLink>
<NavLink to="/content" className="sidebar-link"><Icon name="content" /> Content</NavLink>
+ <NavLink to="/reel" className="sidebar-link"><Icon name="content" /> Reel</NavLink>
<NavLink to="/thumbnails" className="sidebar-link"><Icon name="thumbnail" /> Thumbnails</NavLink>
<div className="sidebar-section">Workspace</div>
diff --git a/src/ui/client/ReelPage.tsx b/src/ui/client/ReelPage.tsx
new file mode 100644
index 0000000..14aac90
--- /dev/null
+++ b/src/ui/client/ReelPage.tsx
@@ -0,0 +1,145 @@
+import React, { useState } from "react";
+import { api } from "./lib";
+
+interface Moment {
+ start: number;
+ end: number;
+ why: string;
+ text: string;
+ enabled: boolean;
+ dirty: boolean;
+}
+
+interface ReelResp {
+ session_id: string;
+ out_dir: string;
+ reel_path: string | null;
+ moments: Moment[];
+}
+
+const mmss = (s: number) =>
+ `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, "0")}`;
+
+export default function ReelPage() {
+ const [videoPath, setVideoPath] = useState("");
+ const [profile, setProfile] = useState<"party" | "action">("party");
+ const [session, setSession] = useState<ReelResp | null>(null);
+ const [busy, setBusy] = useState(false);
+ const [msg, setMsg] = useState<string | null>(null);
+
+ async function call(body: Record<string, unknown>, label: string) {
+ setBusy(true);
+ setMsg(label);
+ try {
+ const r = await api<ReelResp>("/reel", {
+ method: "POST",
+ body: JSON.stringify(body),
+ });
+ setSession(r);
+ setMsg(null);
+ } catch (e: unknown) {
+ setMsg("Error: " + (e instanceof Error ? e.message : String(e)));
+ } finally {
+ setBusy(false);
+ }
+ }
+
+ const detect = () =>
+ call(
+ { action: "new", video_path: videoPath, profile },
+ "Detecting moments (one-time, ~2 min)…",
+ );
+
+ const edit = (index: number, op: string, seconds = 0) =>
+ session &&
+ call(
+ { action: "edit", session_id: session.session_id, index, op, seconds },
+ "Re-cutting that moment and rebuilding…",
+ );
+
+ return (
+ <div className="app">
+ <div className="header">
+ <h1>Highlights reel</h1>
+ </div>
+ <p className="hint">
+ Detect the good moments once, then tweak each one. An edit re-cuts only
+ that moment and rebuilds the reel in seconds.
+ </p>
+
+ <div className="section">
+ <input
+ style={{ minWidth: 360 }}
+ placeholder="/path/to/video.mp4"
+ value={videoPath}
+ onChange={(e) => setVideoPath(e.target.value)}
+ />
+ <select
+ value={profile}
+ onChange={(e) => setProfile(e.target.value as "party" | "action")}
+ >
+ <option value="party">party</option>
+ <option value="action">action</option>
+ </select>
+ <button
+ className="btn btn-primary btn-sm"
+ disabled={busy || !videoPath}
+ onClick={detect}
+ >
+ Detect moments
+ </button>
+ </div>
+
+ {msg && <div className="hint">{msg}</div>}
+
+ {session && (
+ <div className="section stream-in">
+ <div className="meta">
+ <strong>{session.moments.length} moments</strong>
+ {session.reel_path && (
+ <span className="hint"> · reel: {session.reel_path}</span>
+ )}
+ </div>
+ {session.moments.map((m, idx) => (
+ <div
+ key={idx}
+ className="yt-card"
+ style={{ opacity: m.enabled ? 1 : 0.5 }}
+ >
+ <div className="meta">
+ <strong>
+ [{idx + 1}] {mmss(m.start)}–{mmss(m.end)}
+ </strong>
+ <span className="hint">
+ {" "}
+ {Math.round(m.end - m.start)}s · {m.why}
+ </span>
+ </div>
+ {m.text && <p>{m.text}</p>}
+ <div className="meta">
+ <button className="btn btn-ghost btn-sm" disabled={busy} onClick={() => edit(idx + 1, "longer", 5)}>
+ +5s end
+ </button>
+ <button className="btn btn-ghost btn-sm" disabled={busy} onClick={() => edit(idx + 1, "shorter", 5)}>
+ −5s end
+ </button>
+ <button className="btn btn-ghost btn-sm" disabled={busy} onClick={() => edit(idx + 1, "earlier", 5)}>
+ start −5s
+ </button>
+ <button className="btn btn-ghost btn-sm" disabled={busy} onClick={() => edit(idx + 1, "later", 5)}>
+ start +5s
+ </button>
+ <button className="btn btn-ghost btn-sm" disabled={busy} onClick={() => edit(idx + 1, "toggle")}>
+ {m.enabled ? "disable" : "enable"}
+ </button>
+ <button className="btn btn-ghost btn-sm" disabled={busy} onClick={() => edit(idx + 1, "drop")}>
+ drop
+ </button>
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/src/ui/client/main.tsx b/src/ui/client/main.tsx
index bc1ce28..f97d9c2 100644
--- a/src/ui/client/main.tsx
+++ b/src/ui/client/main.tsx
@@ -7,6 +7,7 @@ import ClipDetail from "./ClipDetail";
import EpisodeWorkspace from "./EpisodeWorkspace";
import ThumbnailStudio from "./ThumbnailStudio";
import ContentStudio from "./ContentStudio";
+import ReelPage from "./ReelPage";
import AnalyticsPage from "./AnalyticsPage";
import KnowledgePage from "./KnowledgePage";
import ConfigPage from "./ConfigPage";
@@ -21,6 +22,7 @@ createRoot(document.getElementById("root")!).render(
<Route path="/" element={<StudioHome />} />
<Route path="/episode" element={<EpisodeWorkspace />} />
<Route path="/content" element={<ContentStudio />} />
+ <Route path="/reel" element={<ReelPage />} />
<Route path="/thumbnails" element={<ThumbnailStudio />} />
<Route path="/thumbnail" element={<Navigate to="/thumbnails" replace />} />
<Route path="/clip/:id" element={<ClipDetail />} />