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

[ui-components] Delayed, SpinnerWithText #20448

Merged
merged 1 commit into from
Mar 14, 2024
Merged

Conversation

hellendag
Copy link
Member

@hellendag hellendag commented Mar 13, 2024

Summary & Motivation

Extract a couple of our common loading-state UI patterns into ui-components.

  • Delayed, which uses useDelayedState to delay showing content. This is useful for delaying when we show a loading state, so that we don't flash it quickly when loading is fairly fast.
  • SpinnerWithText, to show a body-text spinner with a line of text.

How I Tested These Changes

Storybook, Jest.

Copy link
Member Author

hellendag commented Mar 13, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @hellendag and the rest of your teammates on Graphite Graphite

@hellendag hellendag requested review from bengotow and salazarm March 13, 2024 15:47
@hellendag hellendag marked this pull request as ready for review March 13, 2024 15:47
return () => clearTimeout(timer);
}, [delayMsec]);

return value;
return ready;
Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed this var because I found that it's not clear what "value" is supposed to mean.

Copy link

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-f6dk1www7-elementl.vercel.app
https://dish-delayed-loading.components-storybook.dagster-docs.io

Built with commit 8ade008.
This pull request is being automatically deployed with vercel-action

Copy link
Contributor

@salazarm salazarm left a comment

Choose a reason for hiding this comment

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

Code looks good.

Copy link
Member Author

hellendag commented Mar 14, 2024

Merge activity

@hellendag hellendag merged commit ff8d1bf into master Mar 14, 2024
2 checks passed
@hellendag hellendag deleted the dish/delayed-loading branch March 14, 2024 14:29
PedramNavid pushed a commit that referenced this pull request Mar 28, 2024
## Summary & Motivation

Extract a couple of our common loading-state UI patterns into ui-components.

- `Delayed`, which uses `useDelayedState` to delay showing content. This is useful for delaying when we show a loading state, so that we don't flash it quickly when loading is fairly fast.
- `SpinnerWithText`, to show a body-text spinner with a line of text.

## How I Tested These Changes

Storybook, Jest.
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