-
Notifications
You must be signed in to change notification settings - Fork 557
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
feat: add support to change spinner text using event updates #2944
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change allows to print event texts that will be removed when the spinner stops or when another event status update text is printed.
This is required so the event updates are cleared once another event update is received or when the spinner stops.
aljo242
reviewed
Oct 24, 2022
aljo242
reviewed
Oct 24, 2022
lumtis
reviewed
Oct 24, 2022
Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: Lucas Bertrand <[email protected]>
lumtis
previously approved these changes
Oct 24, 2022
aljo242
reviewed
Oct 28, 2022
aljo242
previously approved these changes
Oct 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just fix changelog and we can merge
aljo242
approved these changes
Oct 28, 2022
Jchicode
pushed a commit
to Jchicode/cli
that referenced
this pull request
Aug 9, 2023
…2944) * refactor: change `StartSpinner` option to receive an optional text * feat: add progress update support for events and session print loop This change allows to print event texts that will be removed when the spinner stops or when another event status update text is printed. * refactor: add `ProgressUpdate` to some of the events This is required so the event updates are cleared once another event update is received or when the spinner stops. * refactor: rename event progress options * feat: add `cliui.StartSpinnerWithText` option to session * test: add test for event update * chore: update changelog * chore: updated some network commands to use progress update * chore: review corrections Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: Lucas Bertrand <[email protected]> * chore: update changelog Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: Lucas Bertrand <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds spinner progress update to events for proper spinner interactions.
A spinner has a text next to the spinning animation which communicates the current status or progress. Once the spinner is started it can be updated to display a new text or stopped by using event options when sending the events though the event bus. There are three status update options:
The spinner and its current text are removed when a finish event is received thought the event bus and replaced by the finished event text.
Text that should not be removed must be printed directly using the
Session
instance, sent thought the event bus without theProgressStart
orProgressUpdate
options, or sent using a finish event.The PR also adds the new session option
StartSpinnerWithText
to start the spinner with a custom text to avoid an extra call tosession.StartSpinner()
right after the session is created.