Start-Sequenz ergänzt: Splash-Screen, dann Startbildschirm mit Neues Projekt/Projekt öffnen/Zuletzt geöffnet.
Zuletzt-geöffnet-Liste (state/recentProjects.ts) trägt sich beim Öffnen und beim Speichern automatisch ein, inkl. Öffnen über einen bekannten Pfad ohne Dialog (verwaiste Einträge fliegen raus, wenn die Datei fehlt). Der Splash wartet bewusst nicht auf den Update-Check — der läuft unabhängig im Hintergrund weiter, damit ein langsames Netz den Start nie verzögert.
This commit is contained in:
1 parent
fc31ef9f44
commit
06c0143d32
11 files changed
+407
-8
No files matched your search
@@ -0,0 +1,31 @@
|
||||
// Kurzer Marken-Splash beim Start, bevor der Startbildschirm (StartScreen)
|
||||
// erscheint. BEWUSST keine künstliche Wartezeit/„Ladebalken"-Inszenierung:
|
||||
// kommerzielle CAD-Programme brauchen beim Start oft mehrere Sekunden für
|
||||
// Lizenzserver-Handshakes, riesige Bauteil-/Vorlagenbibliotheken und
|
||||
// historisch gewachsene Plugin-Ketten — wir starten schnell, WEIL es nichts
|
||||
// dergleichen gibt, nicht obwohl wir etwas Echtes überspringen. Die einzige
|
||||
// Wartezeit hier ist eine kurze, feste Mindestdauer für die Markenwirkung
|
||||
// (sonst nur ein Flackern bei einem sehr schnellen Rechner) — kein Fake-Fortschritt.
|
||||
//
|
||||
// Der stille Update-Check (state/checkForUpdate.ts) läuft bewusst NICHT hier,
|
||||
// sondern unabhängig im Hintergrund weiter (App.tsx) — ein langsames/nicht
|
||||
// erreichbares Netz soll den Start nie verzögern.
|
||||
import { useEffect } from "react";
|
||||
|
||||
/** Mindest-Anzeigedauer (ms) — rein für die Markenwirkung, kein simulierter Ladevorgang. */
|
||||
const MIN_VISIBLE_MS = 500;
|
||||
|
||||
export function SplashScreen({ onDone }: { onDone: () => void }) {
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(onDone, MIN_VISIBLE_MS);
|
||||
return () => clearTimeout(timer);
|
||||
}, [onDone]);
|
||||
|
||||
return (
|
||||
<div className="splash-screen">
|
||||
<div className="splash-brand">
|
||||
dossier<span className="brand-dot">.</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// Startbildschirm nach dem Splash (s. SplashScreen.tsx) — wie bei den meisten
|
||||
// CAD-Programmen: „Neues Projekt" / „Projekt öffnen…" plus eine Liste zuletzt
|
||||
// geöffneter/gespeicherter Projekte (state/recentProjects.ts, nur Tauri —
|
||||
// im Browser gibt es keine echten Dateipfade zum Wiederöffnen).
|
||||
import { useState } from "react";
|
||||
import { t } from "../i18n";
|
||||
import { isTauriRuntime } from "../io/projectFile";
|
||||
import {
|
||||
getRecentProjects,
|
||||
removeRecentProject,
|
||||
type RecentProjectEntry,
|
||||
} from "../state/recentProjects";
|
||||
|
||||
export function StartScreen({
|
||||
onNewProject,
|
||||
onOpenProject,
|
||||
onOpenRecent,
|
||||
}: {
|
||||
onNewProject: () => void;
|
||||
onOpenProject: () => void;
|
||||
onOpenRecent: (path: string) => void;
|
||||
}) {
|
||||
const [recent, setRecent] = useState<RecentProjectEntry[]>(() => getRecentProjects());
|
||||
const showRecent = isTauriRuntime() && recent.length > 0;
|
||||
|
||||
return (
|
||||
<div className="start-screen">
|
||||
<div className="start-brand">
|
||||
dossier<span className="brand-dot">.</span>
|
||||
</div>
|
||||
<div className="start-actions">
|
||||
<button type="button" className="start-action" onClick={onNewProject}>
|
||||
<span className="start-action-title">{t("start.newProject")}</span>
|
||||
<span className="start-action-hint">{t("start.newProject.hint")}</span>
|
||||
</button>
|
||||
<button type="button" className="start-action" onClick={onOpenProject}>
|
||||
<span className="start-action-title">{t("start.openProject")}</span>
|
||||
<span className="start-action-hint">{t("start.openProject.hint")}</span>
|
||||
</button>
|
||||
</div>
|
||||
{showRecent && (
|
||||
<div className="start-recent">
|
||||
<div className="start-recent-title">{t("start.recent")}</div>
|
||||
<ul className="start-recent-list">
|
||||
{recent.map((e) => (
|
||||
<li key={e.path} className="start-recent-row">
|
||||
<button
|
||||
type="button"
|
||||
className="start-recent-item"
|
||||
onClick={() => onOpenRecent(e.path)}
|
||||
title={e.path}
|
||||
>
|
||||
<span className="start-recent-name">{e.name}</span>
|
||||
<span className="start-recent-path">{e.path}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="start-recent-remove"
|
||||
aria-label={t("start.recent.remove")}
|
||||
title={t("start.recent.remove")}
|
||||
onClick={() => {
|
||||
removeRecentProject(e.path);
|
||||
setRecent(getRecentProjects());
|
||||
}}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user