Open source CapCut alternative.
TypeScript
feat(site): editor polish — layout dropdown, scrub overlay, subtitle cleanups
David Le8226d5291353
diff --git a/site/src/cut/components/Inspector.tsx b/site/src/cut/components/Inspector.tsxindex f88e82b0..2f70b3d9 100644--- a/site/src/cut/components/Inspector.tsx+++ b/site/src/cut/components/Inspector.tsx@@ -206,31 +206,30 @@ function LayoutButtons({rect: FrameRect;onPick: (frame: FrameRect | undefined, fit: "fit" | "fill") => void;}) {- const current = regionLabel(rect);+ const currentId =+ (Object.keys(LAYOUTS) as LayoutId[]).find((id) => LAYOUTS[id].label === regionLabel(rect)) ??+ "full";return (- <div className="flex flex-col gap-1.5 py-1">+ <div className="flex items-center justify-between gap-2 py-1"><span className="text-[11.5px] font-medium text-muted-foreground">Layout</span>- <div className="grid grid-cols-3 gap-1">- {(Object.keys(LAYOUTS) as LayoutId[]).map((id) => {- const L = LAYOUTS[id];- const active = current === L.label;- return (- <button- key={id}- aria-pressed={active}- className={cn(- "rounded-md border px-2 py-1 text-[11px] font-medium transition-colors",- active- ? "border-violet-500 bg-violet-500/10 text-foreground"- : "border-input text-muted-foreground hover:text-foreground"- )}- onClick={() => onPick(id === "full" ? undefined : { ...L.rect }, L.fit)}- >- {L.label}- </button>- );- })}- </div>+ <Select+ value={currentId}+ onValueChange={(id) => {+ const L = LAYOUTS[id as LayoutId];+ onPick(id === "full" ? undefined : { ...L.rect }, L.fit);+ }}+ >+ <SelectTrigger className="h-8 w-36 text-[12px]">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {(Object.keys(LAYOUTS) as LayoutId[]).map((id) => (+ <SelectItem key={id} value={id} className="text-[12px]">+ {LAYOUTS[id].label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select></div>);}diff --git a/site/src/cut/components/OverlayLayer.tsx b/site/src/cut/components/OverlayLayer.tsxindex 697b00ff..c88ff20a 100644--- a/site/src/cut/components/OverlayLayer.tsx+++ b/site/src/cut/components/OverlayLayer.tsx@@ -33,7 +33,12 @@ export function OverlayLayer({ stageWidth }: { stageWidth: number }) {{overlays.map((o) => {const selected = selection?.kind === "text" && selection.id === o.id;const inRange = t >= o.start && t <= o.end;- if (!inRange && !selected) return null;+ // While hover-scrubbing (paused, skimmer active) the preview must show the+ // exact frame under the skimmer — a selected but out-of-frame title can't+ // leak into a frame it isn't part of. Off the skimmer, a selected title+ // stays visible (ghosted) so it can still be positioned and edited.+ const scrubbing = !playing && skimTime !== null;+ if (!inRange && (scrubbing || !selected)) return null;return (<OverlayItemkey={o.id}diff --git a/site/src/cut/components/SidePanel.tsx b/site/src/cut/components/SidePanel.tsxindex f936a3bb..1944294f 100644--- a/site/src/cut/components/SidePanel.tsx+++ b/site/src/cut/components/SidePanel.tsx@@ -538,9 +538,6 @@ function LibraryPanel({ projectId }: { projectId: string }) {return (<><PanelHead title="Library" />- <p className="px-4 pb-2 text-[11.5px] leading-relaxed text-muted-foreground">- Reusable clips & music. Drag onto the timeline, or press + to add a copy.- </p>{templates.length > 0 && (<div className="px-3.5 pb-3"><div className="mb-1.5 text-[11px] font-semibold text-muted-foreground">Templates</div>diff --git a/site/src/cut/components/SubtitlesPanel.tsx b/site/src/cut/components/SubtitlesPanel.tsxindex 2833f9db..e7ec31cf 100644--- a/site/src/cut/components/SubtitlesPanel.tsx+++ b/site/src/cut/components/SubtitlesPanel.tsx@@ -188,10 +188,6 @@ function EmptyState({<div className="flex flex-col items-center gap-1 pt-4 pb-1 text-center"><Captions className="mb-1 size-6 text-muted-foreground" /><p className="text-[13px] font-semibold">Subtitles from your audio</p>- <p className="text-[11.5px] leading-relaxed text-muted-foreground">- Transcribed with Apple speech recognition, entirely on this Mac —- your audio never leaves it.- </p></div>)}<div className="relative">@@ -208,12 +204,21 @@ function EmptyState({</select><ChevronDown className="pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 text-muted-foreground" /></div>- <Button className="sub-generate w-full" onClick={onGenerate}>+ <Button+ className="sub-generate w-full"+ onClick={onGenerate}+ title="Transcribe your audio into plain captions, word for word"+ ><Captions data-icon="inline-start" />{status === "empty" || status === "error" ? "Try again" : "Generate subtitles"}</Button>{status !== "empty" && (- <Button variant="outline" className="sub-social w-full" onClick={onCaptions}>+ <Button+ variant="outline"+ className="sub-social w-full"+ onClick={onCaptions}+ title="Rewrite the captions for social — tighter lines, emoji, and a stronger hook"+ ><Sparkles data-icon="inline-start" />Social captions</Button>