Skip to content

fix: stop the Image Gen backend probe from disabling the whole prompt form (#5671) - #5802

Merged
atomantic merged 3 commits into
mainfrom
claim/issue-5671
Sep 2, 2026
Merged

fix: stop the Image Gen backend probe from disabling the whole prompt form (#5671)#5802
atomantic merged 3 commits into
mainfrom
claim/issue-5671

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Landing on /media/image used to grey out the entire above-the-fold form until the Stable Diffusion status probe answered — and it went dead again on every backend-chip or model switch. An unconfigured external SD API URL makes that probe time out, so the page's primary CTA was effectively unusable on first paint. ImageGen.jsx threaded statusLoading into disabled on 14 controls, including both prompt textareas and the universe/style pickers, which are pure client-side form state.

The probe decides which backend can run, not what the user may type. It now gates only:

  • the backend chip strip,
  • the Refresh-status button,
  • the Generate submit button (plus the form's implicit-submit path).

Everything else — prompt and negative-prompt textareas, universe and style pickers, prompt helpers, LoRA/init/reference pickers, and every parameter input — stays live while the status pill is still checking. This matches VideoGen.jsx, which gates exactly one control.

Two follow-ons from local review, both shipped in this branch:

  • Implicit submit. Re-enabling the form re-opens the Enter-inside-a-number-input submit path, which fires onSubmit even when the default button is disabled. handleGenerate already carried that reasoning for the edit-image / cloud-prompt hints; the probe gate now sits alongside them.
  • Federated targets. A remote render dispatches to the peer, so the local probe has nothing to say about it. The gate is a single localBackendPending predicate (statusLoading && !remoteTargetActive) used by the button's disabled state, its "Checking…" label and tooltip, and the submit guard — so a hung local probe no longer blocks a render aimed at a ready peer.

While the probe is in flight the Generate button reads "Checking…" with an explanatory tooltip, so the disabled state reads as progress rather than a mystery grey button.

Test plan

New client/src/pages/ImageGen.probeGating.test.jsx (4 cases, each verified to fail against the pre-fix code for its own regression):

  • prompt and negative-prompt textareas stay enabled while getImageGenStatus is pending, and Generate is disabled and labelled "Checking…";
  • after the probe resolves connected: false, Generate stays disabled while both textareas stay editable;
  • an implicit form submit fired during the pending probe does not reach generateImage;
  • with a ready peer selected as the render target, Generate is enabled and submits even though the local probe is still hanging.

Also run:

  • cd client && npm test — 854 files / 10691 tests passing.
  • cd client && npm run lint — clean.
  • grep -c 'disabled={statusLoading}' client/src/pages/ImageGen.jsx → 2 (acceptance criterion: at most 3).

Closes #5671

https://claude.ai/code/session_01DxNA8g7B5hZd4uswfUM1xn

… form (#5671)

Landing on /media/image greyed out the entire above-the-fold form until the
Stable Diffusion status probe answered — and did it again on every backend-chip
or model switch. An unconfigured external SD API URL makes that probe time out,
so the page's primary CTA was effectively dead on first paint.

The probe decides WHICH backend can run, not what the user may type. It now
gates only backend selection (the chip strip), the Refresh-status button, and
the Generate submit button; the prompt and negative-prompt textareas, universe
and style pickers, prompt helpers, LoRA/init/reference pickers and every
parameter input stay live while the status pill is still checking. Generate
shows a "Checking…" label and an explanatory tooltip while it waits, so the
disabled state reads as progress rather than a mystery grey button. This
matches VideoGen, which gates exactly one control.

Claude-Session: https://claude.ai/code/session_01DxNA8g7B5hZd4uswfUM1xn
Re-enabling the form during the status probe re-opens the implicit-submit
path: Enter inside a number input fires the form's onSubmit even though the
default Generate button is disabled. handleGenerate already carries that
reasoning for the edit-image and cloud-prompt hints; extend the same guard to
the probe so a submit can't dispatch against an unconfirmed or unreachable
backend. A remote render target runs on the peer, so the local probe result
does not gate it — the guard mirrors the submit button exactly.

Claude-Session: https://claude.ai/code/session_01DxNA8g7B5hZd4uswfUM1xn
A federated render target dispatches to the peer, so this machine's Stable
Diffusion probe — the one that hangs against an unconfigured external SD API
URL — has nothing to say about whether it can run. Fold the probe into a
single `localBackendPending` predicate that is false whenever a remote target
is selected, and use it for the Generate button's disabled state, its
"Checking…" label and tooltip, and the implicit-submit guard.

Claude-Session: https://claude.ai/code/session_01DxNA8g7B5hZd4uswfUM1xn
@atomantic
atomantic merged commit 96d04d7 into main Sep 2, 2026
7 checks passed
@atomantic
atomantic deleted the claim/issue-5671 branch September 2, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image Gen disables its entire prompt form during every backend status probe, so the page's primary CTA is dead on first paint

1 participant