fix: stop the Image Gen backend probe from disabling the whole prompt form (#5671) - #5802
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Landing on
/media/imageused 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.jsxthreadedstatusLoadingintodisabledon 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:
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:
onSubmiteven when the default button is disabled.handleGeneratealready carried that reasoning for the edit-image / cloud-prompt hints; the probe gate now sits alongside them.localBackendPendingpredicate (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):getImageGenStatusis pending, and Generate is disabled and labelled "Checking…";connected: false, Generate stays disabled while both textareas stay editable;generateImage;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