mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-18 18:04:17 +00:00
fix(ui): keep one thing moving while an update runs (#932)
* fix(ui): fetch each repository once when the dashboard updates skills Updating many skills from the Updates tab cloned the repository once per skill and reinstalled every one, so 31 skills from 8 repositories took over a minute where `skillshare update --all` takes 16 seconds, and unchanged skills were reported as updated. The update stream and the update-all endpoint now group the request's skills by repository and branch and go through install.UpdateSkillsFromRepo, as the CLI does. A skill that already matches upstream is left alone and reported as up to date; the Updates tab shows and counts it that way. Results still arrive in request order, which the dashboard relies on. Updating a single skill and switching its branch still reinstall. Those paths now also pass the configured parse options to the installer. * fix(ui): keep one thing moving while an update runs An update showed a spinner in the status card, a progress bar, a spinner on the active row and a moving line under it, all at once. The bar also sat empty while a repository was fetched, and was removed in the same render as the last result, so it never reached the end. The bar is now one shared component. A faint runner shows work before the first item finishes, the fill moves with a transform, and when the run ends it reaches the end, holds, then fades and gives its space back. The status card icon stays still and ends with a check that draws itself. The active row is marked by a light sweeping its status text instead of a spinner and a line. Backup, install from config, the plugin update dialog and pending Doctor checks follow the same rule.
This commit is contained in:
+40
-10
@@ -282,20 +282,44 @@ svg.lucide { flex: none; stroke-width: var(--isw); }
|
||||
.ss-list.stick { overflow: clip; }
|
||||
.ss-list.stick>.ss-lh { position: sticky; top: var(--stick, 0px); z-index: 3; }
|
||||
.ss-list.stick>.ss-gh { position: sticky; top: calc(var(--stick, 0px) + 34px); z-index: 2; }
|
||||
/* Update progress: a bar on the status card, a moving line under the row being updated, and a pop when a row finishes */
|
||||
.ss-update-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--sunken); color: var(--ink); }
|
||||
/* Update progress: a bar on the status card, a light that sweeps the status text of the row being updated, and a pop when a row finishes.
|
||||
Those two are the only things that keep moving; icons stay still. */
|
||||
.ss-update-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--sunken); color: var(--ink); transition: background-color .3s, color .3s; }
|
||||
.ss-update-icon.ok { background: var(--ok-bg); color: var(--ok); }
|
||||
.ss-update-icon.warn { background: var(--warn-bg); color: var(--warn); }
|
||||
.ss-bar { position: relative; height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
|
||||
.ss-bar>span { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .45s cubic-bezier(.3,.7,.3,1); }
|
||||
.ss-bar.indet>span { width: 35%; animation: ss-indet 1.1s ease-in-out infinite; }
|
||||
/* ProgressBar.tsx: ::before is a faint runner that shows work even at zero, <i> the fill that covers it. */
|
||||
.ss-bar { position: relative; display: block; height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; transition: opacity .2s ease-out; }
|
||||
.ss-bar::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; border-radius: inherit; background: var(--ink); opacity: .18; transition: opacity .2s ease-out; animation: ss-indet 1.8s ease-in-out infinite; }
|
||||
.ss-bar>i { position: absolute; inset: 0; border-radius: inherit; background: var(--ink); transition: transform .45s cubic-bezier(.3,.7,.3,1); }
|
||||
/* Nothing to count: the runner alone, at full strength. */
|
||||
.ss-bar.indet::before { width: 35%; opacity: 1; }
|
||||
/* Ended: the runner stops, the fill gets .6s to arrive and be seen, then the bar fades and its slot closes. */
|
||||
.ss-bar.end { opacity: 0; transition-delay: .6s; }
|
||||
.ss-bar.end::before { opacity: 0; animation: none; }
|
||||
.ss-bar.indet.end { transition-delay: 0s; }
|
||||
.ss-barslot { display: grid; grid-template-rows: 1fr; margin-top: calc(-1 * var(--bar-gap, 0px)); transition: grid-template-rows .25s cubic-bezier(.3,.7,.3,1); }
|
||||
.ss-barslot>span { display: block; min-height: 0; overflow: hidden; }
|
||||
.ss-barslot .ss-bar { margin-top: var(--bar-gap, 0px); }
|
||||
/* First in its column: the gap it takes back is the one below it. */
|
||||
.ss-barslot.lead { margin-top: 0; margin-bottom: calc(-1 * var(--bar-gap, 0px)); }
|
||||
.ss-barslot.lead .ss-bar { margin-top: 0; margin-bottom: var(--bar-gap, 0px); }
|
||||
.ss-barslot.shut { grid-template-rows: 0fr; transition-delay: .8s; }
|
||||
.ss-barslot.shut:has(.indet) { transition-delay: .2s; }
|
||||
/* A row status that is under way: an ink dot, no spinner. */
|
||||
.ss-st.on { font-weight: 600; }
|
||||
.ss-st.on::before { background: var(--ink); }
|
||||
.ss-r.dim .nm { color: var(--ink-3); }
|
||||
.ss-r.updating { background: var(--sunken); }
|
||||
.ss-rowbar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; }
|
||||
.ss-rowbar::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: var(--ink); animation: ss-indet 1s ease-in-out infinite; }
|
||||
/* Text of something under way: a light sweeps across it, in step with the bar's runner. */
|
||||
.ss-shimmer { background: linear-gradient(90deg, var(--ink-2) 0 40%, var(--ink) 50%, var(--ink-2) 60% 100%) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ss-shimmer 1.8s linear infinite; }
|
||||
.ss-r.flash { animation: ss-flash 1.1s ease-out; }
|
||||
.ss-pop { animation: ss-pop .32s cubic-bezier(.22,.9,.24,1); }
|
||||
@keyframes ss-indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
|
||||
/* DrawnCheck.tsx: the check that ends a run draws itself once. */
|
||||
.ss-draw path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ss-draw .32s cubic-bezier(.23,1,.32,1) .12s forwards; }
|
||||
@keyframes ss-draw { to { stroke-dashoffset: 0; } }
|
||||
@keyframes ss-indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
|
||||
@keyframes ss-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
|
||||
@keyframes ss-breathe { 0%, 100% { opacity: .08; } 50% { opacity: .24; } }
|
||||
@keyframes ss-flash { from { background: var(--ok-bg); } to { background: transparent; } }
|
||||
@keyframes ss-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
|
||||
/* Collapse a block to nothing: wrap it in .ss-collapse and add .shut */
|
||||
@@ -316,8 +340,14 @@ svg.lucide { flex: none; stroke-width: var(--isw); }
|
||||
.ss-note.ok>svg { color: var(--ok); }
|
||||
.ss-note.live { position: relative; overflow: hidden; transition: background .45s; }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ss-bar.indet>span, .ss-rowbar::after, .ss-r.flash, .ss-pop { animation: none; }
|
||||
.ss-bar>span, .ss-prog i, .ss-collapse, .ss-collapse .ss-r, .ss-note.live { transition: none; }
|
||||
.ss-r.flash, .ss-pop { animation: none; }
|
||||
.ss-shimmer { background: none; color: var(--ink); animation: none; }
|
||||
/* Nothing travels: the track breathes instead, and the fill steps. */
|
||||
.ss-bar:not(.end)::before { width: 100%; animation: ss-breathe 1.4s ease-in-out infinite; }
|
||||
.ss-draw path { stroke-dashoffset: 0; animation: none; }
|
||||
/* The slot keeps its delay, so the finished bar is still seen before it goes. */
|
||||
.ss-barslot { transition-duration: 0s; }
|
||||
.ss-bar>i, .ss-prog i, .ss-collapse, .ss-collapse .ss-r, .ss-note.live { transition: none; }
|
||||
}
|
||||
.ss-note { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
|
||||
:root[data-theme="playful"] .ss-note { border: 2px solid var(--line); border-radius: 12px; }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { CSSProperties, ReactNode } from 'react';
|
||||
import { Check, CircleAlert, Download, FolderDown, GitBranch, Loader2, Puzzle, X } from 'lucide-react';
|
||||
import { Check, CircleAlert, Download, FolderDown, GitBranch, Puzzle, X } from 'lucide-react';
|
||||
import Button from './Button';
|
||||
import ProgressBar from './ProgressBar';
|
||||
import { parseRemoteURL } from '../lib/parseRemoteURL';
|
||||
import { plural, useT } from '../i18n';
|
||||
import { useInstallFromConfig } from '../hooks/useInstallFromConfig';
|
||||
@@ -20,7 +21,7 @@ export default function ConfigInstallPanel() {
|
||||
let sub = t('install.fromConfig.hint', { items: contents });
|
||||
let action: ReactNode = <Button variant="primary" size="sm" onClick={run}><Download size={14} />{t('install.fromConfig.installAll')}</Button>;
|
||||
if (phase === 'running') {
|
||||
icon = <Loader2 size={16} className="animate-spin" />;
|
||||
icon = <Download size={16} />;
|
||||
title = t('install.fromConfig.installing', { file });
|
||||
sub = t('install.audited');
|
||||
action = null;
|
||||
@@ -49,7 +50,7 @@ export default function ConfigInstallPanel() {
|
||||
</div>
|
||||
{action}
|
||||
</div>
|
||||
{phase === 'running' && <div className="ss-bar indet animate-fade-in" role="progressbar" aria-label={title}><span /></div>}
|
||||
<ProgressBar active={phase === 'running'} label={title} className="[--bar-gap:8px]" />
|
||||
<div className="ss-list !shadow-none">
|
||||
<div className="max-h-[164px] overflow-y-auto">
|
||||
{entries.map((e, i) => {
|
||||
@@ -64,12 +65,10 @@ export default function ConfigInstallPanel() {
|
||||
{e.tracked && <span className="ss-tag">tracked</span>}
|
||||
<span className="min-w-0 flex-1 truncate font-mono text-xs text-ink-3">{parseRemoteURL(e.source)?.ownerRepo ?? e.source}</span>
|
||||
<span className="w-5 grid place-items-center">
|
||||
{phase === 'running' && <Loader2 size={14} className="animate-spin text-ink-3" />}
|
||||
{done && (bad
|
||||
? <X size={15} strokeWidth={2.6} className="ss-pop text-bad" style={stagger(i)} />
|
||||
: <Check size={15} strokeWidth={2.6} className="ss-pop text-ok" style={stagger(i)} />)}
|
||||
</span>
|
||||
{phase === 'running' && <span className="ss-rowbar" aria-hidden />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/** The check that ends a run: drawn once, short arm first. Lucide's path runs the other way. */
|
||||
export default function DrawnCheck({ size = 20 }: { size?: number }) {
|
||||
return (
|
||||
<svg className="ss-draw" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.6} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
||||
<path d="M4 12l5 5L20 6" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
/**
|
||||
* Progress of a job on its status card. A faint runner shows work is going on even before the
|
||||
* first item finishes; without a `value` the runner is all there is. When the job ends the fill
|
||||
* is given time to arrive, then the bar fades and its slot closes, so it never needs unmounting.
|
||||
* `className` sets `--bar-gap` to the parent's gap, which the closed slot then takes back.
|
||||
*/
|
||||
export default function ProgressBar({ active, value, max = 100, label, className = '' }: {
|
||||
active: boolean; value?: number; max?: number; label?: string; className?: string;
|
||||
}) {
|
||||
// A new run gets a new bar, so its fill starts empty instead of sliding back from the last run.
|
||||
const [run, setRun] = useState(0);
|
||||
const [was, setWas] = useState(active);
|
||||
if (was !== active) {
|
||||
setWas(active);
|
||||
if (active) setRun(run + 1);
|
||||
}
|
||||
// What kind of bar it was is kept while it leaves; a caller often drops `value` in the same render.
|
||||
const [counted, setCounted] = useState(value !== undefined);
|
||||
if (active && counted !== (value !== undefined)) setCounted(value !== undefined);
|
||||
const part = counted && max > 0 ? Math.min(Math.max((value ?? 0) / max, 0), 1) : 0;
|
||||
return (
|
||||
<span className={`ss-barslot ${active ? '' : 'shut'} ${className}`} aria-hidden={!active || undefined}>
|
||||
<span>
|
||||
<span key={run} className={`ss-bar ${counted ? '' : 'indet'} ${active ? '' : 'end'}`} role="progressbar"
|
||||
aria-label={label} aria-valuemin={0} aria-valuemax={max} aria-valuenow={counted ? value : undefined}>
|
||||
{counted && <i style={{ transform: `translateX(${(part - 1) * 100}%)` }} />}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
import { useState } from 'react';
|
||||
import { Check, CircleAlert, CircleArrowUp, Loader2, Package, X } from 'lucide-react';
|
||||
import { Check, CircleAlert, CircleArrowUp, Package, X } from 'lucide-react';
|
||||
import { targetMap } from '../../api/plugins';
|
||||
import type { PluginInventory, PluginPlan, PluginTarget } from '../../api/plugins';
|
||||
import AgentIcon from '../AgentIcon';
|
||||
import Button from '../Button';
|
||||
import { Checkbox } from '../Checkbox';
|
||||
import DialogShell from '../DialogShell';
|
||||
import DrawnCheck from '../DrawnCheck';
|
||||
import IconButton from '../IconButton';
|
||||
import ProgressBar from '../ProgressBar';
|
||||
import { plural, useT } from '../../i18n';
|
||||
import { keyedMessage } from './outcomeText';
|
||||
import { Toggle, VersionChange } from './PluginList';
|
||||
@@ -176,7 +178,7 @@ function Running({ batch, busy, inventory, label, onRetry, onStop, onClose }: {
|
||||
const settled = batch.filter((i) => i.status !== 'waiting' && i.status !== 'running').length;
|
||||
const current = batch.find((i) => i.status === 'running');
|
||||
const status = (item: BatchItem) => {
|
||||
if (item.status === 'running') return <span className="inline-flex items-center gap-2 text-[13px] font-semibold text-ink"><Loader2 size={13} className="animate-spin" />{t('plugins.updateDialog.updating')}</span>;
|
||||
if (item.status === 'running') return <span className="ss-st on ss-shimmer">{t('plugins.updateDialog.updating')}</span>;
|
||||
if (item.status === 'waiting') return <span className="text-[13px] text-ink-3">{t('plugins.updateDialog.waiting')}</span>;
|
||||
if (item.status === 'done') return <span className="inline-flex items-center gap-1.5 text-[13px] font-semibold text-ok"><Check size={15} strokeWidth={2.6} className="ss-pop" />{t('plugins.updateDialog.done')}</span>;
|
||||
if (item.status === 'skipped') return <span className="ss-st warn">{t('plugins.outcome.skipped')}</span>;
|
||||
@@ -185,15 +187,13 @@ function Running({ batch, busy, inventory, label, onRetry, onStop, onClose }: {
|
||||
return (
|
||||
<>
|
||||
{busy
|
||||
? <Hero icon={<Loader2 size={20} className="animate-spin" />} busy={busy} onClose={onClose} sub={t('plugins.updateDialog.runningHelp')}
|
||||
? <Hero icon={<CircleArrowUp size={20} />} busy={busy} onClose={onClose} sub={t('plugins.updateDialog.runningHelp')}
|
||||
title={<>{t('plugins.updateDialog.running', { done: Math.min(settled + 1, batch.length), total: batch.length })}{current && <span className="ml-3 font-mono text-[14px] font-medium text-ink-2">{current.name}</span>}</>} />
|
||||
: failed > 0
|
||||
? <Hero icon={<CircleAlert size={20} />} tone="warn" busy={busy} onClose={onClose} title={t('plugins.updateDialog.doneFailed', { updated: done, failed })} sub={t('plugins.updateDialog.doneHelp')} />
|
||||
: <Hero icon={<Check size={20} strokeWidth={2.6} className="ss-pop" />} tone="ok" busy={busy} onClose={onClose} title={t(plural('plugins.updateDialog.updated', done), { count: done })} sub={t('plugins.updateDialog.doneHelp')} />}
|
||||
: <Hero icon={<DrawnCheck />} tone="ok" busy={busy} onClose={onClose} title={t(plural('plugins.updateDialog.updated', done), { count: done })} sub={t('plugins.updateDialog.doneHelp')} />}
|
||||
<div className="db flex flex-col gap-4 overflow-y-auto">
|
||||
<div className="ss-bar" role="progressbar" aria-valuemin={0} aria-valuemax={batch.length} aria-valuenow={settled} aria-label={t('plugins.updateDialog.title')}>
|
||||
<span style={{ width: `${(settled / batch.length) * 100}%` }} />
|
||||
</div>
|
||||
<ProgressBar active={busy} value={settled} max={batch.length} label={t('plugins.updateDialog.title')} className="lead [--bar-gap:16px]" />
|
||||
<div className="ss-list">
|
||||
{batch.map((item) => {
|
||||
// A row no check showed keeps the version it has.
|
||||
@@ -213,7 +213,6 @@ function Running({ batch, busy, inventory, label, onRetry, onStop, onClose }: {
|
||||
</span>
|
||||
<span className="shrink-0 self-center whitespace-nowrap">{status(item)}</span>
|
||||
{(item.status === 'failed' || item.status === 'skipped') && !item.stale && !busy && <Button size="sm" variant="secondary" className="self-center" onClick={() => onRetry(item)}>{t('plugins.updateDialog.retry')}</Button>}
|
||||
{item.status === 'running' && <span className="ss-rowbar" aria-hidden />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -11,6 +11,7 @@ import ConfirmDialog from '../components/ConfirmDialog';
|
||||
import DialogShell from '../components/DialogShell';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import PageHeader from '../components/PageHeader';
|
||||
import ProgressBar from '../components/ProgressBar';
|
||||
import { Select } from '../components/Select';
|
||||
import Skeleton from '../components/Skeleton';
|
||||
import Spinner from '../components/Spinner';
|
||||
@@ -173,7 +174,7 @@ function FolderBackups({ creating }: { creating: boolean }) {
|
||||
<div className="ss-note" role="status">
|
||||
<span className="flex flex-1 flex-col gap-2">
|
||||
<span>{t('backup.creating')}</span>
|
||||
<span className="ss-bar indet"><span /></span>
|
||||
<ProgressBar active />
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { AlertTriangle, ArrowUpCircle, CheckCircle2, ChevronDown, ChevronRight, Info, Loader2, Pencil, RefreshCw, XCircle } from 'lucide-react';
|
||||
import { AlertTriangle, ArrowUpCircle, CheckCircle2, ChevronDown, ChevronRight, CircleDashed, Info, Pencil, RefreshCw, XCircle } from 'lucide-react';
|
||||
import { api, type DoctorCheck } from '../api/client';
|
||||
import Button from '../components/Button';
|
||||
import CopyButton from '../components/CopyButton';
|
||||
@@ -22,8 +22,8 @@ import { doctorFromChecks, doctorWithUpdatePolicy, withStreamedCheck } from '../
|
||||
type Filter = 'all' | 'error' | 'warning' | 'pass';
|
||||
|
||||
const FILTERS: Filter[] = ['all', 'error', 'warning', 'pass'];
|
||||
const ICON = { pass: CheckCircle2, warning: AlertTriangle, error: XCircle, info: Info, pending: Loader2 } as const;
|
||||
const TONE = { pass: 'text-ok', warning: 'text-warn', error: 'text-bad', info: 'text-accent', pending: 'animate-spin text-ink-3' } as const;
|
||||
const ICON = { pass: CheckCircle2, warning: AlertTriangle, error: XCircle, info: Info, pending: CircleDashed } as const;
|
||||
const TONE = { pass: 'text-ok', warning: 'text-warn', error: 'text-bad', info: 'text-accent', pending: 'text-ink-3' } as const;
|
||||
|
||||
/** Check names come from the CLI; a missing translation still reads as a phrase. */
|
||||
const checkLabel = (name: string) => name.replace(/_/g, ' ').replace(/^./, (c) => c.toUpperCase());
|
||||
|
||||
+12
-17
@@ -1,7 +1,7 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import type { CSSProperties, ReactNode } from 'react';
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { Bot, Check, CircleAlert, CircleArrowUp, CircleCheck, Download, FolderX, GitBranch, Link, Loader2, Puzzle, RefreshCw, ShieldAlert, Trash2, X } from 'lucide-react';
|
||||
import { Bot, Check, CircleAlert, CircleArrowUp, CircleCheck, Download, FolderX, GitBranch, Link, Puzzle, RefreshCw, ShieldAlert, Trash2, X } from 'lucide-react';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
import { resourceHref } from '../lib/resourceNames';
|
||||
import { api } from '../api/client';
|
||||
@@ -13,6 +13,8 @@ import { folderOf, formatTrackedRepoName } from '../lib/resourceNames';
|
||||
import { repoOf } from '../lib/resourceGrouping';
|
||||
import { formatRelativeTime, plural, useI18n, useT } from '../i18n';
|
||||
import Button from '../components/Button';
|
||||
import DrawnCheck from '../components/DrawnCheck';
|
||||
import ProgressBar from '../components/ProgressBar';
|
||||
import { Checkbox } from '../components/Checkbox';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import SyncPreviewModal from '../components/SyncPreviewModal';
|
||||
@@ -434,7 +436,7 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
const c = unitCheck(statuses, unit);
|
||||
switch (c.status) {
|
||||
case 'checking':
|
||||
return <span className="inline-flex items-center gap-2 text-[13px] text-ink-3"><Loader2 size={13} className="animate-spin" />{t('update.check.checking')}</span>;
|
||||
return <span className="ss-st off">{t('update.check.checking')}</span>;
|
||||
case 'behind':
|
||||
return <span className="ss-st warn">{c.behind ? t('update.check.behind', { count: c.behind }) : t('update.check.behindFallback')}</span>;
|
||||
case 'update-available':
|
||||
@@ -465,7 +467,7 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
case 'pending':
|
||||
return <span className="ss-st off">{t('update.status.pending')}</span>;
|
||||
case 'in-progress':
|
||||
return <span className="inline-flex items-center gap-2 text-[13px] font-semibold text-ink"><Loader2 size={13} className="animate-spin" />{r.message ?? t('update.status.updating')}</span>;
|
||||
return <span className="ss-st on ss-shimmer">{r.message ?? t('update.status.updating')}</span>;
|
||||
case 'success':
|
||||
return <span className="inline-flex items-center gap-1.5 text-[13px] font-semibold text-ok"><Check size={15} strokeWidth={2.6} className="ss-pop" />{t('update.status.updated')}</span>;
|
||||
case 'up-to-date':
|
||||
@@ -515,10 +517,10 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
|
||||
let hero: { icon: ReactNode; tone: string; title: ReactNode; sub: ReactNode };
|
||||
if (checking) {
|
||||
hero = { icon: <Loader2 size={20} className="animate-spin" />, tone: '', title: t('update.tab.checking'), sub: t('update.tab.audited') };
|
||||
hero = { icon: <CircleArrowUp size={20} />, tone: '', title: t('update.tab.checking'), sub: t('update.tab.audited') };
|
||||
} else if (running) {
|
||||
hero = {
|
||||
icon: <Loader2 size={20} className="animate-spin" />,
|
||||
icon: <CircleArrowUp size={20} />,
|
||||
tone: '',
|
||||
title: <>{t('update.hero.running', { current: Math.min(runDone + 1, run.size), total: run.size })}{current && <span className="ml-3 font-mono text-[14px] font-medium text-ink-2">{current.label}</span>}</>,
|
||||
sub: tallyText || t('update.tab.audited'),
|
||||
@@ -526,7 +528,7 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
} else if (showDone) {
|
||||
const troubled = tally.blocked + tally.error > 0;
|
||||
hero = {
|
||||
icon: troubled ? <CircleAlert size={20} /> : <Check size={20} strokeWidth={2.6} className="ss-pop" />,
|
||||
icon: troubled ? <CircleAlert size={20} /> : <DrawnCheck />,
|
||||
tone: troubled ? 'warn' : 'ok',
|
||||
title: <>{t('update.done.subtitle')} {tallyText}</>,
|
||||
sub: !checkSync || diff.isError ? t('update.tab.audited')
|
||||
@@ -583,11 +585,7 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
<Button variant="secondary" size="sm" onClick={() => void diff.refetch()}>{t('syncPreview.retryButton')}</Button>
|
||||
</div>
|
||||
)}
|
||||
{busy && (
|
||||
<div className={`ss-bar ${checking ? 'indet' : ''}`} role="progressbar" aria-valuemin={0} aria-valuemax={run.size} aria-valuenow={checking ? undefined : runDone}>
|
||||
<span style={checking ? undefined : { width: `${run.size ? (runDone / run.size) * 100 : 0}%` }} />
|
||||
</div>
|
||||
)}
|
||||
<ProgressBar active={busy} value={checking ? undefined : runDone} max={run.size} label={checking ? t('update.tab.checking') : t('update.status.updating')} className="[--bar-gap:16px]" />
|
||||
</section>
|
||||
)}
|
||||
|
||||
@@ -597,12 +595,12 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
return (
|
||||
<div className={`ss-collapse ${missing.phase === 'closing' ? 'shut' : ''}`}>
|
||||
<div className={`ss-note live items-center ${done && !failed ? 'ok' : 'warn'}`} aria-live="polite">
|
||||
{missing.phase === 'running' ? <Loader2 size={16} className="animate-spin" />
|
||||
{missing.phase === 'running' ? <Download size={16} />
|
||||
: done ? (failed ? <CircleAlert size={16} className="ss-pop" /> : <Check size={16} strokeWidth={2.6} className="ss-pop" />)
|
||||
: <FolderX size={16} />}
|
||||
<div key={missing.phase} className="flex-1 min-w-0 animate-fade-in">
|
||||
{missing.phase === 'running' ? (
|
||||
<><b>{t('install.fromConfig.installing', { file: missing.file })}</b> {t('install.audited')}</>
|
||||
<><b className="ss-shimmer">{t('install.fromConfig.installing', { file: missing.file })}</b> {t('install.audited')}</>
|
||||
) : done ? (
|
||||
<><b>{summary}.</b> {t(failed ? 'install.fromConfig.failedHint' : 'install.fromConfig.syncHint', { file: missing.file })}</>
|
||||
) : (
|
||||
@@ -618,7 +616,6 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
<Download size={14} />{t(done ? 'install.preview.retry' : 'update.missingEntries.install')}
|
||||
</Button>
|
||||
)}
|
||||
{missing.phase === 'running' && <span className="ss-rowbar" aria-hidden />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -652,7 +649,7 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
{unitName(unit)}
|
||||
<div className="w-full flex flex-wrap items-center gap-2 pl-[38px] md:contents">
|
||||
{p ? (
|
||||
<span className="inline-flex items-center gap-2 text-[13px] text-ink-2 animate-fade-in"><Loader2 size={13} className="animate-spin" />{t('update.updating.purging')}</span>
|
||||
<span className="ss-st on ss-shimmer">{t('update.updating.purging')}</span>
|
||||
) : (
|
||||
<>
|
||||
<span className="ss-st warn">{t('update.check.stale')}</span>
|
||||
@@ -660,7 +657,6 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{p && <span className="ss-rowbar" aria-hidden />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -780,7 +776,6 @@ export default function UpdatePage({ kind }: { kind: Kind }) {
|
||||
)}
|
||||
<span className="max-w-full md:max-w-none md:min-w-[140px] md:shrink-0 flex justify-end ml-auto md:ml-0">{statusCell(unit)}</span>
|
||||
</div>
|
||||
{rowState === 'updating' && <span className="ss-rowbar" aria-hidden />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user