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: making donut having a loading state #5844
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
I think we should still show the title during loading, otherwise I wonder why there are two spinners and have to hover over to see their purpose. |
Signed-off-by: axel7083 <[email protected]>
@deboer-tim Here is an updated version displaying the provided
loading-donut.mp4 |
stroke-width="3.5" | ||
d="{describeArc(size / 2, (percent * 360) / 100)}" | ||
data-testid="arc"></path> | ||
<g class:animate-spin="{loading}" class:origin-[50%_50%]="{loading}" style="transform-box: fill-box;"> |
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.
the transform-box: fill-box;
is not yet supported by tailwinds, ref tailwindlabs/tailwindcss#10982
Note that I was just suggesting the title was shown while loading, not value. :) This got me thinking though: why introduce a new exported loading property, where we could end up with cases like 'loading but value shown' or 'not loading but no value' vs just making the loading animation appear whenever the value isn't set (or perhaps is set to an invalid value)? |
Because I wanted to be backward compatible as some elements are using the Donut component. It is honestly pretty complicated for nothing, for example, why the donut is responsible of building the tooltip ( My personal thought: (1) It should act as a progress bar
Then, a wrapper component could be created to be used for resource usage etc. |
Donut isn't external API, so we only need to make sure we don't break existing places where it's used inside Podman Desktop - but we can always fix those references when we're improving the component. +1 to improving the way the tooltip works or changing title to label. The original issue didn't talk about using Donut as a general progress widget, and our designs normally use Spinner or LinearProgress for that. Can you point me at where/how it would be used? IMHO some kind of 'if (!value) then loading = true' would be a good improvement to make either way for most of our current use. |
What does this PR do?
Adding a loading state for the
Donut.svelte
component. This is backward compatible, as the loading state isfalse
by default.Screenshot / video of UI
See comments
What issues does this PR fix or reference?
Related to #5837
How to test this PR?