Skip to content

Conversation

@Sakthieswaran-tech
Copy link
Contributor

@Sakthieswaran-tech Sakthieswaran-tech commented Oct 18, 2025

  1. Display questions when when returns { ask: false, display: true } without adding to answers.
  2. Fully skip questions when when returns { ask: false, display: false } or false.
  3. Added tests to cover these cases.

@codecov
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

❌ Patch coverage is 97.56098% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@31fc3ad). Learn more about missing BASE report.

Files with missing lines Patch % Lines
packages/inquirer/src/ui/skipped-renderer.ts 96.42% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1853   +/-   ##
=======================================
  Coverage        ?   95.72%           
=======================================
  Files           ?       46           
  Lines           ?     2876           
  Branches        ?      768           
=======================================
  Hits            ?     2753           
  Misses          ?      114           
  Partials        ?        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Sakthieswaran-tech Sakthieswaran-tech force-pushed the feature/display-skipped-questions branch 2 times, most recently from fe5866b to 7f04251 Compare October 18, 2025 11:41
@Sakthieswaran-tech
Copy link
Contributor Author

Hey @SBoudrias , I’ve added more test cases and all checks are passing. Could you take a look when you get a chance and let me know if anything needs changes?

Copy link
Owner

@SBoudrias SBoudrias left a comment

Choose a reason for hiding this comment

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

The PR is a little big, so I didn't review all of it in depth yet. Here's a few early thoughts to streamline the code a little.

confirm: (question: TypedQuestion) => {
const defaultVal = question.default;
const answerText = defaultVal === true ? 'Yes' : defaultVal === false ? 'No' : '';
const prefix = '?';
Copy link
Owner

Choose a reason for hiding this comment

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

This must be taken from the theme

const answerText = defaultVal === true ? 'Yes' : defaultVal === false ? 'No' : '';
const prefix = '?';
const line = `${prefix} ${question.message} ${answerText}`;
return colors.dim(line);
Copy link
Owner

Choose a reason for hiding this comment

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

This should also be based on the theme.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use the makeTheme() method for getting the prefix instead of hardcoding '?', and replaced dim with style.help

"run-async": "^4.0.5",
"rxjs": "^7.8.2"
"rxjs": "^7.8.2",
"yoctocolors-cjs": "^2.1.3"
Copy link
Owner

Choose a reason for hiding this comment

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

Let's match the version from other packages in the workspace.

README.md Outdated
@@ -1 +1 @@
packages/prompts/README.md
packages/prompts/README.md
Copy link
Owner

Choose a reason for hiding this comment

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

git checkout main -- README.md to undo this change.

Comment on lines 439 to 441
return { display, ask };
}
return Boolean(shouldRun);
Copy link
Owner

Choose a reason for hiding this comment

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

Let's normalize the return types so it's always consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Normalized the function to return {display, ask}.

Comment on lines 244 to 247
if (ask || display) {
return of({ question, ask });
}
return EMPTY;
Copy link
Owner

Choose a reason for hiding this comment

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

It's a little weird to read the code where we handle the skip here, and the rendering in the next event. Let's combine that logic in a single place.

@Sakthieswaran-tech Sakthieswaran-tech force-pushed the feature/display-skipped-questions branch from 3ecbfcd to 8e76e3c Compare October 27, 2025 16:25
@Sakthieswaran-tech Sakthieswaran-tech force-pushed the feature/display-skipped-questions branch from 8e76e3c to 5b30e81 Compare October 28, 2025 08:09
@Sakthieswaran-tech
Copy link
Contributor Author

Rebased with latest main.
Incorporated all the review changes (including normalization and theme updates).
The reviewed fixes are now part of the existing commits after rebase.

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