Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: handle skipped questions in when with display option#1853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Sakthieswaran-tech wants to merge3 commits intoSBoudrias:main
base:main
Choose a base branch
Loading
fromSakthieswaran-tech:feature/display-skipped-questions

Conversation

@Sakthieswaran-tech
Copy link
Contributor

@Sakthieswaran-techSakthieswaran-tech commentedOct 18, 2025
edited
Loading

  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

codecovbot commentedOct 18, 2025
edited
Loading

Codecov Report

❌ Patch coverage is97.56098% with2 lines in your changes missing coverage. Please review.
⚠️ Pleaseupload report for BASE (main@7e6c3a2).Learn more about missing BASE report.

Files with missing linesPatch %Lines
packages/inquirer/src/ui/skipped-renderer.ts96.42%2 Missing⚠️
Additional details and impacted files
@@           Coverage Diff           @@##             main    #1853   +/-   ##=======================================  Coverage        ?   95.74%           =======================================  Files           ?       46             Lines           ?     2888             Branches        ?      773           =======================================  Hits            ?     2765             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-techSakthieswaran-techforce-pushed thefeature/display-skipped-questions branch 2 times, most recently fromfe5866b to7f04251CompareOctober 18, 2025 11:41
@Sakthieswaran-tech
Copy link
ContributorAuthor

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

@SBoudriasSBoudrias 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)=>{
constdefaultVal=question.default;
constanswerText=defaultVal===true ?'Yes' :defaultVal===false ?'No' :'';
constprefix='?';
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

constanswerText=defaultVal===true ?'Yes' :defaultVal===false ?'No' :'';
constprefix='?';
constline=`${prefix}${question.message}${answerText}`;
returncolors.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
ContributorAuthor

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.

Sakthieswaran-tech reacted with thumbs up emoji
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.

Sakthieswaran-tech reacted with thumbs up emoji
Comment on lines 439 to 441
return{ display, ask};
}
returnBoolean(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
ContributorAuthor

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){
returnof({ question, ask});
}
returnEMPTY;
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 reacted with thumbs up emoji
@Sakthieswaran-techSakthieswaran-techforce-pushed thefeature/display-skipped-questions branch from3ecbfcd to8e76e3cCompareOctober 27, 2025 16:25
@Sakthieswaran-techSakthieswaran-techforce-pushed thefeature/display-skipped-questions branch from8e76e3c to5b30e81CompareOctober 28, 2025 08:09
@Sakthieswaran-tech
Copy link
ContributorAuthor

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.

@Sakthieswaran-tech
Copy link
ContributorAuthor

Hi@SBoudrias , I’ve made the requested changes and resolved the conflicts. Please take a look when you have some time and let me know if I need to make any further changes. Thanks!

@Sakthieswaran-tech
Copy link
ContributorAuthor

Hi! Just checking in on this PR whenever you get a chance. Let me know if anything else is needed from my side.

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

Reviewers

@SBoudriasSBoudriasSBoudrias left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Sakthieswaran-tech@SBoudrias

[8]ページ先頭

©2009-2025 Movatter.jp