Skip to content

feat(@clack/prompts): add help on prompt #241

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MacFJA
Copy link
Contributor

@MacFJA MacFJA commented Feb 28, 2025

Add help/description option on:

  • text
  • password
  • confirm
  • select
  • multiselect
  • groupMultiselect
Screenshots

Image
Image
Image


  • The help text is display in dim and italic to differentiate from the placeholder
  • The help text doesn't appear on submitted prompt or canceled prompt

I'm not sure about the icon
Right now, the icon is

Other options were:
image


Fix #135 and #111

Copy link

changeset-bot bot commented Feb 28, 2025

⚠️ No Changeset found

Latest commit: 37198d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this! Looks great. I'm going to take another pass at the icon before merging.

@@ -27,6 +27,7 @@ const S_STEP_SUBMIT = s('◇', 'o');

const S_BAR_START = s('┌', 'T');
const S_BAR = s('│', '|');
const S_BAR_DETAIL = s('│ⓘ', `|${color.italic('i')}`);
Copy link
Member

Choose a reason for hiding this comment

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

Flagging this since I want to play with it locally and come up with a good indicator. Having an icon on the inside margin feels a bit off, but I don't know what will feel better just yet.

Thanks for including your explorations in the PR description!

@MacFJA
Copy link
Contributor Author

MacFJA commented Mar 19, 2025

I did some other test that don't use an icon at all:
image

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.

[Request] text: Add 'help' key to provide prompt description to the user
2 participants