Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(standalone/setup): improve layout & design of sync in progress
Elian Dorandd67710b1228
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.cssindex a567f8f1b9..2361b136a7 100644--- a/apps/client/src/setup.css+++ b/apps/client/src/setup.css@@ -238,6 +238,39 @@ body.setup {animation-name: slide-in-left;}+.page.sync-in-progress {+ .sync-progress {+ margin-top: 0.5rem;+ display: flex;+ align-items: center;+ gap: 0.5rem;++ progress {+ width: 100%;+ height: 1rem;+ border-radius: 0.5rem;+ overflow: hidden;+ appearance: none;++ &::-webkit-progress-bar {+ background-color: var(--main-border-color);+ }++ &::-webkit-progress-value {+ background-color: var(--main-text-color);+ transition: width 0.2s ease-out;+ }+ }++ span {+ font-size: 0.85rem;+ color: var(--muted-text-color);+ min-width: 2.5em;+ text-align: right;+ }+ }+}+@keyframes slide-out-left {from { transform: translateX(0); opacity: 1; }to { transform: translateX(-100%); opacity: 0; }diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsxindex 6615f11129..fb247ca58c 100644--- a/apps/client/src/setup.tsx+++ b/apps/client/src/setup.tsx@@ -33,7 +33,7 @@ function renderState(state: State, setState: (state: State) => void) {case "createNewDocument": return <CreateNewDocument />;case "syncFromServer": return <SyncFromServer setState={setState} />;case "syncFromDesktop": return <SyncFromDesktop setState={setState} />;- case "syncInProgress": return <SyncInProgress />;+ case "syncInProgress": return <SyncInProgress device="server" />;default: return null;}}@@ -121,7 +121,7 @@ function getSyncStep(stats: { outstandingPullCount: number; totalPullCount: numbreturn "connecting";}-function SyncInProgress() {+function SyncInProgress({ device }: { device: "server" | "desktop" }) {const stats = useOutstandingSyncInfo();const step = getSyncStep(stats);@@ -145,22 +145,25 @@ function SyncInProgress() {return (<div class="page sync-in-progress">+ <SyncIllustration targetDevice={device} /><h1>{t("setup.sync-in-progress-title")}</h1>- <ol class="sync-steps">- {steps.map((s, i) => (- <li class={i < currentIndex ? "completed" : i === currentIndex ? "active" : ""} key={s.key}>- <Icon icon={i < currentIndex ? "bx bx-check-circle" : i === currentIndex ? "bx bx-loader-circle" : "bx bx-circle"} />{" "}- {s.label}- {s.key === "syncing" && step === "syncing" && (- <div class="sync-progress">- <progress value={stats.totalPullCount! - stats.outstandingPullCount} max={stats.totalPullCount!} />- <span>{progress}%</span>- </div>- )}- </li>- ))}- </ol>+ <main>+ <Card className="sync-steps">+ {steps.map((s, i) => (+ <CardSection className={i < currentIndex ? "completed" : i === currentIndex ? "active" : ""} key={s.key}>+ <Icon icon={i < currentIndex ? "bx bx-check-circle" : i === currentIndex ? "bx bx-loader-circle bx-spin" : "bx bx-circle"} />{" "}+ {s.label}+ {s.key === "syncing" && (+ <div class="sync-progress">+ <progress value={stats.totalPullCount! - stats.outstandingPullCount} max={stats.totalPullCount!} />+ <span>{progress}%</span>+ </div>+ )}+ </CardSection>+ ))}+ </Card>+ </main></div>);}diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex cd96de81ec..e5b60315af 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -2244,7 +2244,7 @@"redirecting": "You will be shortly redirected to the application.","title": "Setup","sync-from-server-page-description": "Enter your server details below to connect your existing workspace.",- "sync-in-progress-title": "Connection successful",+ "sync-in-progress-title": "Sync in progress","sync-in-progress-description": "Your device is now connected and items are being synchronized.","password-placeholder": "Password","button-back": "Back",