Skip to content
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

fix(cli/unstable): hide cursor while showing the selection with promptSelect() #6221

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

timreichen
Copy link
Contributor

This PR moves the cursor to the selected line instead of always staying at the bottom.

@timreichen timreichen requested a review from kt3k as a code owner December 1, 2024 13:49
@github-actions github-actions bot added the cli label Dec 1, 2024
Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.52%. Comparing base (3d224fd) to head (f47c778).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cli/unstable_prompt_select.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6221   +/-   ##
=======================================
  Coverage   96.51%   96.52%           
=======================================
  Files         534      534           
  Lines       40967    40971    +4     
  Branches     6133     6133           
=======================================
+ Hits        39541    39548    +7     
+ Misses       1384     1381    -3     
  Partials       42       42           

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

@kt3k
Copy link
Member

kt3k commented Dec 2, 2024

The tools like npm:inquirer or npm:prompts seem hiding the cursor during selection prompts. That behavior makes more sense to me than moving cursor along with the marker because the users can't input text while selecting. What do you think?

@timreichen
Copy link
Contributor Author

The tools like npm:inquirer or npm:prompts seem hiding the cursor during selection prompts. That behavior makes more sense to me than moving cursor along with the marker because the users can't input text while selecting. What do you think?

Agree, this makes more sense. Updated.

@kt3k kt3k changed the title feat(cli): move promptSelect() cursor with selection fix(cli): hide cursor while showing the selection with promptSelect() Dec 3, 2024
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

Confirmed the cursor is now hidden. LGTM

@kt3k kt3k changed the title fix(cli): hide cursor while showing the selection with promptSelect() fix(cli/unstable): hide cursor while showing the selection with promptSelect() Dec 3, 2024
@kt3k kt3k merged commit 2c7d7d6 into denoland:main Dec 3, 2024
20 checks passed
@timreichen timreichen deleted the cli-promptSelect-cursor branch December 16, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants