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): the background picker back inline, Screen Studio's way

EtienneLescot1e590dad626b
diff --git a/public/wallpapers/thumbs/wallpaper1.jpg b/public/wallpapers/thumbs/wallpaper1.jpg
index 3b807fdfd..c1ad30941 100644
Binary files a/public/wallpapers/thumbs/wallpaper1.jpg and b/public/wallpapers/thumbs/wallpaper1.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper10.jpg b/public/wallpapers/thumbs/wallpaper10.jpg
index 67f011b61..9526bf6e5 100644
Binary files a/public/wallpapers/thumbs/wallpaper10.jpg and b/public/wallpapers/thumbs/wallpaper10.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper11.jpg b/public/wallpapers/thumbs/wallpaper11.jpg
index 3ddae52c0..3ae68d0a7 100644
Binary files a/public/wallpapers/thumbs/wallpaper11.jpg and b/public/wallpapers/thumbs/wallpaper11.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper12.jpg b/public/wallpapers/thumbs/wallpaper12.jpg
index fcb82f393..496ca232e 100644
Binary files a/public/wallpapers/thumbs/wallpaper12.jpg and b/public/wallpapers/thumbs/wallpaper12.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper13.jpg b/public/wallpapers/thumbs/wallpaper13.jpg
index cfeb50f66..cd0e37312 100644
Binary files a/public/wallpapers/thumbs/wallpaper13.jpg and b/public/wallpapers/thumbs/wallpaper13.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper14.jpg b/public/wallpapers/thumbs/wallpaper14.jpg
index c4b8e0a6b..b644b5b49 100644
Binary files a/public/wallpapers/thumbs/wallpaper14.jpg and b/public/wallpapers/thumbs/wallpaper14.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper15.jpg b/public/wallpapers/thumbs/wallpaper15.jpg
index ea949b1d9..999139408 100644
Binary files a/public/wallpapers/thumbs/wallpaper15.jpg and b/public/wallpapers/thumbs/wallpaper15.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper16.jpg b/public/wallpapers/thumbs/wallpaper16.jpg
index 7a3182474..bdcfbd418 100644
Binary files a/public/wallpapers/thumbs/wallpaper16.jpg and b/public/wallpapers/thumbs/wallpaper16.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper17.jpg b/public/wallpapers/thumbs/wallpaper17.jpg
index effce8113..8dcaac10b 100644
Binary files a/public/wallpapers/thumbs/wallpaper17.jpg and b/public/wallpapers/thumbs/wallpaper17.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper18.jpg b/public/wallpapers/thumbs/wallpaper18.jpg
index 5dfc629db..28aaf35b5 100644
Binary files a/public/wallpapers/thumbs/wallpaper18.jpg and b/public/wallpapers/thumbs/wallpaper18.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper2.jpg b/public/wallpapers/thumbs/wallpaper2.jpg
index 371cc69a6..9fd021ebc 100644
Binary files a/public/wallpapers/thumbs/wallpaper2.jpg and b/public/wallpapers/thumbs/wallpaper2.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper3.jpg b/public/wallpapers/thumbs/wallpaper3.jpg
index 49d9191e5..f74d1b881 100644
Binary files a/public/wallpapers/thumbs/wallpaper3.jpg and b/public/wallpapers/thumbs/wallpaper3.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper4.jpg b/public/wallpapers/thumbs/wallpaper4.jpg
index 169dd84b8..eccbcfb55 100644
Binary files a/public/wallpapers/thumbs/wallpaper4.jpg and b/public/wallpapers/thumbs/wallpaper4.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper5.jpg b/public/wallpapers/thumbs/wallpaper5.jpg
index bc4e93b4a..60842a09e 100644
Binary files a/public/wallpapers/thumbs/wallpaper5.jpg and b/public/wallpapers/thumbs/wallpaper5.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper6.jpg b/public/wallpapers/thumbs/wallpaper6.jpg
index b11145bf4..230cfed78 100644
Binary files a/public/wallpapers/thumbs/wallpaper6.jpg and b/public/wallpapers/thumbs/wallpaper6.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper7.jpg b/public/wallpapers/thumbs/wallpaper7.jpg
index 0fd5b38bf..c5eac1271 100644
Binary files a/public/wallpapers/thumbs/wallpaper7.jpg and b/public/wallpapers/thumbs/wallpaper7.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper8.jpg b/public/wallpapers/thumbs/wallpaper8.jpg
index 7380ffbb9..89733387e 100644
Binary files a/public/wallpapers/thumbs/wallpaper8.jpg and b/public/wallpapers/thumbs/wallpaper8.jpg differ
diff --git a/public/wallpapers/thumbs/wallpaper9.jpg b/public/wallpapers/thumbs/wallpaper9.jpg
index baa49c974..dc4b74042 100644
Binary files a/public/wallpapers/thumbs/wallpaper9.jpg and b/public/wallpapers/thumbs/wallpaper9.jpg differ
diff --git a/src/components/ai-edition/NewEditorShell.module.css b/src/components/ai-edition/NewEditorShell.module.css
index fe2ce80b6..23edd1379 100644
--- a/src/components/ai-edition/NewEditorShell.module.css
+++ b/src/components/ai-edition/NewEditorShell.module.css
@@ -1215,72 +1215,54 @@ textarea.control {
}
/* ─── bg thumb grid ────────────────────────────────────────────── */
+/* Eight to a row, as small as Screen Studio's: the whole bundled set fits in three rows, and
+ the colours and gradients in two. */
.bgGrid {
display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: 8px;
- padding: 0 var(--sp-4) var(--sp-4);
+ grid-template-columns: repeat(8, minmax(0, 1fr));
+ gap: 5px;
+ padding: 0 var(--sp-4) 12px;
}
.bgThumb {
aspect-ratio: 1/1;
- border-radius: 10px;
+ min-width: 0;
+ padding: 0;
+ border-radius: 8px;
border: 1px solid transparent;
cursor: pointer;
transition: transform 150ms ease, border-color 150ms ease;
background: var(--surface-2);
}
-.bgThumb:hover { transform: translateY(-1px); }
-.bgThumb.isActive {
- border-color: var(--brand);
- box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand), transparent 70%);
+.bgAdd {
+ display: grid;
+ place-items: center;
+ border: 1px dashed var(--border-hi);
+ background: transparent;
+ color: var(--muted);
}
-
-/* ─── background picker (collapsed trigger + floating panel) ───── */
-/* The trigger paints the CURRENT background as its own surface, so the pane shows what is
- selected without spending the ~300px the inline swatch grid used to cost. */
-.bgTrigger {
- display: flex;
- align-items: flex-end;
- justify-content: flex-end;
- height: 52px;
- margin: 0 var(--sp-4) 12px;
- padding: 6px;
- border: 1px solid var(--border);
- border-radius: 10px;
- background: var(--surface-2);
- cursor: pointer;
- overflow: hidden;
- transition: border-color 150ms ease;
+.bgAdd:hover:not(:disabled) {
+ border-color: var(--accent);
+ color: var(--accent);
}
-.bgTrigger:hover { border-color: var(--brand); }
-/* Sits ON an arbitrary photo, so it carries its own ground rather than trusting contrast. */
-.bgTriggerChip {
+.bgDisclosure {
display: inline-flex;
align-items: center;
gap: 4px;
- padding: 3px 7px;
- border-radius: 999px;
- background: color-mix(in oklab, var(--bg), transparent 10%);
- color: var(--fg);
- font: 500 var(--fs-app-sm)/1 var(--font-body);
+ margin: 0 var(--sp-4) 12px;
+ padding: 0;
+ border: 0;
+ background: transparent;
+ color: var(--fg-2);
+ font: 500 13px/1.2 var(--font-body);
+ cursor: pointer;
}
-.bgPopover {
- width: 300px;
- padding-top: 4px;
- border: 1px solid var(--border);
- border-radius: 12px;
- background: var(--surface-1);
- box-shadow: var(--elev-pop);
- /* Radix measures the room actually left below the trigger and publishes it here, so the
- picker uses the screen it has instead of a number guessed at authoring time. The second
- term is the tallest it ever needs: the gradient tab is ~640px (tabs + preset grid + the
- 240px-wide editor, whose wheel is square). A fixed 460px cap cut that editor in half and
- read as "the gradient panel is gone" — the content was there, below the fold, behind a
- scroll nobody could see. Beyond 680px there is nothing left to reveal. */
- max-height: min(var(--radix-popover-content-available-height, 80vh), 680px);
- overflow-y: auto;
- scrollbar-width: thin;
- scrollbar-color: var(--border) transparent;
+.bgDisclosure:hover { color: var(--fg); }
+.bgDisclosure svg { transition: transform var(--motion-fast) var(--ease); }
+.bgDisclosure[aria-expanded="true"] svg { transform: rotate(180deg); }
+.bgThumb:hover { transform: translateY(-1px); }
+.bgThumb.isActive {
+ border-color: var(--brand);
+ box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand), transparent 70%);
}
.captionsPopover {
diff --git a/src/components/ai-edition/RightPanes.backgroundMotion.test.tsx b/src/components/ai-edition/RightPanes.backgroundMotion.test.tsx
index 3cf1e798e..536e66a78 100644
--- a/src/components/ai-edition/RightPanes.backgroundMotion.test.tsx
+++ b/src/components/ai-edition/RightPanes.backgroundMotion.test.tsx
@@ -1,6 +1,7 @@
// @vitest-environment jsdom
// The background animation control moves only what the compositor draws as a gradient. On any
-// other wallpaper it must be dead and say why, not hold a choice that changes nothing on screen.
+// other wallpaper it is not shown at all, rather than holding a choice that changes nothing on
+// screen, and the stored choice waits for the next gradient.
import "@testing-library/jest-dom";
import { cleanup, fireEvent, render, screen, within } from "@testing-library/react";
@@ -11,8 +12,6 @@ import { createEmptyDocument } from "@/lib/ai-edition/schema";
import { useProjectStore } from "@/lib/ai-edition/store/projectStore";
import { VideoEffectsPane } from "./RightPanes";
-const REASON = /applies to gradient backgrounds only/i;
-
function renderWith(legacyEditor: Record<string, unknown>) {
const base = createEmptyDocument({ projectId: "project_motion", title: "Motion" });
useProjectStore.setState({
@@ -47,7 +46,6 @@ describe("background animation control", () => {
renderWith({ wallpaper: "linear-gradient(135deg, #2b3a67, #b8577f)" });
expect(choice("Aurora")).toBeEnabled();
expect(choice("None")).toHaveAttribute("aria-pressed", "true");
- expect(screen.queryByText(REASON)).not.toBeInTheDocument();
fireEvent.click(choice("Aurora"));
expect(useProjectStore.getState().document?.legacyEditor).toMatchObject({
@@ -55,13 +53,9 @@ describe("background animation control", () => {
});
});
- it("is disabled with its reason on an image, and keeps the stored choice", () => {
+ it("is not shown on an image, and keeps the stored choice for the next gradient", () => {
renderWith({ wallpaper: "/wallpapers/wallpaper1.jpg", wallpaperMotion: "waves" });
- for (const button of within(control()).getAllByRole("button")) {
- expect(button).toBeDisabled();
- }
- expect(choice("None")).toHaveAttribute("aria-pressed", "true");
- expect(screen.getByText(REASON)).toBeInTheDocument();
+ expect(screen.queryByRole("group", { name: "Animation" })).not.toBeInTheDocument();
expect(useProjectStore.getState().document?.legacyEditor).toMatchObject({
wallpaperMotion: "waves",
});
diff --git a/src/components/ai-edition/RightPanes.i18n.test.tsx b/src/components/ai-edition/RightPanes.i18n.test.tsx
index 832253c68..180366fda 100644
--- a/src/components/ai-edition/RightPanes.i18n.test.tsx
+++ b/src/components/ai-edition/RightPanes.i18n.test.tsx
@@ -6,7 +6,7 @@
// localized text is what actually reaches the DOM.
import "@testing-library/jest-dom";
-import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { cleanup, render, screen } from "@testing-library/react";
import type { ReactElement } from "react";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { I18nProvider } from "@/contexts/I18nContext";
@@ -37,12 +37,8 @@ describe("right-rail panes are localized", () => {
expect(screen.getByRole("button", { name: "Aide" })).toBeInTheDocument();
});
- it("renders the floating background picker in French once it is opened", () => {
- // The picker collapsed into a popover so the frame sliders stay above the fold, so
- // its strings are only in the DOM after the trigger is clicked — the assertion has
- // to open it, or it would pass on an empty document forever.
+ it("renders the background picker in French", () => {
renderIn("fr", <VideoEffectsPane />);
- fireEvent.click(screen.getByRole("button", { name: "Arrière-plan" }));
expect(screen.getByRole("button", { name: "Téléverser une image" })).toBeInTheDocument();
// wallpaper swatches interpolate their index through the catalog
expect(screen.getByRole("button", { name: "Fond 1" })).toBeInTheDocument();
diff --git a/src/components/ai-edition/RightPanes.tsx b/src/components/ai-edition/RightPanes.tsx
index 9fcfa9a3a..866641d13 100644
--- a/src/components/ai-edition/RightPanes.tsx
+++ b/src/components/ai-edition/RightPanes.tsx
@@ -12,6 +12,7 @@ import {
ChevronDown,
FileText,
HelpCircle,
+ ImagePlus,
Loader2,
Mic,
MousePointerClick,
@@ -357,94 +358,42 @@ const WALLPAPER_MOTION_LABEL_KEYS: Record<WallpaperMotion, string> = {
function BackgroundSection() {
const ts = useScopedT("settings");
const { settings, set, setLive, commit, hasDocument } = useEditorSettings();
- const [pickerOpen, setPickerOpen] = useState(false);
const { pick: handlePickFile, input: fileInput } = useWallpaperFileInput((dataUrl) =>
set({ wallpaper: dataUrl }),
);
- const motionApplies = wallpaperAcceptsMotion(settings.wallpaper);
return (
<>
<div className={styles.sectionLabel}>{ts("background.title")}</div>
- {/* The picker FLOATS instead of sitting inline. Inline, the 18-swatch grid was
- ~300px of the pane on its own and pushed padding/roundness/shadow — the
- controls #84 is actually about — below the fold on a laptop window. A user
- who opened the one appearance tab saw wallpapers and nothing else, which is
- the same failure the facet merge set out to fix, one level down. Same
- trade the aspect-ratio menu makes in the timeline toolbar: big choice,
- small trigger. */}
- <Popover open={pickerOpen} onOpenChange={setPickerOpen}>
- <PopoverTrigger asChild>
- <button
- type="button"
- className={styles.bgTrigger}
- style={backgroundSwatchStyle(settings.wallpaper)}
- // Deliberately NOT gated on hasDocument: opening the picker mutates
- // nothing, and the swatches inside carry their own gate. The inline grid
- // was browsable with no project open; collapsing it should not take that
- // away, only the space it used.
- aria-label={ts("background.title")}
- >
- <span className={styles.bgTriggerChip}>
- {ts(`background.${classifyWallpaper(settings.wallpaper).kind}`)}
- <ChevronDown size={11} />
- </span>
- </button>
- </PopoverTrigger>
- <PopoverContent
- align="start"
- sideOffset={6}
- // Keeps the picker off the window edge, and the same padding is what Radix
- // subtracts from `--radix-popover-content-available-height`, which sizes it.
- collisionPadding={12}
- animated={false}
- className="w-auto border-0 bg-transparent p-0 shadow-none"
- >
- <div className={styles.bgPopover}>
- <WallpaperPicker
- value={settings.wallpaper}
- hasDocument={hasDocument}
- onChange={(url) => void set({ wallpaper: url })}
- onLiveChange={(url) => setLive({ wallpaper: url })}
- onCommit={commit}
- onPickFile={handlePickFile}
- />
- </div>
- </PopoverContent>
- </Popover>
- {/* Stays mounted OUTSIDE the popover: opening the OS file dialog takes focus,
- which closes the popover and would unmount the input mid-pick, dropping the
- file. It has no layout to cost us here. */}
+ {/* Inline, the way Screen Studio sets it: the choice sits on the pane at a glance
+ instead of behind a trigger. Small swatches, eight to a row, are what keep it
+ from pushing the rest of the pane below the fold. */}
+ <WallpaperPicker
+ value={settings.wallpaper}
+ hasDocument={hasDocument}
+ onChange={(url) => void set({ wallpaper: url })}
+ onLiveChange={(url) => setLive({ wallpaper: url })}
+ onCommit={commit}
+ onPickFile={handlePickFile}
+ />
{fileInput}
- {/* Beside the picker because it moves what the picker chose. Only the compositor's own
- gradient can move; on anything else the control says so instead of holding a
- choice that changes nothing on screen. The stored choice is kept and comes back
- with the next gradient. */}
- <div className={`${styles.field} ${styles.fieldStack}`}>
- <span className={styles.fieldLabel}>{ts("background.motion")}</span>
- <ChoiceRow<WallpaperMotion>
- label={ts("background.motion")}
- options={WALLPAPER_MOTIONS.map((motion) => ({
- value: motion,
- label: ts(WALLPAPER_MOTION_LABEL_KEYS[motion]),
- }))}
- value={motionApplies ? settings.wallpaperMotion : "none"}
- disabled={!hasDocument || !motionApplies}
- onChange={(motion) => void set({ wallpaperMotion: motion })}
- />
- </div>
- {motionApplies ? null : (
- <p
- style={{
- margin: 0,
- padding: "0 var(--sp-4) 8px",
- font: "400 var(--fs-app-sm) var(--font-body)",
- color: "var(--muted)",
- }}
- >
- {ts("background.motionGradientOnly")}
- </p>
- )}
+ {/* Only a gradient can move, so the row comes with one instead of sitting greyed out
+ under a photo. The stored choice is kept and comes back with the next gradient. */}
+ {wallpaperAcceptsMotion(settings.wallpaper) ? (
+ <div className={`${styles.field} ${styles.fieldStack}`}>
+ <span className={styles.fieldLabel}>{ts("background.motion")}</span>
+ <ChoiceRow<WallpaperMotion>
+ label={ts("background.motion")}
+ options={WALLPAPER_MOTIONS.map((motion) => ({
+ value: motion,
+ label: ts(WALLPAPER_MOTION_LABEL_KEYS[motion]),
+ }))}
+ value={settings.wallpaperMotion}
+ disabled={!hasDocument}
+ onChange={(motion) => void set({ wallpaperMotion: motion })}
+ />
+ </div>
+ ) : null}
{/* Reads in the order it acts: pick a background, then blur it. Lived under
"Effects" while that was a separate facet, which is how a control named
"Blur BG" ended up in the tab that doesn't say background. */}
@@ -465,32 +414,6 @@ function BackgroundSection() {
);
}
-/**
- * The CSS `background` shorthand that paints a wallpaper value as a swatch — the same
- * painting the grid thumbs do, hoisted out so the collapsed trigger shows exactly what the
- * grid would show as selected. Bundled wallpapers resolve to their small pre-generated
- * thumbnail; colours and gradients are their own literal; a custom `data:` URL passes
- * through `resolveImageWallpaperUrl` untouched.
- */
-function backgroundSwatchStyle(value: string): CSSProperties {
- const classified = classifyWallpaper(value);
- if (classified.kind !== "image") return { background: classified.value };
- const bundled = WALLPAPER_PATHS.indexOf(classified.path);
- try {
- const url = resolveImageWallpaperUrl(
- bundled >= 0 ? WALLPAPER_THUMB_PATHS[bundled] : classified.path,
- );
- return { background: `center/cover no-repeat url(${url})` };
- } catch {
- // resolveImageWallpaperUrl THROWS for an image path outside /wallpapers/ — a guard
- // that exists to stop the app loading arbitrary files. The swatch grid only ever
- // feeds it constants, but this call site feeds it whatever the document holds, and a
- // throw here happens during render: one project saved by an older build with a path
- // we no longer allow would take the whole pane down instead of drawing a dull square.
- return { background: "var(--surface-2)" };
- }
-}
-
// keep the user's last data: URL after they switch tabs so the Image
// tab can keep showing it without immediately pushing it back through `set`.
function useMemoCustomWallpapers(current: string): string[] {
@@ -631,6 +554,9 @@ export function WallpaperPicker({
const [tab, setTab] = useState<"image" | "color" | "gradient">(
() => classifyWallpaper(value).kind,
);
+ // The editor is a colour wheel and two stops, taller than the rest of the tab together:
+ // shown on demand, so the presets stay in view.
+ const [gradientEditorOpen, setGradientEditorOpen] = useState(false);
const customUrls = useMemoCustomWallpapers(value);
const gradientCommitTimer = useRef<number | null>(null);
@@ -659,83 +585,70 @@ export function WallpaperPicker({
);
const isSelected = (candidate: string) => value === candidate;
-
- const handleTabChange = (next: "image" | "color" | "gradient") => {
- setTab(next);
- };
+ const tabs = [
+ { id: "image", label: ts("background.image") },
+ { id: "gradient", label: ts("background.gradient") },
+ { id: "color", label: ts("background.color") },
+ ] as const;
return (
<>
{/* role="tab" + aria-selected are what make the tablist mean anything: without
them a screen reader announces three plain buttons and never says which one
- is current. */}
+ is current. Browsing a tab changes nothing; a swatch does. */}
<div className={styles.paneTabs} role="tablist">
- <button
- type="button"
- role="tab"
- aria-selected={tab === "image"}
- className={tab === "image" ? styles.isActive : ""}
- onClick={() => handleTabChange("image")}
- >
- {ts("background.image")}
- </button>
- <button
- type="button"
- role="tab"
- aria-selected={tab === "color"}
- className={tab === "color" ? styles.isActive : ""}
- onClick={() => handleTabChange("color")}
- >
- {ts("background.color")}
- </button>
- <button
- type="button"
- role="tab"
- aria-selected={tab === "gradient"}
- className={tab === "gradient" ? styles.isActive : ""}
- onClick={() => handleTabChange("gradient")}
- >
- {ts("background.gradient")}
- </button>
+ {tabs.map(({ id, label }) => (
+ <button
+ key={id}
+ type="button"
+ role="tab"
+ aria-selected={tab === id}
+ className={tab === id ? styles.isActive : ""}
+ onClick={() => setTab(id)}
+ >
+ {label}
+ </button>
+ ))}
</div>
{tab === "image" ? (
- <>
+ <div className={styles.bgGrid}>
+ {/* First, so it is found without scrolling past the bundled set. */}
<button
type="button"
- className={styles.uploadBtn}
+ className={`${styles.bgThumb} ${styles.bgAdd}`}
+ aria-label={ts("background.uploadCustom")}
+ title={ts("background.uploadCustom")}
disabled={!hasDocument}
onClick={onPickFile}
>
- {ts("background.uploadCustom")}
+ <ImagePlus size={15} />
</button>
- <div className={styles.bgGrid}>
- {customUrls.map((url) => (
+ {customUrls.map((url) => (
+ <button
+ type="button"
+ key={`custom-${url.slice(-32)}`}
+ className={`${styles.bgThumb} ${isSelected(url) ? styles.isActive : ""}`}
+ style={{ background: `center/cover no-repeat url(${url})` }}
+ aria-label={ts("background.customWallpaper")}
+ disabled={!hasDocument}
+ onClick={() => onChange(url)}
+ />
+ ))}
+ {WALLPAPER_PATHS.map((path, i) => {
+ const previewUrl = resolveImageWallpaperUrl(WALLPAPER_THUMB_PATHS[i]);
+ return (
<button
type="button"
- key={`custom-${url.slice(-32)}`}
- className={`${styles.bgThumb} ${isSelected(url) ? styles.isActive : ""}`}
- style={{ background: `center/cover no-repeat url(${url})` }}
- aria-label={ts("background.customWallpaper")}
+ key={path}
+ className={`${styles.bgThumb} ${isSelected(path) ? styles.isActive : ""}`}
+ style={{ background: `center/cover no-repeat url(${previewUrl})` }}
+ aria-label={ts("background.imageLabel", { index: i + 1 })}
disabled={!hasDocument}
- onClick={() => onChange(url)}
+ onClick={() => onChange(path)}
/>
- ))}
- {WALLPAPER_PATHS.map((path, i) => {
- const previewUrl = resolveImageWallpaperUrl(WALLPAPER_THUMB_PATHS[i]);
- return (
- <button
- type="button"
- key={path}
- className={`${styles.bgThumb} ${isSelected(path) ? styles.isActive : ""}`}
- style={{ background: `center/cover no-repeat url(${previewUrl})` }}
- aria-label={ts("background.imageLabel", { index: i + 1 })}
- disabled={!hasDocument}
- onClick={() => onChange(path)}
- />
- );
- })}
- </div>
- </>
+ );
+ })}
+ </div>
) : tab === "color" ? (
<BackgroundColorTab
value={value}
@@ -759,7 +672,20 @@ export function WallpaperPicker({
/>
))}
</div>
- {hasDocument ? <GradientEditor onChange={handleGradientChange} /> : null}
+ {hasDocument ? (
+ <>
+ <button
+ type="button"
+ className={styles.bgDisclosure}
+ aria-expanded={gradientEditorOpen}
+ onClick={() => setGradientEditorOpen((open) => !open)}
+ >
+ {ts("background.custom")}
+ <ChevronDown size={14} />
+ </button>
+ {gradientEditorOpen ? <GradientEditor onChange={handleGradientChange} /> : null}
+ </>
+ ) : null}
</>
)}
</>
diff --git a/src/i18n/locales/ar/settings.json b/src/i18n/locales/ar/settings.json
index 88a9a32b9..a4d890b85 100644
--- a/src/i18n/locales/ar/settings.json
+++ b/src/i18n/locales/ar/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "انجراف",
"motionAurora": "شفق",
"motionWaves": "أمواج",
- "motionGradientOnly": "ينطبق التحريك على الخلفيات المتدرجة فقط. اختر تدرجًا لتحريكه.",
"gradientLabel": "تدرج لوني {{index}}",
"uploadCustom": "رفع صورة مخصصة",
"unsupportedImage": "صورة غير مدعومة. استخدم ملف JPG أو PNG.",
diff --git a/src/i18n/locales/cs/settings.json b/src/i18n/locales/cs/settings.json
index 701c74a11..c1e11b787 100644
--- a/src/i18n/locales/cs/settings.json
+++ b/src/i18n/locales/cs/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Posun",
"motionAurora": "Polární záře",
"motionWaves": "Vlny",
- "motionGradientOnly": "Animace platí jen pro přechodová pozadí. Vyberte přechod, který chcete animovat.",
"gradientLabel": "Přechod {{index}}",
"uploadCustom": "Nahrát vlastní",
"unsupportedImage": "Nepodporovaný obrázek. Použijte soubor JPG nebo PNG.",
diff --git a/src/i18n/locales/de/settings.json b/src/i18n/locales/de/settings.json
index 4b7e19ad9..4466a87dd 100644
--- a/src/i18n/locales/de/settings.json
+++ b/src/i18n/locales/de/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Treiben",
"motionAurora": "Polarlicht",
"motionWaves": "Wellen",
- "motionGradientOnly": "Animation gilt nur für Verlaufshintergründe. Wähle einen Verlauf, um ihn zu animieren.",
"gradientLabel": "Verlauf {{index}}",
"uploadCustom": "Eigenes hochladen",
"unsupportedImage": "Nicht unterstütztes Bild. Verwende eine JPG- oder PNG-Datei.",
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index 297b712ed..7f17b975c 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Drift",
"motionAurora": "Aurora",
"motionWaves": "Waves",
- "motionGradientOnly": "Animation applies to gradient backgrounds only. Pick a gradient to animate it.",
"gradientLabel": "Gradient {{index}}",
"uploadCustom": "Upload image",
"unsupportedImage": "Unsupported image. Use a JPG or PNG file.",
diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.json
index 890b41440..e5bf1194d 100644
--- a/src/i18n/locales/es/settings.json
+++ b/src/i18n/locales/es/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Deriva",
"motionAurora": "Aurora",
"motionWaves": "Ondas",
- "motionGradientOnly": "La animación solo se aplica a fondos degradados. Elige un degradado para animarlo.",
"gradientLabel": "Degradado {{index}}",
"uploadCustom": "Subir personalizado",
"unsupportedImage": "Imagen no compatible. Usa un archivo JPG o PNG.",
diff --git a/src/i18n/locales/fr/settings.json b/src/i18n/locales/fr/settings.json
index 68e0e2233..06a4ccbf7 100644
--- a/src/i18n/locales/fr/settings.json
+++ b/src/i18n/locales/fr/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Dérive",
"motionAurora": "Aurore",
"motionWaves": "Vagues",
- "motionGradientOnly": "L'animation ne s'applique qu'aux fonds dégradés. Choisissez un dégradé pour l'animer.",
"gradientLabel": "Dégradé {{index}}",
"uploadCustom": "Téléverser une image",
"unsupportedImage": "Image non prise en charge. Utilisez un fichier JPG ou PNG.",
diff --git a/src/i18n/locales/it/settings.json b/src/i18n/locales/it/settings.json
index a0c13e5aa..b0da6eef3 100644
--- a/src/i18n/locales/it/settings.json
+++ b/src/i18n/locales/it/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Deriva",
"motionAurora": "Aurora",
"motionWaves": "Onde",
- "motionGradientOnly": "L'animazione si applica solo agli sfondi sfumati. Scegli una sfumatura per animarla.",
"gradientLabel": "Sfumatura {{index}}",
"uploadCustom": "Carica personalizzato",
"unsupportedImage": "Immagine non supportata. Usa un file JPG o PNG.",
diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.json
index af5e3d177..3c4bbdde3 100644
--- a/src/i18n/locales/ja-JP/settings.json
+++ b/src/i18n/locales/ja-JP/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "ドリフト",
"motionAurora": "オーロラ",
"motionWaves": "ウェーブ",
- "motionGradientOnly": "アニメーションはグラデーション背景にのみ適用されます。アニメーションするにはグラデーションを選択してください。",
"gradientLabel": "グラデーション {{index}}",
"uploadCustom": "カスタム画像を読み込む",
"unsupportedImage": "対応していない画像です。JPG または PNG ファイルを使用してください。",
diff --git a/src/i18n/locales/ko-KR/settings.json b/src/i18n/locales/ko-KR/settings.json
index 7c556eb97..8c9b1197e 100644
--- a/src/i18n/locales/ko-KR/settings.json
+++ b/src/i18n/locales/ko-KR/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "드리프트",
"motionAurora": "오로라",
"motionWaves": "물결",
- "motionGradientOnly": "애니메이션은 그라데이션 배경에만 적용됩니다. 애니메이션을 적용하려면 그라데이션을 선택하세요.",
"gradientLabel": "그라디언트 {{index}}",
"uploadCustom": "직접 업로드",
"unsupportedImage": "지원하지 않는 이미지입니다. JPG 또는 PNG 파일을 사용하세요.",
diff --git a/src/i18n/locales/pt-BR/settings.json b/src/i18n/locales/pt-BR/settings.json
index 398fa2839..2ace983d2 100644
--- a/src/i18n/locales/pt-BR/settings.json
+++ b/src/i18n/locales/pt-BR/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Deriva",
"motionAurora": "Aurora",
"motionWaves": "Ondas",
- "motionGradientOnly": "A animação só se aplica a fundos em degradê. Escolha um degradê para animá-lo.",
"gradientLabel": "Gradiente {{index}}",
"uploadCustom": "Enviar Personalizada",
"unsupportedImage": "Imagem não suportada. Use um arquivo JPG ou PNG.",
diff --git a/src/i18n/locales/ru/settings.json b/src/i18n/locales/ru/settings.json
index 625a53605..6145daf2f 100644
--- a/src/i18n/locales/ru/settings.json
+++ b/src/i18n/locales/ru/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Дрейф",
"motionAurora": "Сияние",
"motionWaves": "Волны",
- "motionGradientOnly": "Анимация применяется только к градиентным фонам. Выберите градиент, чтобы анимировать его.",
"gradientLabel": "Градиент {{index}}",
"uploadCustom": "Загрузить свой",
"unsupportedImage": "Неподдерживаемое изображение. Используйте файл JPG или PNG.",
diff --git a/src/i18n/locales/tr/settings.json b/src/i18n/locales/tr/settings.json
index 206b2b7ca..fda4e8f6d 100644
--- a/src/i18n/locales/tr/settings.json
+++ b/src/i18n/locales/tr/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Kayma",
"motionAurora": "Kutup ışığı",
"motionWaves": "Dalgalar",
- "motionGradientOnly": "Animasyon yalnızca gradyan arka planlara uygulanır. Canlandırmak için bir gradyan seçin.",
"gradientLabel": "Gradyan {{index}}",
"uploadCustom": "Özel Yükle",
"unsupportedImage": "Desteklenmeyen görsel. JPG veya PNG dosyası kullanın.",
diff --git a/src/i18n/locales/vi/settings.json b/src/i18n/locales/vi/settings.json
index 1aa15e103..ae5889346 100644
--- a/src/i18n/locales/vi/settings.json
+++ b/src/i18n/locales/vi/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "Trôi",
"motionAurora": "Cực quang",
"motionWaves": "Sóng",
- "motionGradientOnly": "Hoạt ảnh chỉ áp dụng cho nền chuyển sắc. Hãy chọn một nền chuyển sắc để tạo hoạt ảnh.",
"gradientLabel": "Dải màu {{index}}",
"uploadCustom": "Tải lên tùy chỉnh",
"unsupportedImage": "Ảnh không được hỗ trợ. Hãy dùng tệp JPG hoặc PNG.",
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index b34912793..5d794b0b0 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "漂移",
"motionAurora": "极光",
"motionWaves": "波浪",
- "motionGradientOnly": "动画仅适用于渐变背景。请选择一个渐变来启用动画。",
"gradientLabel": "渐变 {{index}}",
"uploadCustom": "上传自定义",
"unsupportedImage": "不支持的图片格式。请使用 JPG 或 PNG 文件。",
diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.json
index d8b84fafc..1b48d1e87 100644
--- a/src/i18n/locales/zh-TW/settings.json
+++ b/src/i18n/locales/zh-TW/settings.json
@@ -5,7 +5,6 @@
"motionDrift": "漂移",
"motionAurora": "極光",
"motionWaves": "波浪",
- "motionGradientOnly": "動畫僅適用於漸層背景。請選擇一個漸層來啟用動畫。",
"gradientLabel": "漸層 {{index}}",
"uploadCustom": "上傳自訂",
"unsupportedImage": "不支援的圖片格式。請使用 JPG 或 PNG 檔案。",
diff --git a/src/lib/wallpaper.ts b/src/lib/wallpaper.ts
index 7ce5e27f3..6a2b0b067 100644
--- a/src/lib/wallpaper.ts
+++ b/src/lib/wallpaper.ts
@@ -7,7 +7,7 @@ export const WALLPAPER_PATHS: readonly string[] = Array.from(
(_, i) => `/wallpapers/wallpaper${i + 1}.jpg`,
);
-// Small (240x240, ~3-8KB) pre-generated copies used ONLY for the picker grid's swatches — the
+// Small (96x96, ~1-3KB: three times the ~30px swatch) pre-generated copies used ONLY for the picker grid's swatches — the
// full-res originals (up to 4+MB, up to 7680px) are what `settings.wallpaper` still stores and
// what actually gets rendered/exported. Without this the grid was decoding all 18 originals
// (~20MB combined) simultaneously just to paint a few dozen px each (reported: picker felt slow
diff --git a/tests/e2e/v4-shell.spec.ts b/tests/e2e/v4-shell.spec.ts
index 5b060112d..0c48a7428 100644
--- a/tests/e2e/v4-shell.spec.ts
+++ b/tests/e2e/v4-shell.spec.ts
@@ -172,9 +172,8 @@ test.describe("v4 editor shell", () => {
test("inspector facet header opens a contextual help popover", async ({ page }) => {
await seedAndOpen(page);
- // The inspector opens on the "effects" facet; the rail buttons are labelled
- // from settings.<facet>.title (FloatingInspector's FACETS).
- await page.getByRole("button", { name: "Background" }).click();
+ // The inspector opens on the Composition facet, whose help covers the background
+ // section. Clicking its rail button again would collapse the inspector.
const help = page.getByRole("button", { name: "Help" });
await help.click();