fix: make interactive prompt placeholders behave like defaults or cla…#140
Merged
felipefreitag merged 9 commits intomainfrom Mar 23, 2026
Merged
fix: make interactive prompt placeholders behave like defaults or cla…#140felipefreitag merged 9 commits intomainfrom
felipefreitag merged 9 commits intomainfrom
Conversation
vcapretz
approved these changes
Mar 20, 2026
4afd91e to
fd52efc
Compare
fd52efc to
d4a18ea
Compare
Contributor
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/lib/domains.ts">
<violation number="1" location="src/lib/domains.ts:58">
P2: Custom "From address" validation is too permissive and allows domains outside the selected verified domain.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/lib/domains.ts">
<violation number="1" location="src/lib/domains.ts:61">
P2: Allow display-name format (`Name <email@domain>`) in the custom from-address validation; the new `endsWith` check rejects that valid input.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/lib/domains.ts">
<violation number="1" location="src/lib/domains.ts:57">
P2: The new validation no longer enforces that the custom address uses the selected verified domain, so users can enter `foo@other.com` and only find out later when the send fails. Restore the domain check here.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…rify they're examples Pressing Enter on `emails send` prompts now uses working @resend.dev defaults so first-time users can send a test email without typing anything. Ambiguous placeholders across other commands are prefixed with "e.g." to signal they're examples, not defaults. Removes misleading placeholders on optional contact name fields.
The fallback validators in requireText and promptForMissing rejected empty input before @clack/prompts could apply the defaultValue. Now the required check is skipped when a defaultValue is configured.
Extract fetchVerifiedDomains and promptForFromAddress into shared src/lib/domains.ts and reuse in broadcasts create, matching the existing emails send UX.
defaultValue doesn't work with custom validators since @clack/prompts runs validate before applying the default.
Keep the simple @ check and let the API handle domain validation.
c630bd4 to
372b571
Compare
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
defaultValuesupport to shared prompt helpers (requireText,promptForMissing) and fix validation bug that rejected empty input beforedefaultValuecould applydefaultValueinemails sendso first-time users can press Enter through all prompts and send a working test email todelivered@resend.devJane/Smithplaceholders on optional contact name fieldsfetchVerifiedDomains,promptForFromAddress) into sharedsrc/lib/domains.tsand reuse inbroadcasts createnoreplyandhello+ "Custom address..."