Skip to content

Commit ecba17d

Browse files
dimas-amendesclaude
andcommitted
fix(setup): animate the progress bar at 0% so a slow download start isn't read as frozen
NCBI can take a while to begin streaming the 419 MB ClinVar file. The bar sat at a static 0% during that connect/first-bytes window, looking stuck. Treat pct<=0 (not just <0) as indeterminate and drop the inline width so the animated CSS actually shows. Applied to both the /setup page and the Settings download button. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent bb346a5 commit ecba17d

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

templates/settings.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,13 @@ <h3 class="card-title"><i class="ti ti-trash" style="color:var(--red)"></i> {{ t
223223
fetch('/api/setup/status').then(r => r.json()).then(s => {
224224
const it = s.items[key];
225225
if (it && fill) {
226-
const indet = it.pct < 0 && !it.done;
226+
// Animate at 0% too (connecting / first bytes), so a slow start
227+
// doesn't look frozen.
228+
const indet = !it.done && it.pct <= 0;
227229
const width = it.done ? 100 : (it.pct < 0 ? 0 : it.pct);
228230
fill.classList.toggle('indet', indet);
229-
fill.style.width = width + '%';
231+
// Clear inline width when indeterminate so the .indet CSS (40% + slide) animates.
232+
fill.style.width = indet ? '' : (width + '%');
230233
if (pct) {
231234
const ph = it.done ? '' : (PHASE_LABELS[it.phase] ? PHASE_LABELS[it.phase] + ' ' : '');
232235
pct.textContent = it.done ? '100%' : (indet ? '…' : ph + width + '%');

templates/setup.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,16 @@ <h1 class="page-title">{{ t.setup_title }}</h1>
193193
const wrap = document.getElementById('progress-wrap');
194194
let html = '';
195195
for (const [name, it] of Object.entries(items)) {
196-
const indet = it.pct < 0 && !it.done; // only when no percent
196+
// Animate at 0% too (connecting / first bytes / queued): a static 0% bar
197+
// reads as "frozen" while NCBI is slow to start the 419 MB transfer.
198+
const indet = !it.done && it.pct <= 0;
197199
const pct = it.done ? 100 : (it.pct < 0 ? 0 : it.pct);
198200
const phase = it.done ? '' : (PHASE_LABELS[it.phase] ? ' · ' + PHASE_LABELS[it.phase] : '');
199201
html += '<div class="prog-row">'
200202
+ '<div class="prog-label"><span>' + (LABELS[name] || name) + phase + '</span>'
201203
+ '<span>' + (it.done ? '100%' : (indet ? '…' : pct + '%')) + '</span></div>'
202204
+ '<div class="prog-bar"><div class="prog-fill ' + (indet ? 'indeterminate' : '')
203-
+ '" style="width:' + pct + '%"></div></div></div>';
205+
+ '"' + (indet ? '' : ' style="width:' + pct + '%"') + '></div></div></div>';
204206
}
205207
wrap.innerHTML = html;
206208
}

0 commit comments

Comments
 (0)