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

Print spinners during backend interaction #123

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Print spinners during backend interaction #123

merged 2 commits into from
Oct 1, 2024

Conversation

nbrahms
Copy link
Contributor

@nbrahms nbrahms commented Oct 1, 2024

Currently, we provide no user feedback whilst we contact the P0 backend. This makes it difficult for the user to distinguish between waiting on a backend response and a hung process.

Use a yarn-style Unicode spinner to indicate that the process is still live.

Screen.Recording.2024-10-01.at.3.02.41.PM.mov

Currently, we provide no user feedback whilst we contact the P0 backend.
This makes it difficult for the user to distinguish between waiting on
a backend response and a hung process.

Use a yarn-style Unicode spinner to indicate that the process is still
live.
Copy link
Contributor

@komal-dhull komal-dhull left a comment

Choose a reason for hiding this comment

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

looks good, thanks!

@GGonryun
Copy link
Contributor

GGonryun commented Oct 1, 2024

This is coooooool! 🥳

export const spinUntil = async <T>(message: string, promise: Promise<T>) => {
let isDone = false;
let ix = 0;
void promise.finally(() => (isDone = true)).catch(() => {});
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we swallow errors here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The errors are thrown on line 77

@nbrahms nbrahms merged commit 91440e3 into main Oct 1, 2024
3 checks passed
@nbrahms nbrahms deleted the nathan/spinner branch October 1, 2024 23:43
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.

4 participants