-
-
Notifications
You must be signed in to change notification settings - Fork 170
Loading animation for deployments #724
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
base: dev
Are you sure you want to change the base?
Conversation
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.
4 files reviewed, 1 comment
|
can you confirm this is working? |
|
Yes I have added a video in description of this pr which shows that the function is working |
|
here is mp4 video helix-spinner.mp4 |
|
@xav-db please take a look and let me know if anything is wrong here |
|
this is really nice |
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.
why are these print statements removed?
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.
sorry i forget to revert this change
xav-db
left a comment
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.
please also fix clippy
| if trimmed.is_empty() || trimmed.starts_with("//") { | ||
| continue; | ||
| // function that starts the spinner | ||
| pub fn start(&mut self) { |
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.
one point claude raised was there is no tty detection so spinner might emit escape codes. worth looking into adding:
if !std::io::stdout().is_terminal() {
return; // Skip animation for non-interactive terminals
}
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.
Done
Description
Added a spinner as sign of loading animation for deployments in CLI
Related Issues
#705
Closes #705
Checklist when merging to main
rustfmthelix-cli/Cargo.tomlandhelixdb/Cargo.tomlAdditional Notes
Here is a quick video
Screencast from 2025-11-25 14-25-14.webm
Greptile Overview
Greptile Summary
Implemented loading spinner animation for CLI deployment operations to address user feedback that the terminal appeared frozen during builds.
Key changes:
Spinnerstruct inutils.rswith async animation using tokiobuild.rspush.rswith provider-specific messagesdocker.rsto avoid interfering with spinnerImplementation details:
Arc<Mutex<String>>for thread-safe message updatesImportant Files Changed
File Analysis
Spinnerstruct with async animation loop using tokio, includes proper cleanup via Drop traitbuild_imagecall with start/stopbuild_image, delegating user feedback to spinner in calling codeSequence Diagram
sequenceDiagram participant User participant BuildCmd as build.rs participant PushCmd as push.rs participant Spinner participant Docker as docker.rs participant CloudProvider Note over User,CloudProvider: Build Command Flow User->>BuildCmd: helix build BuildCmd->>Spinner: new("DOCKER", "Building...") BuildCmd->>Spinner: start() activate Spinner Note right of Spinner: Tokio task spawned<br/>Animation loop running BuildCmd->>Docker: build_image() Docker-->>BuildCmd: Result BuildCmd->>Spinner: stop() deactivate Spinner Note right of Spinner: Task aborted<br/>Line cleared BuildCmd-->>User: Success message Note over User,CloudProvider: Push Command Flow (Cloud) User->>PushCmd: helix push PushCmd->>Spinner: new("BUILD", "Building instance...") PushCmd->>Spinner: start() activate Spinner PushCmd->>BuildCmd: run() BuildCmd->>Docker: build_image() Docker-->>BuildCmd: Result BuildCmd-->>PushCmd: MetricsData PushCmd->>Spinner: stop() deactivate Spinner PushCmd->>Spinner: new("DEPLOY", "Deploying instance...") PushCmd->>Spinner: start() activate Spinner PushCmd->>Spinner: update("Deploying to Fly.io/ECR/Helix...") Note right of Spinner: Message updates<br/>while animating PushCmd->>CloudProvider: deploy() CloudProvider-->>PushCmd: Result PushCmd->>Spinner: stop() deactivate Spinner PushCmd-->>User: Success message