Skip to content

Build your personal knowledge base with Trilium Notes

feat(standalone/setup): add a sync illustration

Elian Doranf48b67f872f2
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css
index 437dc771d3..5cf337aa49 100644
--- a/apps/client/src/setup.css
+++ b/apps/client/src/setup.css
@@ -144,6 +144,40 @@ body.setup {
}
}
}
+
+ .sync-illustration {
+ display: flex;
+ justify-content: center;
+ margin-bottom: 2rem;
+
+ .tn-icon {
+ font-size: 3em;
+ color: var(--muted-text-color);
+ }
+
+ >div {
+ display: flex;
+ flex-direction: column;
+ text-align: center;
+ gap: 0.5rem;
+ line-height: 1;
+ }
+
+ .sync-illustration-arrows {
+ width: 60px;
+ height: 3em;
+ position: relative;
+
+ &::after {
+ content: "";
+ position: absolute;
+ border: 2px dashed var(--main-border-color);
+ top: 1.5em;
+ left: 0;
+ right: 0;
+ }
+ }
+ }
}
@keyframes lds-ring {
diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx
index 0be7e91673..7a110db23c 100644
--- a/apps/client/src/setup.tsx
+++ b/apps/client/src/setup.tsx
@@ -221,6 +221,7 @@ function SyncFromServer({ setState }: { setState: (state: State) => void }) {
return (
<div class="page sync-from-server">
+ <SyncIllustration targetDevice="server" />
<h1>{t("setup.sync-from-server-page-title")}</h1>
<p>{t("setup.sync-from-server-page-description")}</p>
@@ -250,6 +251,7 @@ function SyncFromDesktop({ setState }: { setState: (state: State) => void }) {
return (
<div class="page sync-from-desktop">
+ <SyncIllustration targetDevice="desktop" />
<h1>{t("setup.sync-desktop-title")}</h1>
<main>
@@ -264,6 +266,22 @@ function SyncFromDesktop({ setState }: { setState: (state: State) => void }) {
);
}
+function SyncIllustration({ targetDevice }: { targetDevice: "desktop" | "server" }) {
+ return (
+ <div class="sync-illustration">
+ <div>
+ <Icon icon="bx bx-globe" />
+ {t("setup.sync-illustration-this-device")}
+ </div>
+ <div class="sync-illustration-arrows" />
+ <div>
+ <Icon icon={targetDevice === "desktop" ? "bx bx-desktop" : "bx bx-server"} />
+ {targetDevice === "desktop" ? t("setup.sync-illustration-desktop-app") : t("setup.sync-illustration-server")}
+ </div>
+ </div>
+ );
+}
+
function FormItemWithIcon({ icon, children }: { icon: string; children: ComponentChildren }) {
return (
<div class="form-item-with-icon">
diff --git a/apps/client/src/setup_old.ts b/apps/client/src/setup_old.ts
index 30232b85a3..98881a36ff 100644
--- a/apps/client/src/setup_old.ts
+++ b/apps/client/src/setup_old.ts
@@ -145,14 +145,6 @@ class SetupController {
private getSelectedSetupType(): SetupType {
return (this.setupTypeInputs.find((input) => input.checked)?.value ?? "") as SetupType;
}
-
- private startSyncPolling() {
- if (this.syncPollIntervalId !== null) {
- return;
- }
-
- this.syncPollIntervalId = window.setInterval(checkOutstandingSyncs, 1000);
- }
}
async function checkOutstandingSyncs() {
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index ceb477dac6..575f3cd868 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2255,6 +2255,9 @@
"sync-step-finalizing": "Setting up options",
"create-new-document-title": "Preparing your new document",
"create-new-document-description": "You’ll be redirected automatically in a moment.",
- "sync-desktop-title": "Sync from desktop"
+ "sync-desktop-title": "Sync from desktop",
+ "sync-illustration-this-device": "This device",
+ "sync-illustration-desktop-app": "Desktop app",
+ "sync-illustration-server": "Sync server"
}
}