Repository navigation
Clear a stale Prompt required error once the prompt has text - #175
Merged
Merged
Conversation
Pressing Generate with an empty prompt sets the status bar to "Prompt required." with the Error pill and shows "Enter a prompt before generating." under it. Nothing took either down until the next Generate, so loading a prompt from the Wallet left a full prompt field sitting above an error saying there was none (G4 smoke run 2026-11-05, finding 4). Typing had the same problem. A small input listener on each tool's prompt field now resets the bar to "Ready." and hides the error line when the status still reads "Prompt required." and the field has text. Every way a prompt arrives already fires "input" (typing, Wallet Load, the agent bridge, prompt-memory undo), so the Wallet itself does not change. It never touches any other error: the status text has to be exactly the prompt-required one. It covers the seven tools that stop with that status, Inpaint included (through its readiness gate). App.ts now writes the status through one exported constant, and a test fails if a tool starts writing it without being registered for the reset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 tasks
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.
Fixes finding (4) from the 2026-11-05 G4 smoke run (
docs/uxp-smoke-checklist.md, Results table): a "Prompt required" error stayed on Text to Image after a prompt was loaded from the Wallet.What changed and why
When you press Generate with an empty prompt, the handler sets two things: the status bar reads "Prompt required." with the red Error pill, and the error line says "Enter a prompt before generating." Nothing cleared them until the next Generate. So Wallet › Use put a full prompt in the field while the error underneath still said there was none. Typing a prompt left the same stale error; the Wallet just made it more obvious, because Load takes you to another screen and back.
src/ui/promptRequiredReset.ts. It adds a listener on each tool's prompt field. Oninput, if the status still reads exactly "Prompt required." and the field now has text, it hides the error line and sets the bar back to "Ready." (the same text and tone the panel shows at startup). The decision lives in a small pure helper,isPromptRequiredErrorStale.input: typing, Wallet Load (useEntrydispatches it), the agent bridge (notifyFieldChanged) and prompt-memory undo. One listener covers all four, andpromptWallet.tsdoesn't change.App.ts: +2 lines, 6 edited. It imports the module and callsbindPromptRequiredReset(elements)right afterbindPromptWallet. The six inline"Prompt required."strings now use the exportedPROMPT_REQUIRED_STATUS, so the code that writes the status and the code that checks it can't drift apart.bindPromptWallet, so a throw can't stop the rest ofrenderAppfrom binding.There are no changes to
styles.css,appMarkup.tsor any Photoshop call.Tests
tests/ui/promptRequiredReset.test.ts(jsdom, real panel markup, 15 tests):nullfor an empty field and whitespace-only prompts;bindPromptWalletand real binder, Generate with no prompt, Load › Use. The bar reads "Ready.", the pill is not Error, the error line is hidden, and diagnostics say "Prompt loaded from Wallet.";App.tsno longer contains the literal"Prompt required."; everyset…Status(elements, PROMPT_REQUIRED_STATUS, "error")inApp.tsbelongs to a registered tool; Inpaint's readiness label equals the constant; each tool's prompt field is paired with its own status bar.Mutation check: when I made the helper return
false, 4 of the 15 tests failed (the helper case, the typing case, the per-tool case and the Wallet end-to-end case). Restoring it made them pass again.What was verified
In Photoshop 2025 (Windows 11), by Claude through computer-use, on this branch's
dist/loaded with UXP Developer Tool. No document was open; the empty-prompt check runs before anything is captured.This also shows that UXP passes the Wallet's dispatched
inputevent on to the new listener, which jsdom can't prove.What could NOT be verified
Open question
The fix also clears the error when you type a prompt, not only when you load one, because that's the same stale-error bug. If you'd rather it only cleared on Wallet Load, say so and I'll narrow it.
What Mehran should check in Photoshop
To test this branch: GitHub Desktop › Current Branch ›
fix/wallet-clears-prompt-error, thennpm run build, then UXP Developer Tool › OpenLayer › Reload. Do it on the Home screen or in a new document.Smoke checklist blocks to re-check (
docs/uxp-smoke-checklist.md)🤖 Generated with Claude Code