Skip to content

[codex] Fix confirm prompt default regression#78

Open
Oranquelui wants to merge 7 commits intogaureshpai:mainfrom
Oranquelui:codex/fix-confirm-prompt-defaults
Open

[codex] Fix confirm prompt default regression#78
Oranquelui wants to merge 7 commits intogaureshpai:mainfrom
Oranquelui:codex/fix-confirm-prompt-defaults

Conversation

@Oranquelui
Copy link
Copy Markdown

@Oranquelui Oranquelui commented Mar 29, 2026

Summary

  • avoid duplicating (default: ...) in confirm prompts when the message already includes a default suffix
  • normalize empty confirm answers to a boolean instead of returning raw string defaults
  • add regression coverage for both prompt behaviors

Root Cause

The previous fix switched confirm rendering from message to displayMessage, but some callers already embed (default: Yes) in the prompt text. That caused duplicated default text in the rendered confirm line. The confirm handler also returned the raw default value on empty input, which could leak string defaults instead of a boolean.

Validation

  • COREPACK_ENABLE_AUTO_PIN=0 pnpm exec biome check src/lib/prompts.js src/test/test.js
  • COREPACK_ENABLE_AUTO_PIN=0 pnpm test

Summary by CodeRabbit

  • Bug Fixes

    • Prevent duplicate "(default: ...)" in confirmation prompts.
    • Ensure empty submission resolves to the specified boolean default (string "false" now normalizes to false).
    • Improve selected Yes/No label display (redrawn on interactive terminals) for clearer feedback.
  • Tests

    • Added tests covering confirm prompt rendering, default annotation behavior, and boolean normalization.

itniuma2026 and others added 4 commits March 22, 2026 10:14
The Docker prompt's default value is not properly configured, causing it to display incorrectly when the user accepts the default. The default should be 'N' (No) and should be displayed/selected properly.

Fixes gaureshpai#74
The confirm prompts now display '(default: Yes)' or '(default: No)' text
in addition to the (Y/n) hint, making the default option much clearer.

Before: ? Do you want to use TypeScript? (Y/n)
After: ? Do you want to use TypeScript? (default: Yes) (Y/n)

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Make displayMessage use strict boolean check (defaultVal === true) to match confirmHint behavior and prevent contradictory hints when non-boolean truthy values are passed as defaultVal.
@coderabbitai

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

gaureshpai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@gaureshpai gaureshpai marked this pull request as ready for review March 31, 2026 12:14
@gaureshpai

This comment was marked as resolved.

@Oranquelui

This comment was marked as outdated.

@Oranquelui

This comment was marked as outdated.

@gaureshpai

This comment was marked as resolved.

@Oranquelui

This comment was marked as resolved.

@Oranquelui

This comment was marked as resolved.

@Oranquelui

This comment was marked as resolved.

@Oranquelui

This comment was marked as resolved.

@coderabbitai coderabbitai bot added the bug Something isn't working label Apr 14, 2026
coderabbitai[bot]

This comment was marked as resolved.

@Oranquelui

This comment was marked as resolved.

@Oranquelui

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@Oranquelui

This comment was marked as resolved.

@Oranquelui
Copy link
Copy Markdown
Author

Checked the latest status: all actual CI test jobs are green on this PR (Node 20.x/22.x across npm, pnpm, and yarn). The only failing status is CodeRabbit, and that failure is Review rate limit exceeded, not a test failure. The PR is still marked MERGEABLE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants