Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

feat(inspector): pick the right panel's fixed choices in one click

EtienneLescot5e6bbf2fa320
diff --git a/src/components/ai-edition/CaptionsPane.choices.test.tsx b/src/components/ai-edition/CaptionsPane.choices.test.tsx
new file mode 100644
index 000000000..02b3142d4
--- /dev/null
+++ b/src/components/ai-edition/CaptionsPane.choices.test.tsx
@@ -0,0 +1,80 @@
+// @vitest-environment jsdom
+// The caption pane's fixed choices are rows of buttons and its word counts are sliders: one
+// click each, no list to open. The translation target stays a list — fifteen languages.
+
+import "@testing-library/jest-dom";
+import { cleanup, fireEvent, render, screen, within } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { I18nProvider } from "@/contexts/I18nContext";
+import { getCaptionSettings } from "@/lib/ai-edition/captions";
+import { type AxcutDocument, createEmptyDocument } from "@/lib/ai-edition/schema";
+import { useProjectStore } from "@/lib/ai-edition/store/projectStore";
+import { useTranscriptionStore } from "@/lib/ai-edition/store/transcriptionStore";
+import { CaptionsPane } from "./CaptionsPane";
+
+vi.mock("@/native", () => ({ nativeBridgeClient: { aiEdition: {} } }));
+vi.mock("@/native/client", () => ({ nativeBridgeClient: { aiEdition: {} } }));
+vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));
+
+function show(legacyEditor: Record<string, unknown> = {}) {
+ const base = createEmptyDocument({ title: "T", projectId: "p1" });
+ useProjectStore.setState({
+ document: { ...base, legacyEditor: { captions: { enabled: true }, ...legacyEditor } },
+ });
+ render(
+ <I18nProvider>
+ <CaptionsPane />
+ </I18nProvider>,
+ );
+}
+
+const stored = () => getCaptionSettings(useProjectStore.getState().document as AxcutDocument);
+
+beforeEach(() => {
+ useTranscriptionStore.getState().reset();
+ useProjectStore.getState().clear();
+});
+
+afterEach(() => {
+ cleanup();
+});
+
+describe("caption choices", () => {
+ it("offers the display language only once there is a translation to switch to", () => {
+ show();
+ expect(screen.queryByRole("group", { name: "Display" })).not.toBeInTheDocument();
+ cleanup();
+
+ show({ captionTranslations: { fr: { label: "Français", byAsset: {} } } });
+ const row = screen.getByRole("group", { name: "Display" });
+ expect(within(row).getByRole("button", { name: "Original (transcript)" })).toHaveAttribute(
+ "aria-pressed",
+ "true",
+ );
+ fireEvent.click(within(row).getByRole("button", { name: "Français" }));
+ expect(stored().language).toBe("fr");
+ });
+
+ it("shows each font as a specimen of itself and writes the one clicked", () => {
+ show();
+ const lora = within(screen.getByRole("group", { name: "Font", hidden: true })).getByRole(
+ "button",
+ { name: "Lora", hidden: true },
+ );
+ expect(lora.querySelector("span")).toHaveStyle({ fontFamily: "Lora" });
+ fireEvent.click(lora);
+ expect(stored().fontFamily).toBe("Lora");
+ });
+
+ it("never lets the minimum words per line pass the maximum", () => {
+ show({ captions: { enabled: true, minWordsPerLine: 2, maxWordsPerLine: 5 } });
+ fireEvent.change(screen.getByRole("slider", { name: "Min words per line" }), {
+ target: { value: "9" },
+ });
+ expect(stored()).toMatchObject({ minWordsPerLine: 5, maxWordsPerLine: 5 });
+ fireEvent.change(screen.getByRole("slider", { name: "Max words per line" }), {
+ target: { value: "1" },
+ });
+ expect(stored()).toMatchObject({ minWordsPerLine: 5, maxWordsPerLine: 5 });
+ });
+});
diff --git a/src/components/ai-edition/CaptionsPane.tsx b/src/components/ai-edition/CaptionsPane.tsx
index e9cca7e5f..258fa2dc9 100644
--- a/src/components/ai-edition/CaptionsPane.tsx
+++ b/src/components/ai-edition/CaptionsPane.tsx
@@ -396,22 +396,24 @@ export function CaptionsPane({ onClose }: { onClose?: () => void } = {}) {
{/* ── Language ───────────────────────────────────────────── */}
<div className={styles.sectionLabel}>{t("captions.language")}</div>
- <div className={styles.paneRow}>
- <span className={styles.label}>{t("captions.displayLanguage")}</span>
- <select
- value={settings.language ?? ""}
- disabled={disabled}
- onChange={(e) => void set({ language: e.target.value || null })}
- style={selectStyle}
- >
- <option value="">{t("captions.original")}</option>
- {languageOptions.map((entry) => (
- <option key={entry.language} value={entry.language}>
- {entry.label}
- </option>
- ))}
- </select>
- </div>
+ {/* Only once there is a translation to switch to: alone, "Original" would be a
+ button that changes nothing. */}
+ {languageOptions.length > 0 ? (
+ <div className={`${styles.field} ${styles.fieldStack}`}>
+ <span className={styles.fieldLabel}>{t("captions.displayLanguage")}</span>
+ <ChoiceRow<string>
+ label={t("captions.displayLanguage")}
+ columns={2}
+ options={[
+ { value: "", label: t("captions.original") },
+ ...languageOptions.map((entry) => ({ value: entry.language, label: entry.label })),
+ ]}
+ value={settings.language ?? ""}
+ disabled={disabled}
+ onChange={(language) => void set({ language: language || null })}
+ />
+ </div>
+ ) : null}
<div
style={{
@@ -486,22 +488,23 @@ export function CaptionsPane({ onClose }: { onClose?: () => void } = {}) {
{t("captions.customize")}
</summary>
<div className={styles.sectionLabel}>{t("captions.text")}</div>
- <div className={styles.paneRow}>
- <span className={styles.label}>{t("captions.font")}</span>
- <select
+ <div className={`${styles.field} ${styles.fieldStack}`}>
+ <span className={styles.fieldLabel}>{t("captions.font")}</span>
+ {/* Only the families the compositor ships: it never reads the machine's
+ installed fonts, so any other name would draw a fallback. Each button is a
+ specimen, in the face it picks. */}
+ <ChoiceRow<string>
+ label={t("captions.font")}
+ columns={2}
+ options={TEXT_FONT_FAMILIES.map((font) => ({
+ value: font,
+ label: font,
+ icon: <span style={{ fontFamily: font }}>{font}</span>,
+ }))}
value={settings.fontFamily}
disabled={disabled}
- onChange={(e) => void set({ fontFamily: e.target.value })}
- style={selectStyle}
- >
- {/* Only the families the compositor ships: it never reads the machine's
- installed fonts, so any other name would draw a fallback. */}
- {TEXT_FONT_FAMILIES.map((font) => (
- <option key={font} value={font} style={{ fontFamily: font }}>
- {font}
- </option>
- ))}
- </select>
+ onChange={(fontFamily) => void set({ fontFamily })}
+ />
</div>
<div className={styles.paneRow}>
<span className={styles.label}>{t("captions.bold")}</span>
@@ -646,47 +649,38 @@ export function CaptionsPane({ onClose }: { onClose?: () => void } = {}) {
)}
{/* ── Line length ────────────────────────────────────────── */}
+ {/* Two counts on one scale, so two sliders; each stops at the other, so the
+ minimum never passes the maximum. */}
<div className={styles.sectionLabel}>{t("captions.lineLength")}</div>
- <div className={styles.paneRow}>
- <span className={styles.label}>{t("captions.minWords")}</span>
- <select
+ <div className={styles.sliderGrid}>
+ <SliderCell
+ label={t("captions.minWords")}
value={settings.minWordsPerLine}
+ min={CAPTION_WORDS_PER_LINE_MIN}
+ max={CAPTION_WORDS_PER_LINE_MAX}
+ defaultValue={DEFAULT_CAPTION_SETTINGS.minWordsPerLine}
+ showValue
disabled={disabled}
- onChange={(e) => void set({ minWordsPerLine: Number(e.target.value) })}
- style={selectStyle}
- >
- {WORD_COUNTS.map((n) => (
- <option key={n} value={n}>
- {n}
- </option>
- ))}
- </select>
- </div>
- <div className={styles.paneRow} style={{ marginBottom: 16 }}>
- <span className={styles.label}>{t("captions.maxWords")}</span>
- <select
+ onChange={(v) => setLive({ minWordsPerLine: Math.min(v, settings.maxWordsPerLine) })}
+ onCommit={() => void commit()}
+ />
+ <SliderCell
+ label={t("captions.maxWords")}
value={settings.maxWordsPerLine}
+ min={CAPTION_WORDS_PER_LINE_MIN}
+ max={CAPTION_WORDS_PER_LINE_MAX}
+ defaultValue={DEFAULT_CAPTION_SETTINGS.maxWordsPerLine}
+ showValue
disabled={disabled}
- onChange={(e) => void set({ maxWordsPerLine: Number(e.target.value) })}
- style={selectStyle}
- >
- {WORD_COUNTS.map((n) => (
- <option key={n} value={n} disabled={n < settings.minWordsPerLine}>
- {n}
- </option>
- ))}
- </select>
+ onChange={(v) => setLive({ maxWordsPerLine: Math.max(v, settings.minWordsPerLine) })}
+ onCommit={() => void commit()}
+ />
</div>
</div>
</div>
);
}
-const WORD_COUNTS = Array.from(
- { length: CAPTION_WORDS_PER_LINE_MAX - CAPTION_WORDS_PER_LINE_MIN + 1 },
- (_, i) => i + CAPTION_WORDS_PER_LINE_MIN,
-);
-
const CAPTION_STYLE_IDS = Object.keys(CAPTION_STYLES) as CaptionStyleId[];
const selectStyle: React.CSSProperties = {
diff --git a/src/components/ai-edition/RightPanes.tsx b/src/components/ai-edition/RightPanes.tsx
index 6fb1fcaff..ab2d7886a 100644
--- a/src/components/ai-edition/RightPanes.tsx
+++ b/src/components/ai-edition/RightPanes.tsx
@@ -6,19 +6,24 @@
// self-sufficient).
import {
+ AppWindow,
AudioLines,
Camera,
Captions as CaptionsIcon,
- ChevronDown,
FileText,
HelpCircle,
ImagePlus,
+ Laptop,
Loader2,
+ type LucideIcon,
Mic,
+ Monitor,
MousePointerClick,
Music,
RotateCcw,
Sliders,
+ Smartphone,
+ SquareDashed,
Trash2,
Undo2,
Video,
@@ -36,6 +41,7 @@ import {
type PointerEvent as ReactPointerEvent,
useCallback,
useEffect,
+ useId,
useLayoutEffect,
useMemo,
useRef,
@@ -136,11 +142,7 @@ import {
} from "@/native/compositorViewClient";
import { ROUNDNESS_SLIDER_MAX_PX } from "@/native/paramUnits";
import { wallpaperAcceptsMotion } from "@/native/sceneDescription";
-import {
- ASPECT_RATIO_PRESETS,
- type AspectRatio,
- getAspectRatioLabel,
-} from "@/utils/aspectRatioUtils";
+import { ASPECT_RATIO_PRESETS, type AspectRatio } from "@/utils/aspectRatioUtils";
import { useCanSegmentCamera } from "../../native/hooks/useSegmentationSupport";
import { CaptionsPane } from "./CaptionsPane";
import { ColorField } from "./ColorField";
@@ -2309,7 +2311,15 @@ const RECORDING_FRAME_LABEL_KEYS: Record<RecordingFrame, string> = {
monitor: "effects.frameScreen",
};
-/** What the fill row says under itself: what "follow" does, or why it cannot. */
+// "None" is dashed like the camera's "no background": the outline of something not drawn.
+const RECORDING_FRAME_ICONS: Record<RecordingFrame, LucideIcon> = {
+ none: SquareDashed,
+ window: AppWindow,
+ laptop: Laptop,
+ phone: Smartphone,
+ monitor: Monitor,
+};
+
const FRAME_THEME_LABEL_KEYS: Record<FrameTheme, string> = {
light: "effects.frameThemeLight",
dark: "effects.frameThemeDark",
@@ -2347,6 +2357,13 @@ export function VideoEffectsPane() {
() => (document ? isAutoFormatAvailable(document) : true),
[document],
);
+ // What Auto stands at, or why it cannot: shown beside the label while Auto is the format.
+ const autoState = !autoAvailable
+ ? ts("effects.formatAutoMixed")
+ : autoDims
+ ? `${autoDims.width}×${autoDims.height}`
+ : null;
+ const autoStateId = useId();
const hasTiltedZoom = (document?.zoomRanges ?? []).some((z) => z.rotationPreset != null);
const fillAvailability = useMemo(
() => (document ? formatFillAvailability(document) : "none"),
@@ -2357,9 +2374,6 @@ export function VideoEffectsPane() {
// keeps showing its recording whole until the user says otherwise.
const fillDefault = settings.formatFollowCursor === null ? { formatFollowCursor: true } : {};
const [fitMenuOpen, setFitMenuOpen] = useState(false);
- const [ratioMenuOpen, setRatioMenuOpen] = useState(false);
- const [frameMenuOpen, setFrameMenuOpen] = useState(false);
- const [themeMenuOpen, setThemeMenuOpen] = useState(false);
const { locale } = useI18n();
const clipCountLabel = (count: number) => ts(pluralKey(locale, count), { count });
@@ -2465,113 +2479,72 @@ export function VideoEffectsPane() {
control rather than as the shape of what gets exported. Its old placement was
incidental: it arrived inside 1f25410b, a commit about per-clip crop export and
a HUD redesign, and no decision record ever argued for it. */}
- <div className={styles.paneRow}>
- <span className={styles.label}>{ts("effects.format")}</span>
- <Popover open={ratioMenuOpen} onOpenChange={setRatioMenuOpen}>
- <PopoverTrigger asChild>
- <button
- type="button"
- className={styles.rowAction}
+ <div className={`${styles.field} ${styles.fieldStack}`}>
+ <span className={styles.fieldLabel}>
+ {ts("effects.format")}
+ {/* Auto is the one entry whose shape moves with the project (padding, camera
+ layout, crop), so while it is the format the label says where it stands. The
+ legacy `"native"` value presses no button: it only survives until the clip
+ dimensions are known, and until then there is no Original row either. */}
+ {settings.aspectRatio === "auto" && autoState ? (
+ <span id={autoStateId} className={styles.sectionLabelValue}>
+ {autoState}
+ </span>
+ ) : null}
+ </span>
+ <ChoiceRow<AspectRatio>
+ label={ts("effects.format")}
+ columns={4}
+ options={[
+ // Auto leads: it is the one entry that is a rule rather than a shape.
+ ...(autoAvailable || settings.aspectRatio === "auto"
+ ? [
+ {
+ value: "auto" as const,
+ label: ts("effects.formatAuto"),
+ disabled: !autoAvailable,
+ title: autoState ? `${ts("effects.formatAuto")} · ${autoState}` : undefined,
+ },
+ ]
+ : []),
+ ...ASPECT_RATIO_PRESETS.map((ratio) => ({ value: ratio, label: ratio })),
+ ]}
+ value={settings.aspectRatio}
+ disabled={!hasDocument}
+ describedBy={settings.aspectRatio === "auto" && !autoAvailable ? autoStateId : undefined}
+ onChange={(aspectRatio) =>
+ void set(aspectRatio === "auto" ? { aspectRatio } : { aspectRatio, ...fillDefault })
+ }
+ />
+ {/* The timeline's own shapes stay listed here, and NOT only behind "fit": that action
+ also zeroes the frame styling, so without this row there would be no way to export
+ at the footage's native shape while keeping a padded, rounded look. Token first,
+ then the pixel size: here a button names an output FORMAT, so the ratio is the
+ identity. (The "fit" menu leads with the resolution, because there a row names a
+ clip.) */}
+ {nativeFormats.length > 0 ? (
+ <>
+ <span className={styles.fieldLabel}>{ts("effects.formatOriginal")}</span>
+ <ChoiceRow<AspectRatio>
+ label={ts("effects.formatOriginal")}
+ columns={Math.min(nativeFormats.length, 2)}
+ options={nativeFormats.map((format) => {
+ const label = `${format.token} · ${format.width}×${format.height}`;
+ return {
+ value: format.token,
+ label,
+ title:
+ nativeFormats.length > 1
+ ? `${label} · ${clipCountLabel(format.clipCount)}`
+ : undefined,
+ };
+ })}
+ value={settings.aspectRatio}
disabled={!hasDocument}
- aria-label={ts("effects.format")}
- >
- {/* `getAspectRatioLabel` hardcodes English "Original" for the legacy
- `"native"` value, which is still reachable: the v5→v6 migration only
- bakes it into a concrete token once clip dimensions are known, and
- leaves it alone until then. The group header below is localized, so
- without this the two would disagree in twelve locales. */}
- {settings.aspectRatio === "auto"
- ? ts("effects.formatAuto")
- : settings.aspectRatio === "native"
- ? ts("effects.formatOriginal")
- : getAspectRatioLabel(settings.aspectRatio)}
- <ChevronDown size={11} />
- </button>
- </PopoverTrigger>
- <PopoverContent
- align="end"
- sideOffset={6}
- collisionPadding={12}
- animated={false}
- className="w-auto border-0 bg-transparent p-0 shadow-none"
- >
- <div className={styles.actionMenu} role="menu" aria-label={ts("effects.format")}>
- {/* Auto leads: it is the one entry that is a rule rather than a shape. */}
- {autoAvailable || settings.aspectRatio === "auto" ? (
- <button
- type="button"
- role="menuitem"
- className={`${styles.actionMenuRow}${
- settings.aspectRatio === "auto" ? ` ${styles.isActive}` : ""
- }`}
- disabled={!autoAvailable}
- onClick={() => {
- setRatioMenuOpen(false);
- void set({ aspectRatio: "auto" });
- }}
- >
- <span className={styles.actionMenuMain}>{ts("effects.formatAuto")}</span>
- {!autoAvailable ? (
- <span className={styles.actionMenuCount}>{ts("effects.formatAutoMixed")}</span>
- ) : autoDims ? (
- <span className={styles.actionMenuCount}>
- {`${autoDims.width}×${autoDims.height}`}
- </span>
- ) : null}
- </button>
- ) : null}
- {ASPECT_RATIO_PRESETS.map((ratio) => (
- <button
- type="button"
- role="menuitem"
- key={ratio}
- className={`${styles.actionMenuRow}${
- ratio === settings.aspectRatio ? ` ${styles.isActive}` : ""
- }`}
- onClick={() => {
- setRatioMenuOpen(false);
- void set({ aspectRatio: ratio, ...fillDefault });
- }}
- >
- <span className={styles.actionMenuMain}>{ratio}</span>
- </button>
- ))}
- {/* The timeline's own shapes stay listed here, and NOT only behind "fit":
- that action also zeroes the frame styling, so without these rows there
- would be no way to export at the footage's native shape while keeping a
- padded, rounded look. */}
- {nativeFormats.length > 0 ? (
- <>
- <div className={styles.actionMenuGroup}>{ts("effects.formatOriginal")}</div>
- {nativeFormats.map((format) => (
- <button
- type="button"
- role="menuitem"
- key={`native-${format.token}`}
- className={`${styles.actionMenuRow}${
- format.token === settings.aspectRatio ? ` ${styles.isActive}` : ""
- }`}
- onClick={() => {
- setRatioMenuOpen(false);
- void set({ aspectRatio: format.token, ...fillDefault });
- }}
- >
- {/* Token leads and the pixel size rides on the right, exactly as this
- menu read in the timeline toolbar — here the row names an output
- FORMAT, so the ratio is the identity. (The "fit" menu leads with
- the resolution instead, because there a row names a clip.) */}
- <span className={styles.actionMenuMain}>{format.token}</span>
- <span className={styles.actionMenuCount}>
- {`${format.width}×${format.height}`}
- {nativeFormats.length > 1 ? ` · ${format.clipCount}` : ""}
- </span>
- </button>
- ))}
- </>
- ) : null}
- </div>
- </PopoverContent>
- </Popover>
+ onChange={(aspectRatio) => void set({ aspectRatio, ...fillDefault })}
+ />
+ </>
+ ) : null}
</div>
{/* How a recording of another shape sits in a fixed format: whole, or filling it with a
window that follows the cursor. Only listed when the two shapes differ and the timeline
@@ -2591,107 +2564,52 @@ export function VideoEffectsPane() {
/>
</div>
) : null}
- {/* The frame drawn around the recording, and its theme. Two menus like Format above
- them, and for the same reason: each picks one project-wide look among a few. With a
- frame on, Roundness rounds the footage within that frame's own range, the body
- following concentric, and Shadow falls under the frame — both still move what
+ {/* The frame drawn around the recording, and its theme. Rows of buttons like Format
+ above them, and for the same reason: each picks one project-wide look among a few.
+ With a frame on, Roundness rounds the footage within that frame's own range, the
+ body following concentric, and Shadow falls under the frame — both still move what
they name. */}
- <div className={styles.paneRow}>
- <span className={styles.label} title={ts("effects.windowHelp")}>
+ <div className={`${styles.field} ${styles.fieldStack}`}>
+ {/* The tiles only draw their frame, so the label names the current one. */}
+ <span className={styles.fieldLabel} title={ts("effects.windowHelp")}>
{ts("effects.frameStyle")}
+ <span className={styles.sectionLabelValue}>
+ {ts(RECORDING_FRAME_LABEL_KEYS[settings.frame])}
+ </span>
</span>
- <Popover open={frameMenuOpen} onOpenChange={setFrameMenuOpen}>
- <PopoverTrigger asChild>
- <button
- type="button"
- className={styles.rowAction}
- disabled={!hasDocument}
- aria-label={ts("effects.frameStyle")}
- title={ts("effects.windowHelp")}
- >
- {ts(RECORDING_FRAME_LABEL_KEYS[settings.frame])}
- <ChevronDown size={11} />
- </button>
- </PopoverTrigger>
- <PopoverContent
- align="end"
- sideOffset={6}
- collisionPadding={12}
- animated={false}
- className="w-auto border-0 bg-transparent p-0 shadow-none"
- >
- <div className={styles.actionMenu} role="menu" aria-label={ts("effects.frameStyle")}>
- {RECORDING_FRAMES.map((frame) => (
- <button
- type="button"
- role="menuitem"
- key={frame}
- className={`${styles.actionMenuRow}${
- frame === settings.frame ? ` ${styles.isActive}` : ""
- }`}
- onClick={() => {
- setFrameMenuOpen(false);
- void set({ frame });
- }}
- >
- <span className={styles.actionMenuMain}>
- {ts(RECORDING_FRAME_LABEL_KEYS[frame])}
- </span>
- </button>
- ))}
- </div>
- </PopoverContent>
- </Popover>
+ <ChoiceRow<RecordingFrame>
+ label={ts("effects.frameStyle")}
+ tiles
+ options={RECORDING_FRAMES.map((frame) => {
+ const Icon = RECORDING_FRAME_ICONS[frame];
+ return {
+ value: frame,
+ label: ts(RECORDING_FRAME_LABEL_KEYS[frame]),
+ icon: <Icon size={20} aria-hidden="true" />,
+ };
+ })}
+ value={settings.frame}
+ disabled={!hasDocument}
+ onChange={(frame) => void set({ frame })}
+ />
</div>
{/* The theme rides WITH the frame: it only exists once there is a body to colour, so it
appears next to the frame it recolours rather than sitting there inert. */}
{settings.frame !== "none" ? (
- <div className={styles.paneRow}>
- <span className={styles.label} title={ts("effects.frameThemeHelp")}>
+ <div className={`${styles.field} ${styles.fieldStack}`}>
+ <span className={styles.fieldLabel} title={ts("effects.frameThemeHelp")}>
{ts("effects.frameTheme")}
</span>
- <Popover open={themeMenuOpen} onOpenChange={setThemeMenuOpen}>
- <PopoverTrigger asChild>
- <button
- type="button"
- className={styles.rowAction}
- disabled={!hasDocument}
- aria-label={ts("effects.frameTheme")}
- title={ts("effects.frameThemeHelp")}
- >
- {ts(FRAME_THEME_LABEL_KEYS[settings.frameTheme])}
- <ChevronDown size={11} />
- </button>
- </PopoverTrigger>
- <PopoverContent
- align="end"
- sideOffset={6}
- collisionPadding={12}
- animated={false}
- className="w-auto border-0 bg-transparent p-0 shadow-none"
- >
- <div className={styles.actionMenu} role="menu" aria-label={ts("effects.frameTheme")}>
- {FRAME_THEMES.map((frameTheme) => (
- <button
- type="button"
- role="menuitem"
- key={frameTheme}
- className={`${styles.actionMenuRow}${
- frameTheme === settings.frameTheme ? ` ${styles.isActive}` : ""
- }`}
- onClick={() => {
- setThemeMenuOpen(false);
- void set({ frameTheme });
- }}
- >
- <span className={styles.actionMenuMain}>
- {ts(FRAME_THEME_LABEL_KEYS[frameTheme])}
- </span>
- </button>
- ))}
- </div>
- </PopoverContent>
- </Popover>
+ <ChoiceRow<FrameTheme>
+ label={ts("effects.frameTheme")}
+ options={FRAME_THEMES.map((frameTheme) => ({
+ value: frameTheme,
+ label: ts(FRAME_THEME_LABEL_KEYS[frameTheme]),
+ }))}
+ value={settings.frameTheme}
+ disabled={!hasDocument}
+ onChange={(frameTheme) => void set({ frameTheme })}
+ />
</div>
) : null}
{namedLevelRow(
diff --git a/src/components/ai-edition/fitClipShapes.test.tsx b/src/components/ai-edition/fitClipShapes.test.tsx
index ba5536eda..9930e2165 100644
--- a/src/components/ai-edition/fitClipShapes.test.tsx
+++ b/src/components/ai-edition/fitClipShapes.test.tsx
@@ -217,9 +217,11 @@ describe("fitting a clip is an action, and a choice only when there is one", ()
});
});
-describe("the frame menu persists the pick", () => {
+describe("the frame row persists the pick", () => {
const stored = (key: string) =>
(useProjectStore.getState().document?.legacyEditor as Record<string, unknown>)?.[key];
+ const pick = (row: string, label: string) =>
+ within(screen.getByRole("group", { name: row })).getByRole("button", { name: label });
it("writes each frame to the document, with no option withheld", async () => {
mount(documentWithShapes([[1920, 1080]]));
@@ -232,23 +234,81 @@ describe("the frame menu persists the pick", () => {
["Screen", "monitor"],
["None", "none"],
] as const) {
- fireEvent.click(screen.getByRole("button", { name: "Style" }));
- const item = within(screen.getByRole("menu")).getByRole("menuitem", { name: label });
- expect(item).not.toBeDisabled();
- fireEvent.click(item);
+ const tile = pick("Style", label);
+ expect(tile).not.toBeDisabled();
+ fireEvent.click(tile);
await waitFor(() => expect(stored("frame")).toBe(frame));
+ expect(tile).toHaveAttribute("aria-pressed", "true");
}
});
it("offers the theme once a frame is on, and writes it", async () => {
mount(documentWithShapes([[1920, 1080]]));
// No frame, no theme row: it would recolour nothing.
- expect(screen.queryByRole("button", { name: "Theme" })).not.toBeInTheDocument();
- fireEvent.click(screen.getByRole("button", { name: "Style" }));
- fireEvent.click(within(screen.getByRole("menu")).getByRole("menuitem", { name: "Laptop" }));
+ expect(screen.queryByRole("group", { name: "Theme" })).not.toBeInTheDocument();
+ fireEvent.click(pick("Style", "Laptop"));
await waitFor(() => expect(stored("frame")).toBe("laptop"));
- fireEvent.click(screen.getByRole("button", { name: "Theme" }));
- fireEvent.click(within(screen.getByRole("menu")).getByRole("menuitem", { name: "Dark" }));
+ fireEvent.click(pick("Theme", "Dark"));
await waitFor(() => expect(stored("frameTheme")).toBe("dark"));
});
});
+
+describe("the format row", () => {
+ const pressed = () =>
+ within(screen.getByRole("group", { name: "Format" }))
+ .getAllByRole("button")
+ .filter((b) => b.getAttribute("aria-pressed") === "true")
+ .map((b) => b.textContent);
+
+ it("shows every preset at once and writes the one clicked", async () => {
+ mount(documentWithShapes([[1920, 1080]]));
+ // Auto leads, then the presets in menu order: all of them on screen, no menu to open.
+ expect(
+ within(screen.getByRole("group", { name: "Format" }))
+ .getAllByRole("button")
+ .map((b) => b.textContent),
+ ).toEqual(["Auto", "16:9", "9:16", "1:1", "4:3", "4:5", "16:10", "10:16"]);
+ expect(pressed()).toEqual(["1:1"]);
+ fireEvent.click(
+ within(screen.getByRole("group", { name: "Format" })).getByRole("button", { name: "4:5" }),
+ );
+ await waitFor(() => expect(frameSettings().aspectRatio).toBe("4:5"));
+ expect(pressed()).toEqual(["4:5"]);
+ });
+
+ it("lists the footage's own shape under Original, with its pixel size", async () => {
+ mount(documentWithShapes([[1366, 768]]));
+ const original = screen.getByRole("group", { name: "Original" });
+ fireEvent.click(within(original).getByRole("button", { name: "683:384 · 1366×768" }));
+ await waitFor(() => expect(frameSettings().aspectRatio).toBe("683:384"));
+ });
+
+ it("keeps Auto listed but dead while it is the format of a mixed timeline, and says why", () => {
+ const doc = documentWithShapes([
+ [1920, 1080],
+ [1080, 1920],
+ ]);
+ (doc.legacyEditor as Record<string, unknown>).aspectRatio = "auto";
+ mount(doc);
+ const auto = within(screen.getByRole("group", { name: "Format" })).getByRole("button", {
+ name: "Auto",
+ });
+ expect(auto).toBeDisabled();
+ expect(auto).toHaveAttribute("aria-pressed", "true");
+ expect(screen.getByRole("group", { name: "Format" })).toHaveAccessibleDescription(
+ "Clips differ",
+ );
+ });
+
+ it("does not offer Auto on a mixed timeline that is on another format", () => {
+ mount(
+ documentWithShapes([
+ [1920, 1080],
+ [1080, 1920],
+ ]),
+ );
+ expect(
+ within(screen.getByRole("group", { name: "Format" })).queryByRole("button", { name: "Auto" }),
+ ).not.toBeInTheDocument();
+ });
+});
diff --git a/src/components/ai-edition/formatFill.test.tsx b/src/components/ai-edition/formatFill.test.tsx
index 9c5cc22dc..71dfada56 100644
--- a/src/components/ai-edition/formatFill.test.tsx
+++ b/src/components/ai-edition/formatFill.test.tsx
@@ -3,7 +3,7 @@
// why when it cannot act, and writes the project setting the scene reads.
import "@testing-library/jest-dom";
-import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
+import { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { I18nProvider } from "@/contexts/I18nContext";
import type { AxcutDocument } from "@/lib/ai-edition/schema";
@@ -85,15 +85,17 @@ describe("format fill", () => {
});
it("fills a format picked from now on, and leaves an earlier project whole", async () => {
+ const pickFormat = (ratio: string) =>
+ fireEvent.click(
+ within(screen.getByRole("group", { name: "Format" })).getByRole("button", { name: ratio }),
+ );
mount(hdTake({ aspectRatio: "16:9" }));
- fireEvent.click(screen.getByRole("button", { name: "Format" }));
- fireEvent.click(await screen.findByRole("menuitem", { name: "9:16" }));
+ pickFormat("9:16");
await waitFor(() => expect(stored()).toBe(true));
cleanup();
mount(hdTake({ aspectRatio: "16:9", formatFollowCursor: false }));
- fireEvent.click(screen.getByRole("button", { name: "Format" }));
- fireEvent.click(await screen.findByRole("menuitem", { name: "9:16" }));
+ pickFormat("9:16");
await waitFor(() =>
expect(
(useProjectStore.getState().document?.legacyEditor as Record<string, unknown>).aspectRatio,
diff --git a/src/components/ai-edition/v4/FloatingInspector.test.tsx b/src/components/ai-edition/v4/FloatingInspector.test.tsx
index d1f757e02..04b3f054c 100644
--- a/src/components/ai-edition/v4/FloatingInspector.test.tsx
+++ b/src/components/ai-edition/v4/FloatingInspector.test.tsx
@@ -1,6 +1,6 @@
// @vitest-environment jsdom
import "@testing-library/jest-dom";
-import { fireEvent, render, screen } from "@testing-library/react";
+import { fireEvent, render, screen, within } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import { useProjectStore } from "@/lib/ai-edition/store/projectStore";
@@ -8,9 +8,10 @@ vi.mock("@/contexts/I18nContext", () => ({
useScopedT: (scope: string) => (key: string) => `${scope}.${key}`,
}));
-vi.mock("../RightPanes", () => ({
+vi.mock("../RightPanes", async (importOriginal) => ({
AudioPane: () => <div data-testid="audio-pane">AudioPane</div>,
- ChoiceRow: () => <div data-testid="choice-row">ChoiceRow</div>,
+ // The real row: the zoom pane's choices are read and pressed below.
+ ChoiceRow: (await importOriginal<typeof import("../RightPanes")>()).ChoiceRow,
AudioTrackPane: ({ onClose }: { onClose?: () => void }) => (
<div data-testid="audio-track-pane">
AudioTrackPane
@@ -49,7 +50,7 @@ vi.mock("../RightPanes", () => ({
VideoEffectsPane: () => <div data-testid="effects-pane">VideoEffectsPane</div>,
}));
-const editorSettings = vi.hoisted(() => ({ cursorShow: true }));
+const editorSettings = vi.hoisted(() => ({ cursorShow: true, autoFocusAll: false }));
vi.mock("@/lib/ai-edition/store/useEditorSettings", async (importOriginal) => {
const actual = await importOriginal<typeof import("@/lib/ai-edition/store/useEditorSettings")>();
return {
@@ -57,7 +58,7 @@ vi.mock("@/lib/ai-edition/store/useEditorSettings", async (importOriginal) => {
const result = actual.useEditorSettings();
return {
...result,
- settings: { ...result.settings, cursorShow: editorSettings.cursorShow },
+ settings: { ...result.settings, ...editorSettings },
};
},
};
@@ -172,7 +173,7 @@ describe("FloatingInspector", () => {
});
});
- describe("3D camera select", () => {
+ describe("zoom pane rows", () => {
const zoomTl = (region: Record<string, unknown>) => {
const updateZoomRotation = vi.fn();
const tl = {
@@ -185,49 +186,87 @@ describe("FloatingInspector", () => {
} as unknown as React.ComponentProps<typeof FloatingInspector>["tl"];
return { tl, updateZoomRotation };
};
+ const cameraButtons = () =>
+ within(screen.getByRole("group", { name: "settings.zoom.camera.title" })).getAllByRole(
+ "button",
+ );
afterEach(() => {
useProjectStore.setState({ document: null });
});
- it("is the only 3D select, off by default", () => {
+ it("is one row, off by default, its label naming the pick the tiles only draw", () => {
const { tl } = zoomTl({});
render(<FloatingInspector {...defaultProps} tl={tl} />);
- const select = screen.getByRole("combobox", { name: "settings.zoom.camera.title" });
- expect(select).toHaveValue("off");
- expect(screen.queryByRole("combobox", { name: /cameraMotion|threeD/ })).toBeNull();
+ const off = screen.getByRole("button", { name: "settings.zoom.camera.off" });
+ expect(off).toHaveAttribute("aria-pressed", "true");
+ expect(screen.getByText("settings.zoom.camera.off")).toBeInTheDocument();
+ expect(screen.queryByRole("group", { name: /cameraMotion|threeD/ })).toBeNull();
});
- it("groups the fixed angles apart from the moving cameras", () => {
+ it("lists off, then the fixed angles, then the moving camera", () => {
const { tl } = zoomTl({});
render(<FloatingInspector {...defaultProps} tl={tl} />);
- const select = screen.getByRole("combobox", { name: "settings.zoom.camera.title" });
- const groups = [...select.querySelectorAll("optgroup")].map((g) => [
- g.label,
- [...g.querySelectorAll("option")].map((o) => o.value),
- ]);
- expect(groups).toEqual([
- ["settings.zoom.camera.fixed", ["left", "right"]],
- ["settings.zoom.camera.moving", ["follow-cursor"]],
+ expect(cameraButtons().map((b) => b.getAttribute("aria-label"))).toEqual([
+ "settings.zoom.camera.off",
+ "settings.zoom.camera.preset.left",
+ "settings.zoom.camera.preset.right",
+ "settings.zoom.camera.preset.followCursor",
]);
});
it("writes the camera into rotationPreset, and off by absence", () => {
const { tl, updateZoomRotation } = zoomTl({ rotationPreset: "follow-cursor" });
render(<FloatingInspector {...defaultProps} tl={tl} />);
- const select = screen.getByRole("combobox", { name: "settings.zoom.camera.title" });
- expect(select).toHaveValue("follow-cursor");
- fireEvent.change(select, { target: { value: "left" } });
+ expect(
+ screen.getByRole("button", { name: "settings.zoom.camera.preset.followCursor" }),
+ ).toHaveAttribute("aria-pressed", "true");
+ fireEvent.click(screen.getByRole("button", { name: "settings.zoom.camera.preset.left" }));
expect(updateZoomRotation).toHaveBeenCalledWith("z", "left");
- fireEvent.change(select, { target: { value: "off" } });
+ fireEvent.click(screen.getByRole("button", { name: "settings.zoom.camera.off" }));
expect(updateZoomRotation).toHaveBeenLastCalledWith("z", undefined);
});
+ it("picks the focus mode and the cursor with one click each", () => {
+ const updateZoomFocusMode = vi.fn();
+ const updateZoomHideCursor = vi.fn();
+ const { tl } = zoomTl({});
+ render(
+ <FloatingInspector
+ {...defaultProps}
+ tl={{ ...tl, updateZoomFocusMode, updateZoomHideCursor }}
+ />,
+ );
+ expect(
+ screen.getByRole("button", { name: "settings.zoom.focusMode.manual" }),
+ ).toHaveAttribute("aria-pressed", "true");
+ fireEvent.click(screen.getByRole("button", { name: "settings.zoom.focusMode.auto" }));
+ expect(updateZoomFocusMode).toHaveBeenCalledWith("z", "auto");
+ fireEvent.click(screen.getByRole("button", { name: "settings.zoom.cursor.hide" }));
+ expect(updateZoomHideCursor).toHaveBeenCalledWith("z", true);
+ });
+
+ it("locks the focus mode on Auto while the timeline's Auto-Focus holds it, and says why", () => {
+ editorSettings.autoFocusAll = true;
+ try {
+ const { tl } = zoomTl({ focusMode: "manual" });
+ render(<FloatingInspector {...defaultProps} tl={tl} />);
+ const row = screen.getByRole("group", { name: "settings.zoom.focusMode.title" });
+ expect(
+ within(row).getByRole("button", { name: "settings.zoom.focusMode.auto" }),
+ ).toHaveAttribute("aria-pressed", "true");
+ for (const button of within(row).getAllByRole("button")) expect(button).toBeDisabled();
+ expect(row).toHaveAccessibleDescription("settings.zoom.focusMode.lockedDisclaimer");
+ } finally {
+ editorSettings.autoFocusAll = false;
+ }
+ });
+
it("offers no cursor-driven camera while the cursor is hidden, unless already picked", () => {
editorSettings.cursorShow = false;
try {
const moving = () =>
- screen.queryByRole("option", { name: "settings.zoom.camera.preset.followCursor" });
+ screen.queryByRole("button", { name: "settings.zoom.camera.preset.followCursor" });
const { tl } = zoomTl({});
const { unmount } = render(<FloatingInspector {...defaultProps} tl={tl} />);
expect(moving()).toBeNull();
diff --git a/src/components/ai-edition/v4/FloatingInspector.tsx b/src/components/ai-edition/v4/FloatingInspector.tsx
index 973462f59..c8a7604b4 100644
--- a/src/components/ai-edition/v4/FloatingInspector.tsx
+++ b/src/components/ai-edition/v4/FloatingInspector.tsx
@@ -26,13 +26,12 @@ import {
ZoomIn,
} from "lucide-react";
import type { ComponentProps } from "react";
-import { useEffect, useMemo, useRef, useState } from "react";
+import { useEffect, useId, useMemo, useRef, useState } from "react";
import { toast } from "sonner";
import { parseCustomPlaybackSpeedInput } from "@/components/video-editor/customPlaybackSpeed";
import {
effectiveZoomScale,
FIXED_ROTATION_3D_PRESETS,
- isRotation3DPreset,
MAX_PLAYBACK_SPEED,
MAX_ZOOM_SCALE,
MIN_ZOOM_SCALE,
@@ -328,11 +327,15 @@ function paneRow(label: string, control: React.ReactNode) {
}
/** Un libellé au-dessus de son contrôle, pour ceux qui prennent toute la largeur du panneau
- * (une `ChoiceRow`) : à côté d'un libellé, ils n'auraient plus la place de montrer leurs choix. */
-function paneStack(label: string, control: React.ReactNode) {
+ * (une `ChoiceRow`) : à côté d'un libellé, ils n'auraient plus la place de montrer leurs choix.
+ * `value` nomme le choix courant quand les boutons ne font que le dessiner. */
+function paneStack(label: string, control: React.ReactNode, value?: string) {
return (
<div style={{ display: "flex", flexDirection: "column", gap: 6 }}>
- <span style={{ fontSize: 13, color: "var(--fg-2)", fontWeight: 500 }}>{label}</span>
+ <span style={{ fontSize: 13, color: "var(--fg-2)", fontWeight: 500 }}>
+ {label}
+ {value ? <span className={shell.sectionLabelValue}>{value}</span> : null}
+ </span>
{control}
</div>
);
@@ -345,6 +348,21 @@ const CAMERA_KEYS: Record<Rotation3DPreset, string> = {
"follow-cursor": "followCursor",
};
+/** What each camera does to the screen (viewBox 0 0 32 22, as the camera layout tiles). A fixed
+ * angle is the outline of its pose: `ROTATION_3D_PRESETS` projected with the shipped
+ * perspective and centred. The moving camera leaves the screen flat and circles it. */
+const CAMERA_ICONS: Record<Rotation3DPreset | "off", React.ReactNode> = {
+ off: <rect x="6.5" y="5.5" width="19" height="11" rx="1.5" />,
+ left: <polygon points="5.6,4.5 26.4,5.3 22.9,17.5 7,12.9" />,
+ right: <polygon points="5.6,5.3 26.4,4.5 25,12.9 9.1,17.5" />,
+ "follow-cursor": (
+ <>
+ <rect x="10.5" y="7.5" width="11" height="7" rx="1" />
+ <ellipse cx="16" cy="11" rx="14" ry="7.5" strokeDasharray="2 2.5" />
+ </>
+ ),
+};
+
type AnnotationKind = AxcutAnnotationRegion["type"];
type ArrowDirectionKind = NonNullable<AxcutAnnotationRegion["figureData"]>["arrowDirection"];
@@ -699,6 +717,7 @@ function SelectionPane({ tl, onClose }: { tl: TimelineApi; onClose: () => void }
// toggle that writes it lives in the timeline toolbar, not on this component's path.
const { settings } = useEditorSettings();
const autoFocusAll = settings.autoFocusAll;
+ const focusHintId = useId();
const doc = useProjectStore((s) => s.document);
const zoomId = tl.selection?.kind === "zoom" ? tl.selection.id : null;
const zoomMaxScale = useMemo(
@@ -755,52 +774,57 @@ function SelectionPane({ tl, onClose }: { tl: TimelineApi; onClose: () => void }
if (selection.kind === "zoom") {
const region = tl.zoomRegions.find((z) => z.id === selection.id);
if (!region) return null;
+ const cameraLabel = (preset: Rotation3DPreset | "off") =>
+ ts(preset === "off" ? "zoom.camera.off" : `zoom.camera.preset.${CAMERA_KEYS[preset]}`);
return (
<div style={{ display: "flex", flexDirection: "column", minHeight: 0 }}>
{paneHeader(<ZoomIn size={16} />, tt("labels.zoom"), onClose, tc("actions.close"))}
<div style={bodyStyle}>
<ZoomLevelControl key={region.id} region={region} tl={tl} maxScale={zoomMaxScale} />
<div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
- {paneRow(
+ {paneStack(
ts("zoom.camera.title"),
// ONE control for the whole 3D camera: a fixed angle and a moving camera are
- // alternatives, not two settings to combine.
- <select
- aria-label={ts("zoom.camera.title")}
- value={region.rotationPreset ?? "off"}
- onChange={(e) =>
- void tl.updateZoomRotation(
- region.id,
- // "off" is the absence of a preset — the schema field is optional and
- // `migrate.ts` drops it when falsy.
- isRotation3DPreset(e.target.value) ? e.target.value : undefined,
- )
- }
- className={shell.control}
- >
- <option value="off">{ts("zoom.camera.off")}</option>
- <optgroup label={ts("zoom.camera.fixed")}>
- {FIXED_ROTATION_3D_PRESETS.map((preset) => (
- <option key={preset} value={preset}>
- {ts(`zoom.camera.preset.${CAMERA_KEYS[preset]}`)}
- </option>
- ))}
- </optgroup>
- {
+ // alternatives, not two settings to combine. Each tile draws what it does to
+ // the screen, so the label names the one picked.
+ <ChoiceRow<Rotation3DPreset | "off">
+ label={ts("zoom.camera.title")}
+ tiles
+ options={[
+ "off" as const,
+ ...FIXED_ROTATION_3D_PRESETS,
// A moving camera reads the cursor track, which the export only loads while
// the cursor is shown: not offered then, rather than a camera that silently
- // holds still. Still listed once picked, so the select can show it.
- settings.cursorShow || region.rotationPreset === "follow-cursor" ? (
- <optgroup label={ts("zoom.camera.moving")}>
- {MOVING_ROTATION_3D_PRESETS.map((preset) => (
- <option key={preset} value={preset}>
- {ts(`zoom.camera.preset.${CAMERA_KEYS[preset]}`)}
- </option>
- ))}
- </optgroup>
- ) : null
+ // holds still. Still listed once picked, so the row can show it.
+ ...(settings.cursorShow || region.rotationPreset === "follow-cursor"
+ ? MOVING_ROTATION_3D_PRESETS
+ : []),
+ ].map((preset) => ({
+ value: preset,
+ label: cameraLabel(preset),
+ icon: (
+ <svg
+ viewBox="0 0 32 22"
+ width={32}
+ height={22}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.75"
+ strokeLinejoin="round"
+ aria-hidden="true"
+ >
+ {CAMERA_ICONS[preset]}
+ </svg>
+ ),
+ }))}
+ value={region.rotationPreset ?? "off"}
+ // "off" is the absence of a preset — the schema field is optional and
+ // `migrate.ts` drops it when falsy.
+ onChange={(preset) =>
+ void tl.updateZoomRotation(region.id, preset === "off" ? undefined : preset)
}
- </select>,
+ />,
+ cameraLabel(region.rotationPreset ?? "off"),
)}
</div>
{
@@ -817,36 +841,36 @@ function SelectionPane({ tl, onClose }: { tl: TimelineApi; onClose: () => void }
)
: null
}
- {paneRow(
+ {paneStack(
ts("zoom.focusMode.title"),
// While the global toggle is on it OVERRIDES every region, so the control shows
// the effective mode ("auto") and goes read-only rather than lying about a
// per-region value that currently has no effect. The region's own `focusMode` is
// never written by the toggle — that is what makes each zoom snap back to its
// previous value the moment the toggle goes off.
- <select
+ <ChoiceRow<"manual" | "auto">
+ label={ts("zoom.focusMode.title")}
+ options={[
+ { value: "manual", label: ts("zoom.focusMode.manual") },
+ { value: "auto", label: ts("zoom.focusMode.auto") },
+ ]}
value={autoFocusAll ? "auto" : (region.focusMode ?? "manual")}
disabled={autoFocusAll}
- onChange={(e) =>
- void tl.updateZoomFocusMode(region.id, e.target.value as "manual" | "auto")
- }
- className={shell.control}
- >
- <option value="manual">{ts("zoom.focusMode.manual")}</option>
- <option value="auto">{ts("zoom.focusMode.auto")}</option>
- </select>,
+ describedBy={autoFocusAll ? focusHintId : undefined}
+ onChange={(mode) => void tl.updateZoomFocusMode(region.id, mode)}
+ />,
)}
- {paneRow(
+ {paneStack(
ts("zoom.cursor.title"),
- <select
- aria-label={ts("zoom.cursor.title")}
+ <ChoiceRow<"show" | "hide">
+ label={ts("zoom.cursor.title")}
+ options={[
+ { value: "show", label: ts("zoom.cursor.show") },
+ { value: "hide", label: ts("zoom.cursor.hide") },
+ ]}
value={region.hideCursor ? "hide" : "show"}
- onChange={(e) => void tl.updateZoomHideCursor(region.id, e.target.value === "hide")}
- className={shell.control}
- >
- <option value="show">{ts("zoom.cursor.show")}</option>
- <option value="hide">{ts("zoom.cursor.hide")}</option>
- </select>,
+ onChange={(v) => void tl.updateZoomHideCursor(region.id, v === "hide")}
+ />,
)}
{autoFocusAll || region.focusMode === "auto" ? (
// Auto resamples the focus from cursor telemetry every frame, so there is no fixed
@@ -854,7 +878,9 @@ function SelectionPane({ tl, onClose }: { tl: TimelineApi; onClose: () => void }
// reset button would be a no-op. When the global toggle is what forced auto, say
// where to turn it off.
autoFocusAll ? (
- <p className={shell.hint}>{ts("zoom.focusMode.lockedDisclaimer")}</p>
+ <p id={focusHintId} className={shell.hint}>
+ {ts("zoom.focusMode.lockedDisclaimer")}
+ </p>
) : null
) : (
<button
diff --git a/src/i18n/locales/ar/settings.json b/src/i18n/locales/ar/settings.json
index 218e536ef..44a3b8184 100644
--- a/src/i18n/locales/ar/settings.json
+++ b/src/i18n/locales/ar/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "كاميرا ثلاثية الأبعاد",
"off": "إيقاف",
- "fixed": "زاوية ثابتة",
- "moving": "كاميرا متحركة",
"preset": {
"left": "الشاشة مستديرة لليسار",
"right": "الشاشة مستديرة لليمين",
diff --git a/src/i18n/locales/cs/settings.json b/src/i18n/locales/cs/settings.json
index 3904fb2e0..f6c094844 100644
--- a/src/i18n/locales/cs/settings.json
+++ b/src/i18n/locales/cs/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D kamera",
"off": "Vypnuto",
- "fixed": "Pevný úhel",
- "moving": "Pohyblivá kamera",
"preset": {
"left": "Obrazovka natočená doleva",
"right": "Obrazovka natočená doprava",
diff --git a/src/i18n/locales/de/settings.json b/src/i18n/locales/de/settings.json
index 7c42f359d..1cd49ef4a 100644
--- a/src/i18n/locales/de/settings.json
+++ b/src/i18n/locales/de/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D-Kamera",
"off": "Aus",
- "fixed": "Fester Winkel",
- "moving": "Bewegte Kamera",
"preset": {
"left": "Bildschirm nach links gedreht",
"right": "Bildschirm nach rechts gedreht",
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index d65caa692..81c395c8c 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D camera",
"off": "Off",
- "fixed": "Fixed angle",
- "moving": "Moving camera",
"preset": {
"left": "Screen turned left",
"right": "Screen turned right",
diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.json
index c7bdcfcf3..6a08c8a20 100644
--- a/src/i18n/locales/es/settings.json
+++ b/src/i18n/locales/es/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "Cámara 3D",
"off": "Desactivada",
- "fixed": "Ángulo fijo",
- "moving": "Cámara en movimiento",
"preset": {
"left": "Pantalla girada a la izquierda",
"right": "Pantalla girada a la derecha",
diff --git a/src/i18n/locales/fr/settings.json b/src/i18n/locales/fr/settings.json
index c7306d398..4020debbe 100644
--- a/src/i18n/locales/fr/settings.json
+++ b/src/i18n/locales/fr/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "Caméra 3D",
"off": "Désactivée",
- "fixed": "Angle fixe",
- "moving": "Caméra mobile",
"preset": {
"left": "Écran tourné à gauche",
"right": "Écran tourné à droite",
diff --git a/src/i18n/locales/it/settings.json b/src/i18n/locales/it/settings.json
index 20e8f5558..8741f0bb9 100644
--- a/src/i18n/locales/it/settings.json
+++ b/src/i18n/locales/it/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "Camera 3D",
"off": "Disattivata",
- "fixed": "Angolo fisso",
- "moving": "Camera in movimento",
"preset": {
"left": "Schermo ruotato a sinistra",
"right": "Schermo ruotato a destra",
diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.json
index eb10e5252..108dcd8a8 100644
--- a/src/i18n/locales/ja-JP/settings.json
+++ b/src/i18n/locales/ja-JP/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3Dカメラ",
"off": "オフ",
- "fixed": "固定アングル",
- "moving": "動くカメラ",
"preset": {
"left": "画面を左向きに",
"right": "画面を右向きに",
diff --git a/src/i18n/locales/ko-KR/settings.json b/src/i18n/locales/ko-KR/settings.json
index fb3cb37a4..2b5e8c0b8 100644
--- a/src/i18n/locales/ko-KR/settings.json
+++ b/src/i18n/locales/ko-KR/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D 카메라",
"off": "끔",
- "fixed": "고정 각도",
- "moving": "움직이는 카메라",
"preset": {
"left": "화면 왼쪽으로 돌림",
"right": "화면 오른쪽으로 돌림",
diff --git a/src/i18n/locales/pt-BR/settings.json b/src/i18n/locales/pt-BR/settings.json
index ebd01e628..e3c17ace3 100644
--- a/src/i18n/locales/pt-BR/settings.json
+++ b/src/i18n/locales/pt-BR/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "Câmera 3D",
"off": "Desativada",
- "fixed": "Ângulo fixo",
- "moving": "Câmera em movimento",
"preset": {
"left": "Tela virada para a esquerda",
"right": "Tela virada para a direita",
diff --git a/src/i18n/locales/ru/settings.json b/src/i18n/locales/ru/settings.json
index b41116c08..0f0e3e6ed 100644
--- a/src/i18n/locales/ru/settings.json
+++ b/src/i18n/locales/ru/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D-камера",
"off": "Выкл.",
- "fixed": "Фиксированный ракурс",
- "moving": "Подвижная камера",
"preset": {
"left": "Экран повёрнут влево",
"right": "Экран повёрнут вправо",
diff --git a/src/i18n/locales/tr/settings.json b/src/i18n/locales/tr/settings.json
index 214b392a4..a438a835d 100644
--- a/src/i18n/locales/tr/settings.json
+++ b/src/i18n/locales/tr/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D kamera",
"off": "Kapalı",
- "fixed": "Sabit açı",
- "moving": "Hareketli kamera",
"preset": {
"left": "Ekran sola dönük",
"right": "Ekran sağa dönük",
diff --git a/src/i18n/locales/vi/settings.json b/src/i18n/locales/vi/settings.json
index ab46ef8f8..f976e7fe2 100644
--- a/src/i18n/locales/vi/settings.json
+++ b/src/i18n/locales/vi/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "Camera 3D",
"off": "Tắt",
- "fixed": "Góc cố định",
- "moving": "Camera chuyển động",
"preset": {
"left": "Màn hình xoay sang trái",
"right": "Màn hình xoay sang phải",
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 6eabd9da0..86a5e83bc 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D 镜头",
"off": "关闭",
- "fixed": "固定角度",
- "moving": "运动镜头",
"preset": {
"left": "画面向左转",
"right": "画面向右转",
diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.json
index 65485ee6e..eeb39db64 100644
--- a/src/i18n/locales/zh-TW/settings.json
+++ b/src/i18n/locales/zh-TW/settings.json
@@ -366,8 +366,6 @@
"camera": {
"title": "3D 鏡頭",
"off": "關閉",
- "fixed": "固定角度",
- "moving": "運動鏡頭",
"preset": {
"left": "畫面向左轉",
"right": "畫面向右轉",
diff --git a/src/utils/aspectRatioUtils.ts b/src/utils/aspectRatioUtils.ts
index b8aa49649..64a630756 100644
--- a/src/utils/aspectRatioUtils.ts
+++ b/src/utils/aspectRatioUtils.ts
@@ -122,11 +122,6 @@ export function getAspectRatioDimensions(
};
}
-export function getAspectRatioLabel(aspectRatio: AspectRatio): string {
- if (aspectRatio === "native") return "Original";
- return aspectRatio;
-}
-
export function isPortraitAspectRatio(aspectRatio: AspectRatio): boolean {
return getAspectRatioValue(aspectRatio) < 1;
}