Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Composer: a missing photo's toast has Upload, and Start focuses the empty tile

Claudeaa7e04acaadc
diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsx
index 5dcb88ac..ae34f126 100644
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@ -116,6 +116,11 @@ function pulseSlot(root: HTMLElement | null, key: string, retried = false) {
);
}
+/** An empty attachment tile's upload button (focus it, or click it from a toast action to open the file picker). */
+function slotButton(root: HTMLElement | null, key: string) {
+ return root?.querySelector<HTMLButtonElement>(`[data-slot-key="${key}"] button[aria-label$=": upload"]`) ?? null;
+}
+
export function Composer({ docked }: { docked: boolean }) {
const { config, draft, setDraft, setSlot } = useStudio();
const catalog = useCatalog();
@@ -254,9 +259,11 @@ export function Composer({ docked }: { docked: boolean }) {
if (blocker || create.isPending || signature.lock.isPending) {
if (blocker) {
// One blocker toast at a time (pressing Generate again replaces it), gone once a run starts.
- toast(blocker.message, { id: "composer-blocker" });
+ // A missing photo or clip: the toast's Upload opens the file picker (a click, so the browser allows it).
+ const slot = blocker.slot;
+ toast(blocker.message, { id: "composer-blocker", action: slot ? { label: "Upload", onClick: () => slotButton(root.current, slot)?.click() } : undefined });
// Point at the tile to fill: the missing slot, or the clip list of a tool that only takes clips.
- const target = blocker.slot ?? (config.multiRef && config.hidePrompt && draft.refs.length < 2 ? "refs" : undefined);
+ const target = slot ?? (config.multiRef && config.hidePrompt && draft.refs.length < 2 ? "refs" : undefined);
if (target) pulseSlot(root.current, target);
}
return;
@@ -338,12 +345,15 @@ export function Composer({ docked }: { docked: boolean }) {
});
const settling = !catalog.ready || presetLoading || uploading || (needsFull && !catalog.complete);
const step = startRequest ? startStep({ settling, blocker }) : "wait";
+ const blockedSlot = blocker?.slot;
useEffect(() => {
if (step === "wait" || startRequest <= startedFor.current) return;
startedFor.current = startRequest;
// After the blocker toast above was cleared for this render.
submitRef.current();
- }, [step, startRequest]);
+ // Nothing ran: the missing tile gets the focus, so Enter opens the file picker.
+ if (step === "explain" && blockedSlot) requestAnimationFrame(() => slotButton(root.current, blockedSlot)?.focus({ preventScroll: true }));
+ }, [step, startRequest, blockedSlot]);
// Voice, language, motion, style and Director chips: inline from sm up; on phones they live in the settings sheet, so the toolbar fits.
const voiceChips = (