You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prompt workflow actions throw on validation — invalid URL, long note, and suggestion errors surface as the masked digest toast #549
Three small server actions still throw on user-triggerable validation failures, which in production surfaces as the masked An error occurred in the Server Components render… digest: … string instead of the real message.
addPromptTargetUrl throws Enter a valid URL, This URL is already targeted for this prompt (unique-violation), and DB errors. Repro: type abc in the target-URL input on a prompt detail page and press Enter (the input submits on Enter) — the toast shows the digest string.
addPromptNote throws Note cannot be empty and Note is too long (max 2000 characters). A >2000-char note is rejected with a digest toast and the typed note is lost — the textarea has no maxLength or character counter to warn the user first.
acceptSuggestion throws Suggestion not found or already processed and No prompt set exists for this brand. Create one first. — the latter is reachable right after brand creation and tells the user exactly how to proceed, but it never reaches them.
Follow the PR #536 pattern (addPromptToBrand in web/src/lib/actions/prompt.ts is the reference implementation): return { …value } | { error: string } instead of throwing, and branch on 'error' in result at the call sites.
Render the addPromptTargetUrl error as inline red helper text under the URL input rather than a toast.
Bonus for addPromptNote: add maxLength={2000} plus a small character counter to the textarea so users are warned before submitting.
Acceptance
Entering abc as a target URL shows Enter a valid URL inline.
A >2000-char note shows the length message (and the counter warns beforehand).
Accepting a suggestion on a brand without a prompt set shows the "Create one first" message.
Assigned to you — thanks! 🙌 Heads-up: a fix for the sibling issue #547 (addPromptToSet) is about to land, which changes its return shape to { prompt } | { error, code? }. Worth branching from main after that merges so the two don't conflict.
Activity
BharadwajKanneveti commentedon Jul 31, 2026
Hi @gkhngyk can I work on this issue
gkhngyk commentedon Aug 1, 2026
Assigned to you — thanks! 🙌 Heads-up: a fix for the sibling issue #547 (
addPromptToSet) is about to land, which changes its return shape to{ prompt } | { error, code? }. Worth branching from main after that merges so the two don't conflict.