-
Notifications
You must be signed in to change notification settings - Fork 108
[web-console] Improve Samply profile download UX #5853
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <script lang="ts"> | ||
| import { Progress } from '@skeletonlabs/skeleton-svelte' | ||
| import { humanSize } from '$lib/functions/common/string' | ||
|
|
||
| const { | ||
| progress, | ||
| label | ||
| }: { | ||
| progress: { percent: number | null; bytes: { downloaded: number; total: number } } | ||
| label: string | ||
| } = $props() | ||
| </script> | ||
|
|
||
| <div class="flex flex-col items-center gap-3 py-4"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No "cancel" button?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cancel button is wired up in usage sites, this component focuses just on displaying the progress |
||
| <Progress class="h-1" value={progress.percent} max={100}> | ||
| <Progress.Track> | ||
| <Progress.Range class="bg-primary-500" /> | ||
| </Progress.Track> | ||
| </Progress> | ||
| <div class="flex w-full justify-between gap-2"> | ||
| <span>{label}</span> | ||
| {#if progress.bytes.downloaded > 0} | ||
| <span> | ||
| {humanSize(progress.bytes.downloaded)}{progress.bytes.total > 0 | ||
| ? ` / ${humanSize(progress.bytes.total)}` | ||
| : ''} | ||
| </span> | ||
| {/if} | ||
| </div> | ||
| </div> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New shared component with no tests. This is a behavior change — please add Vitest + @testing-library/svelte tests for |
||
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.
is total always known?
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.
I guess "0" means "unknown"
Uh oh!
There was an error while loading. Please reload this page.
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.
Not always. When the download response body is HTTP-compressed the total is not known, so I just show the number of downloaded bytes