Let one pill pass through the bar until the transfer starts

Start, wait and retry used a gradient sweep and a pulse, which felt restless.
Now a solid pill passes through the bar at an even speed for all three, pink
while retrying, and the line below says the rest. The sender's waiting line
is shorter, the code's label already says to give it to the receiver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-26 19:28:45 +01:00
1 parent f7e8999439
commit d92c4b50cf
3 files changed
+32 -43

No files matched your search

+4
View File
@@ -334,7 +334,9 @@ function onReceive() {
</label>
<div v-if="side === 'send' && phase" :data-phase="phase">
<p v-if="shared !== file" id="send-file">{{ shared!.name }}</p>
<div>
<progress id="send-progress" max="100" :value="barValue(sent)" aria-label="Sent"></progress>
</div>
<p v-if="error" id="send-error" role="alert">{{ error }}</p>
<p v-else role="status">
<span id="send-status">{{ status!.text }}</span>
@@ -402,7 +404,9 @@ function onReceive() {
<template v-else>The sender's file shows up here after the security check</template>
</div>
<div v-if="side === 'receive' && phase" :data-phase="phase">
<div>
<progress id="receive-progress" max="100" :value="barValue(received)" aria-label="Received"></progress>
</div>
<p v-if="error" id="receive-error" role="alert">{{ error }}</p>
<p v-else role="status">
<span id="receive-status">{{ status!.text }}</span>
+1 -1
View File
@@ -980,7 +980,7 @@ export async function sendViaTracker(file: File, events: Events, signal: AbortSi
const waitForReceiver = () =>
failure
? events.status('retry', `${failure}. Waiting for the receiver to try again`)
: events.status('wait', 'Waiting for the receiver, give them the code');
: events.status('wait', 'Waiting for the receiver');
// Without a tracker no further receiver can find the share.
const stranded = () => !shared && !busy && !trackers.some((tracker) => tracker.alive());
+27 -42
View File
@@ -381,10 +381,9 @@ label strong,
overflow-wrap: anywhere;
}
/* How the session is doing, below the file on its side. The bar shows it by color and movement:
a sweep while it sets something up or connects, a slow pulse while someone has to act, a slower
sweep in the secondary color while it tries again after a failure. Then the transfer's progress,
green once done, muted once stopped, the secondary color for an error. The line below says what. */
/* How the session is doing, below the file on its side. Until the transfer starts a pill passes
through the bar, blue, or pink while it tries again after a failure. Then the transfer's progress,
green once done, muted once stopped, pink for an error. The line below says what. */
[data-phase] {
--bar: var(--color-primary);
@@ -434,18 +433,25 @@ label strong,
text-transform: uppercase;
}
progress {
width: 100%;
/* The track, the progress inside it fills it or, without a value, is the pill */
[data-phase] > div {
height: 0.5rem;
appearance: none;
border: none;
border-radius: 999px;
background: var(--color-input);
overflow: hidden;
}
progress {
display: block;
width: 100%;
height: 100%;
appearance: none;
border: none;
background: none;
}
progress::-webkit-progress-bar {
background: var(--color-input);
background: none;
}
progress::-webkit-progress-value {
@@ -456,52 +462,31 @@ progress::-moz-progress-bar {
background: var(--bar);
}
/* Without a value only the element's own background shows, the phase draws on it */
progress:indeterminate::-webkit-progress-bar {
background: transparent;
progress:indeterminate {
width: 25%;
border-radius: 999px;
background: var(--bar);
animation: pass 2584ms linear infinite;
}
progress:indeterminate::-moz-progress-bar {
background: transparent;
background: none;
}
[data-phase='start'] progress:indeterminate,
[data-phase='retry'] progress:indeterminate {
background:
linear-gradient(90deg, transparent, var(--bar), transparent) -70% 0 / 40% 100% no-repeat var(--color-input);
animation: sweep 1.2s ease-in-out infinite;
}
[data-phase='retry'] progress:indeterminate {
animation-duration: 2.4s;
}
[data-phase='wait'] progress:indeterminate {
background: var(--bar);
animation: pulse 1.6s ease-in-out infinite alternate;
}
@keyframes sweep {
to {
background-position-x: 170%;
}
}
@keyframes pulse {
/* Its own width is a quarter of the track's: from just before it to just past it */
@keyframes pass {
from {
opacity: 0.25;
translate: -100%;
}
to {
opacity: 0.7;
translate: 400%;
}
}
/* Still apart by color, the line below tells the rest */
@media (prefers-reduced-motion: reduce) {
[data-phase] progress:indeterminate {
background: color-mix(in srgb, var(--bar) 50%, var(--color-input));
progress:indeterminate {
translate: 150%;
animation: none;
}
}