Skip to content

fix(prompts): Fix dots loader in spinner #309

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

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

MacFJA
Copy link
Contributor

@MacFJA MacFJA commented Apr 28, 2025

Previously, the dots indicator (the ellipsis) were linked to the symbols used, 4 char (, , , )

The timing of the dots was one dot every 8 frame (+0.125 every frame, so a integer number every 8 frame) which was OK since we display 3 dots.

But now that the spinner frame char can be changed, this logic don't work anymore.

For example, if you have 10 spinner frames you will have (excluding non-integer number):


.
..
...
...
...
...
...
...
...

.
..
...
...
...

And if you have only 2 spinner frames :


.
..

.
..

This PR fix this by basing the dots indicator only on itself

Copy link

changeset-bot bot commented Apr 28, 2025

🦋 Changeset detected

Latest commit: 2cfe142

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clack/prompts Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

pkg-pr-new bot commented Apr 28, 2025

@example/basic@example/changesets

npm i https://pkg.pr.new/bombshell-dev/clack/@clack/core@309
npm i https://pkg.pr.new/bombshell-dev/clack/@clack/prompts@309

commit: 2cfe142

Copy link
Collaborator

@43081j 43081j left a comment

Choose a reason for hiding this comment

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

makes sense to me

can you add a changeset?

@MacFJA MacFJA force-pushed the fix/spinner-dot-loader branch from 47c6664 to 2cfe142 Compare April 29, 2025 19:23
@MacFJA
Copy link
Contributor Author

MacFJA commented Apr 29, 2025

makes sense to me

can you add a changeset?

Added !
(Sorry, I always forget it 😱 )

@MacFJA MacFJA requested a review from 43081j April 29, 2025 19:24
@43081j 43081j merged commit 2048eb1 into bombshell-dev:main Apr 29, 2025
5 checks passed
@MacFJA MacFJA deleted the fix/spinner-dot-loader branch April 29, 2025 20:03
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