Skip to content

fix: make interactive prompt placeholders behave like defaults or cla…#140

Merged
felipefreitag merged 9 commits intomainfrom
worktree-fix-placeholder-defaults
Mar 23, 2026
Merged

fix: make interactive prompt placeholders behave like defaults or cla…#140
felipefreitag merged 9 commits intomainfrom
worktree-fix-placeholder-defaults

Conversation

@felipefreitag
Copy link
Contributor

@felipefreitag felipefreitag commented Mar 20, 2026

Summary

  • Add defaultValue support to shared prompt helpers (requireText, promptForMissing) and fix validation bug that rejected empty input before defaultValue could apply
  • Use defaultValue in emails send so first-time users can press Enter through all prompts and send a working test email to delivered@resend.dev
  • Prefix ambiguous placeholders with "e.g." across commands (broadcasts, templates, segments, topics, contact-properties, api-keys) to clarify they're examples, not defaults
  • Remove misleading Jane/Smith placeholders on optional contact name fields
  • Extract verified domain picker (fetchVerifiedDomains, promptForFromAddress) into shared src/lib/domains.ts and reuse in broadcasts create
  • Trim from-address prefix options to noreply and hello + "Custom address..."

@felipefreitag felipefreitag requested a review from vcapretz March 20, 2026 18:38
@felipefreitag felipefreitag force-pushed the worktree-fix-placeholder-defaults branch from 4afd91e to fd52efc Compare March 20, 2026 18:53
@felipefreitag felipefreitag marked this pull request as draft March 20, 2026 19:22
@felipefreitag felipefreitag force-pushed the worktree-fix-placeholder-defaults branch from fd52efc to d4a18ea Compare March 20, 2026 19:49
@felipefreitag felipefreitag marked this pull request as ready for review March 20, 2026 19:57
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@felipefreitag felipefreitag force-pushed the worktree-fix-placeholder-defaults branch from c630bd4 to 372b571 Compare March 23, 2026 13:30
@felipefreitag felipefreitag merged commit 2f4ba39 into main Mar 23, 2026
6 checks passed
@felipefreitag felipefreitag deleted the worktree-fix-placeholder-defaults branch March 23, 2026 13:31
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.

2 participants