From f2d0cd1df94741ed16ac36b2f8901b806043bb2c Mon Sep 17 00:00:00 2001 From: Michi Date: Thu, 12 Nov 2026 21:18:02 +0100 Subject: [PATCH] tray-hintergrundbetrieb, favoriten, neustart-fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Desktop-App läuft beim Schließen als Symbol neben der Uhr weiter (automatisches Backup auch ohne Fenster, Windows-Hinweise), nur eine Instanz, optional mit Windows starten (--background) - Favoriten: Stern an Projekten, eigene Reihe in der einfachen Ansicht, immer zuerst sortiert, Filter "Favoriten" - Fix: geerbtes DASHBOARD_WORKER ließ ein aus dem Dashboard gestartetes Dashboard ohne Supervisor laufen ("Neu starten" beendete es) Co-Authored-By: Claude Opus 5.5 --- README.md | 17 +++- launcher/Program.cs | 202 +++++++++++++++++++++++++++++++++++++++++--- lib/create.js | 2 +- public/app.js | 75 ++++++++++++++-- public/index.html | 27 +++++- server.js | 13 ++- 6 files changed, 313 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 13b4d5b..276b5b0 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,19 @@ Oben rechts schaltest du zwischen zwei Ansichten um (gilt für diesen PC, bleibt Knopf **Neu** oben: leeres Projekt (Ordner mit `README.md`) oder Klon eines vorhandenen. Ein Klon lässt `node_modules`, Caches und – abwählbar – Build-Ordner weg; den Git-Verlauf nur auf Wunsch. +### Favoriten +Der ☆ an einem Projekt (auf den Kacheln, in der Galerie und oben im Projekt) macht es zum Favoriten. +Favoriten stehen in der einfachen Ansicht in einer eigenen Reihe ganz oben, im Board, in Galerie und Liste immer +zuerst, und es gibt den Filter „Favoriten“. Gespeichert in der `.dashboard.json` des Projekts. + +### Im Hintergrund (Symbol neben der Uhr) +In der Desktop-App beendet das Schließen des Fensters das Dashboard nicht: es läuft als Symbol neben der Uhr weiter, +damit das automatische Backup auch ohne offenes Fenster läuft. Ist das Fenster zu, meldet Windows, wenn ein Backup +fertig ist oder fehlschlägt. Doppelklick auf das Symbol öffnet das Fenster, Rechtsklick → **Beenden** beendet alles. +Ein zweiter Start der exe holt einfach das laufende Fenster nach vorn. +Einstellungen → Allgemein → **Fenster**: „Beim Schließen im Hintergrund weiterlaufen“ (Standard: an) und +„Mit Windows starten“ (startet unsichtbar, nur das Symbol). Beides gilt sofort. + ### Mehrere Projektordner Oben links neben dem Logo ist ein Auswahlmenü: - **Klick auf einen Namen** zeigt nur diesen Ordner, **Häkchen** zeigen mehrere gleichzeitig. @@ -114,8 +127,8 @@ Einzelne Projekte sicherst du im Projekt unter **Aktionen → Jetzt sichern**. **Automatisch sichern:** Einstellungen → Backup → „Automatisch sichern“: *Aus · Bei jedem Start · Stündlich · Täglich (Uhrzeit) · Wöchentlich (Tag + Uhrzeit)*, auf ein Ziel oder alle nacheinander. Gesichert werden **alle** -Projektordner, auch die gerade nicht angezeigten. Das läuft nur, solange das Dashboard geöffnet ist. Ein verpasster -Termin (PC aus) wird beim nächsten Öffnen nachgeholt; Termine vor dem Einschalten zählen nicht als verpasst. Ist das +Projektordner, auch die gerade nicht angezeigten. Das läuft, solange das Dashboard läuft – auch im Hintergrund +(siehe „Im Hintergrund“). Ein verpasster Termin (PC aus) wird beim nächsten Start nachgeholt; Termine vor dem Einschalten zählen nicht als verpasst. Ist das Ziel nicht erreichbar (NAS aus, USB-Platte fehlt), folgt nach 30 Minuten ein neuer Versuch. Die Einstellungen zeigen den nächsten Termin und das letzte Ergebnis, der Backup-Knopf zeigt „auto …“, solange es läuft. diff --git a/launcher/Program.cs b/launcher/Program.cs index b08fd99..a58cb63 100644 --- a/launcher/Program.cs +++ b/launcher/Program.cs @@ -10,11 +10,22 @@ namespace ProjectDashboard; static class Program { + // --background: start only the server and the tray icon (Windows autostart) [STAThread] - static void Main() + static void Main(string[] args) { + // one dashboard per port: a second start brings the running one to the front + var name = $"ProjectDashboard-{MainForm.Port}"; + using var mutex = new Mutex(true, name, out var first); + if (!first) + { + try { EventWaitHandle.OpenExisting(name + "-show").Set(); } catch { } + return; + } + using var show = new EventWaitHandle(false, EventResetMode.AutoReset, name + "-show"); ApplicationConfiguration.Initialize(); - Application.Run(new MainForm()); + Application.Run(new MainForm(args.Contains("--background"), show)); + GC.KeepAlive(mutex); } } @@ -30,7 +41,7 @@ static class Program sealed class MainForm : Form { // DASHBOARD_PORT (also read by server.js) allows a second instance, e.g. for tests - static readonly int Port = int.TryParse(Environment.GetEnvironmentVariable("DASHBOARD_PORT"), out var p) ? p : 4848; + internal static readonly int Port = int.TryParse(Environment.GetEnvironmentVariable("DASHBOARD_PORT"), out var p) ? p : 4848; static readonly string BaseUrl = $"http://127.0.0.1:{Port}/"; // DASHBOARD_HOME moves everything (window state, WebView2, unpacked app, data) - used for tests static readonly string DataDir = Environment.GetEnvironmentVariable("DASHBOARD_HOME") is { Length: > 0 } home @@ -51,37 +62,151 @@ sealed class MainForm : Form Process? server; // only set when this window started the server StreamWriter? serverLog; - public MainForm() + // tray: closing the window keeps the dashboard (and the automatic backup) running + readonly NotifyIcon tray = new() { Text = "Projekt-Dashboard" }; + readonly System.Windows.Forms.Timer poll = new() { Interval = 20000 }; + AppPrefs prefs = AppPrefs.Load(); + bool startHidden; // --background: the first Show() is skipped + bool exiting; // "Beenden" in the tray menu: really close + string? lastAutoAt; // last automatic backup result seen (notifications) + string? lastPhase; + bool polledOnce; + + public MainForm(bool background = false, EventWaitHandle? showSignal = null) { Text = "Projekte"; Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); MinimumSize = new Size(900, 560); RestoreWindow(); + startHidden = background; + SetupTray(); + if (showSignal != null) + { + new Thread(() => { while (showSignal.WaitOne()) { try { BeginInvoke(() => ShowFromTray()); } catch { } } }) { IsBackground = true }.Start(); + } FormClosing += (_, e) => { + if (!exiting && prefs.Tray && e.CloseReason == CloseReason.UserClosing) + { + e.Cancel = true; + SaveWindow(); + Hide(); + if (!prefs.HintShown) + { + tray.ShowBalloonTip(5000, "Projekt-Dashboard läuft weiter", + "Im Hintergrund – das automatische Backup läuft weiter. Rechtsklick auf das Symbol → Beenden.", ToolTipIcon.Info); + prefs.HintShown = true; + prefs.Save(); + } + return; + } if (server != null && BackupRunning() && MessageBox.Show(this, "Das Backup läuft noch.\n\nBeim Schließen wird es abgebrochen (bereits kopierte Dateien bleiben). Trotzdem schließen?", "Projekte", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) { e.Cancel = true; + exiting = false; return; } - SaveWindow(); + if (Visible) SaveWindow(); }; BackColor = Color.FromArgb(245, 246, 250); status.Text = "Starte Dashboard …"; Controls.Add(web); Controls.Add(status); Shown += async (_, _) => await StartAsync(); - FormClosed += (_, _) => StopServer(); + FormClosed += (_, _) => { poll.Stop(); tray.Visible = false; tray.Dispose(); StopServer(); }; } - async Task StartAsync() + // --background: the window is not shown at start; the server starts anyway + protected override void SetVisibleCore(bool value) + { + if (startHidden) + { + startHidden = false; + value = false; + if (!IsHandleCreated) CreateHandle(); + BeginInvoke(async () => + { + try { await EnsureServerAsync(); } + catch (Exception ex) { tray.ShowBalloonTip(8000, "Projekt-Dashboard", "Konnte nicht starten: " + ex.Message, ToolTipIcon.Error); } + }); + } + base.SetVisibleCore(value); + } + + void SetupTray() + { + tray.Icon = Icon; + var menu = new ContextMenuStrip(); + menu.Items.Add("Öffnen", null, (_, _) => ShowFromTray()); + menu.Items.Add("Backup …", null, (_, _) => ShowFromTray("backup")); + menu.Items.Add(new ToolStripSeparator()); + menu.Items.Add("Beenden", null, (_, _) => { exiting = true; Close(); }); + tray.ContextMenuStrip = menu; + tray.DoubleClick += (_, _) => ShowFromTray(); + tray.BalloonTipClicked += (_, _) => ShowFromTray(); + tray.Visible = true; + poll.Tick += async (_, _) => await PollBackup(); + poll.Start(); + } + + // Brings the window back (from the tray, or for a second start of the exe). + void ShowFromTray(string? hash = null) + { + if (!Visible) Show(); // the first Show() also starts the web view (Shown event) + if (WindowState == FormWindowState.Minimized) WindowState = FormWindowState.Normal; + Activate(); + BringToFront(); + if (hash == "backup") + { + if (web.CoreWebView2 != null) _ = web.CoreWebView2.ExecuteScriptAsync("typeof openBackup === 'function' && openBackup()"); + else pendingHash = "#backup"; + } + } + string pendingHash = ""; + + // While the window is hidden: a balloon when a backup finished or failed. + async Task PollBackup() { try { - Directory.CreateDirectory(DataDir); - if (!await IsServerUp()) + using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(3) }; + using var doc = JsonDocument.Parse(await http.GetStringAsync(BaseUrl + "api/backup")); + var r = doc.RootElement; + var phase = r.TryGetProperty("phase", out var ph) ? ph.GetString() : null; + var auto = r.TryGetProperty("auto", out var au) && au.ValueKind == JsonValueKind.True; + string? at = null; bool ok = true; string detail = ""; + if (r.TryGetProperty("schedule", out var sc) && sc.TryGetProperty("lastResult", out var lr) && lr.ValueKind == JsonValueKind.Object) + { + at = lr.TryGetProperty("at", out var a) ? a.GetString() : null; + ok = lr.TryGetProperty("ok", out var o) && o.ValueKind == JsonValueKind.True; + if (lr.TryGetProperty("targets", out var ts) && ts.ValueKind == JsonValueKind.Array) + detail = string.Join(", ", ts.EnumerateArray().Select(t => + (t.TryGetProperty("name", out var n) ? n.GetString() : "") + + (t.TryGetProperty("error", out var er) && er.ValueKind == JsonValueKind.String ? ": " + er.GetString() : ""))); + } + if (polledOnce && !Visible) + { + if (at != null && at != lastAutoAt) + tray.ShowBalloonTip(6000, ok ? "Automatisches Backup fertig" : "Automatisches Backup fehlgeschlagen", + detail.Length > 0 ? detail : (ok ? "Alle Projekte gesichert." : "Details im Dashboard."), ok ? ToolTipIcon.Info : ToolTipIcon.Warning); + else if (!auto && lastPhase is "checking" or "copying" && phase is "done" or "error") + tray.ShowBalloonTip(6000, phase == "done" ? "Backup fertig" : "Backup fehlgeschlagen", + phase == "done" ? "Alles gesichert." : (r.TryGetProperty("error", out var e) ? e.GetString() ?? "" : ""), phase == "done" ? ToolTipIcon.Info : ToolTipIcon.Warning); + } + lastAutoAt = at; + lastPhase = phase; + polledOnce = true; + } + catch { } + } + + // Starts the Node server unless one is already running (also used by --background). + async Task EnsureServerAsync() + { + Directory.CreateDirectory(DataDir); + if (!await IsServerUp()) { string node; if (File.Exists(Path.Combine(appDir, "server.js"))) @@ -110,7 +235,13 @@ sealed class MainForm : Form await Task.Delay(300); } } + } + async Task StartAsync() + { + try + { + await EnsureServerAsync(); var env = await CoreWebView2Environment.CreateAsync(null, Path.Combine(DataDir, "WebView2")); await web.EnsureCoreWebView2Async(env); var core = web.CoreWebView2; @@ -125,7 +256,8 @@ sealed class MainForm : Form core.DocumentTitleChanged += (_, _) => Text = core.DocumentTitle; core.WebMessageReceived += OnWebMessage; if (savedZoom is > 0.3 and < 3) web.ZoomFactor = savedZoom; - web.Source = new Uri(BaseUrl); + web.Source = new Uri(BaseUrl + pendingHash); + pendingHash = ""; web.Visible = true; status.Visible = false; } @@ -162,6 +294,18 @@ sealed class MainForm : Form var m = doc.RootElement; if (m.ValueKind != JsonValueKind.Object) return; var type = m.GetProperty("type").GetString(); + // window options from Einstellungen → Allgemein → Fenster + if (type == "getAppSettings" || type == "appSettings") + { + if (type == "appSettings") + { + if (m.TryGetProperty("tray", out var tr) && tr.ValueKind is JsonValueKind.True or JsonValueKind.False) prefs.Tray = tr.GetBoolean(); + if (m.TryGetProperty("autostart", out var au) && au.ValueKind is JsonValueKind.True or JsonValueKind.False) AppPrefs.SetAutostart(au.GetBoolean()); + prefs.Save(); + } + web.CoreWebView2?.PostWebMessageAsJson(JsonSerializer.Serialize(new { type = "appSettings", tray = prefs.Tray, autostart = AppPrefs.Autostart() })); + return; + } if (type != "pickFolder" && type != "pickFile") return; var id = m.GetProperty("id").GetString() ?? ""; var title = m.TryGetProperty("title", out var t) ? t.GetString() : null; @@ -361,4 +505,42 @@ sealed class MainForm : Form { try { Process.Start(new ProcessStartInfo(uri) { UseShellExecute = true }); } catch { } } + + internal static string Home => DataDir; +} + +// Window options (only the desktop app can do these): \app.json. +// Autostart lives in the registry (HKCU ...\Run); a test home (DASHBOARD_HOME) +// uses its own value name so it never touches the real one. +sealed class AppPrefs +{ + public bool Tray { get; set; } = true; + public bool HintShown { get; set; } + + static string File_ => Path.Combine(MainForm.Home, "app.json"); + const string RunKey = @"Software\Microsoft\Windows\CurrentVersion\Run"; + static string RunValue => Environment.GetEnvironmentVariable("DASHBOARD_HOME") is { Length: > 0 } ? "ProjectDashboard-Test" : "ProjectDashboard"; + + public static AppPrefs Load() + { + try { return JsonSerializer.Deserialize(File.ReadAllText(File_)) ?? new AppPrefs(); } catch { return new AppPrefs(); } + } + public void Save() + { + try { Directory.CreateDirectory(MainForm.Home); File.WriteAllText(File_, JsonSerializer.Serialize(this)); } catch { } + } + public static bool Autostart() + { + try { using var k = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(RunKey); return k?.GetValue(RunValue) is string; } catch { return false; } + } + public static void SetAutostart(bool on) + { + try + { + using var k = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(RunKey); + if (on) k.SetValue(RunValue, $"\"{Application.ExecutablePath}\" --background"); + else k.DeleteValue(RunValue, false); + } + catch { } + } } diff --git a/lib/create.js b/lib/create.js index b40a586..79483fe 100644 --- a/lib/create.js +++ b/lib/create.js @@ -58,7 +58,7 @@ async function create(opts) { const tasks = Array.isArray(m.tasks) ? m.tasks.filter((t) => !t?.done) : [] const note = `Klon von „${path.basename(src)}“ (${now.slice(0, 10)}).` fs.writeFileSync(path.join(dest, STATUS_FILE), JSON.stringify({ - ...m, status: 'idea', itch: '', tasks, + ...m, status: 'idea', itch: '', favorite: false, tasks, notes: m.notes ? `${note}\n\n${m.notes}` : note, updatedAt: now, }, null, 2)) diff --git a/public/app.js b/public/app.js index fa98bdc..4628507 100644 --- a/public/app.js +++ b/public/app.js @@ -149,6 +149,33 @@ function pubTitle(p) { const x = p.published return x ? `Auf itch.io veröffentlicht${x.title ? `: ${x.title}` : ''} (${x.source === 'manual' ? 'manuell eingetragen' : 'automatisch erkannt'}) – Klick öffnet die Seite` : '' } +// favorites: a star to toggle (tiles, panel) or a small mark (cards, rows) +const favMark = (p) => (p.favorite ? `${ic('star', 'sm')}` : '') +const favBtn = (p, cls = '') => `` +async function toggleFavorite(p) { + try { + const res = await fetch(`/api/projects/${encodeURIComponent(p.name)}`, { + method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ favorite: !p.favorite }), + }) + const r = await res.json().catch(() => ({})) + if (!res.ok) throw new Error(r.error ?? 'Speichern fehlgeschlagen') + for (const x of [p, projects.find((y) => y.name === p.name), editing?.name === p.name ? editing : null]) if (x) x.favorite = r.favorite + render() + if (editing?.name === p.name) { + const el = document.getElementById('pFav') + el.innerHTML = favBtn(editing) + wireFav(el, editing) + } + toast(r.favorite ? `${p.name} ist jetzt Favorit` : `${p.name} ist kein Favorit mehr`, 'star') + } catch (e) { toast(e.message, 'triangle-alert') } +} +function wireFav(el, p) { + for (const b of el.querySelectorAll('[data-fav]')) { + b.onclick = (e) => { e.stopPropagation(); toggleFavorite(p) } + b.addEventListener('mousedown', (e) => e.stopPropagation()) + } +} + function pubChip(p, short = false) { if (!p.published) return '' return `${ic('rocket', 'sm')}${short ? '' : 'itch.io'}` @@ -513,9 +540,32 @@ if (hasPicker) { window.chrome.webview.addEventListener('message', (e) => { const m = e.data if ((m?.type === 'folderPicked' || m?.type === 'filePicked') && pickWaiters.has(m.id)) { pickWaiters.get(m.id)(m.path ?? ''); pickWaiters.delete(m.id) } + if (m?.type === 'appSettings') showAppSettings(m) }) } else document.body.classList.add('no-picker') +// window options of the desktop app (tray, autostart) - kept by the launcher, not in settings.json +let appSettingsSent = null +function showAppSettings(m) { + document.getElementById('appWin').hidden = false + document.getElementById('fTray').checked = !!m.tray + document.getElementById('fAutostart').checked = !!m.autostart + if (appSettingsSent) { + const what = appSettingsSent + appSettingsSent = null + toast(what === 'tray' ? (m.tray ? 'Läuft beim Schließen im Hintergrund weiter' : 'Schließen beendet das Dashboard') : (m.autostart ? 'Startet mit Windows' : 'Startet nicht mehr mit Windows'), 'app-window') + } +} +if (hasPicker) { + for (const id of ['fTray', 'fAutostart']) { + document.getElementById(id).addEventListener('change', (e) => { + e.stopPropagation() + appSettingsSent = id === 'fTray' ? 'tray' : 'autostart' + window.chrome.webview.postMessage({ type: 'appSettings', [appSettingsSent]: e.target.checked }) + }) + } +} + function pickDialog(type, title, initial) { return new Promise((resolve) => { const id = Math.random().toString(36).slice(2) @@ -530,6 +580,7 @@ async function openSettings(setup) { settingsSetup = !!setup closeEditor(); closeBackup() try { settingsCache = await (await fetch('/api/settings')).json() } catch {} + if (hasPicker) window.chrome.webview.postMessage({ type: 'getAppSettings' }) const s = settingsCache ?? { roots: [], backup: { targets: [], excludeDirs: [] } } shownRootIds = s.activeRoots ?? [s.activeRoot] document.getElementById('fRoots').innerHTML = (s.roots ?? []).map((r) => rootRow(r)).join('') || rootRow() @@ -688,7 +739,7 @@ function setSettingsTab(tab) { } for (const b of document.querySelectorAll('#spTabs button')) b.onclick = () => setSettingsTab(b.dataset.stab) const markSettingsDirty = () => document.getElementById('spanel').classList.add('dirty') -document.getElementById('spanel').addEventListener('input', (e) => { if (!e.target.closest('#fImport')) markSettingsDirty() }) +document.getElementById('spanel').addEventListener('input', (e) => { if (!e.target.closest('#fImport, #appWin')) markSettingsDirty() }) document.addEventListener('keydown', (e) => { if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 's' && document.getElementById('spanel').classList.contains('open')) { e.preventDefault() @@ -1018,6 +1069,7 @@ const QUICK = [ { key: 'install', label: 'npm install', icon: 'download', test: (p) => p.tech?.needsInstall }, { key: 'noicon', label: 'Ohne Icon', icon: 'image-off', test: (p) => !p.hasIcon }, { key: 'gencopy', label: 'Generator-Kopie', icon: 'copy', test: (p) => p.tools?.generators?.some((g) => g.kind === 'copy') }, + { key: 'fav', label: 'Favoriten', icon: 'star', test: (p) => !!p.favorite }, { key: 'itch', label: 'itch.io', icon: 'rocket', feature: 'itch', test: (p) => !!p.published }, { key: 'noitch', label: 'Fertig, nicht auf itch', icon: 'circle-off', feature: 'itch', test: (p) => p.status === 'done' && !p.published }, ] @@ -1041,6 +1093,7 @@ function visibleProjects({ useStatus = true } = {}) { function sortProjects(items) { const sort = document.getElementById('fltSort').value return [...items].sort((a, b) => { + if (!!a.favorite !== !!b.favorite) return a.favorite ? -1 : 1 // favorites always first if (sort === 'name') return a.name.localeCompare(b.name, 'de', { sensitivity: 'base' }) if (sort === 'priority') return (PRIO_ORDER[a.priority] - PRIO_ORDER[b.priority]) || (new Date(lastActivity(b)) - new Date(lastActivity(a))) if (sort === 'size') return (b.storage?.sizeMB ?? -1) - (a.storage?.sizeMB ?? -1) @@ -1183,7 +1236,7 @@ function rowHtml(p) { ${avatar(p)}
- ${escapeHtml(p.name)} + ${favMark(p)}${escapeHtml(p.name)} ${rootTag(p, true)} ${ic('folder', 'sm')}${p.storage?.sizeMB != null ? fmtMB(p.storage.sizeMB) : '–'} @@ -1204,7 +1257,7 @@ function cardHtml(p) { const tags = (p.tags ?? []).map((t) => `${ic('tag', 'sm')}${escapeHtml(t)}`).join('') return `
${avatar(p)} -
${escapeHtml(p.name)}
+
${favMark(p)}${escapeHtml(p.name)}
${prioHtml(p.priority)}
${qsGroup(p, false, true)}
@@ -1276,6 +1329,7 @@ function renderGallery() {
${escapeHtml(initialsOf(p.name))} ${statusHtml(p.status)} + ${favBtn(p, 'onthumb')} ${pubBadge(p)}${cloudBadge(p)}${ic(GIT_ICON[p.git.level])}
@@ -1284,6 +1338,7 @@ function renderGallery() {
${prioHtml(p.priority)}${rootTag(p, true)}${p.storage?.sizeMB != null ? `${ic('hard-drive', 'sm')} ${fmtMB(p.storage.sizeMB)} · ` : ''}${timeAgo(lastActivity(p))}
` wireQuickStart(tile, p) + wireFav(tile, p) tile.onclick = () => openEditor(p) grid.appendChild(tile) } @@ -1304,7 +1359,7 @@ function renderList() { const sort = document.getElementById('fltSort').value table.innerHTML = `${LIST_COLS.map((c) => `${c.label}${c.sort === sort ? ' ' + ic('arrow-down', 'sm') : ''}`).join('')} ${items.map((p) => ` -
${avatar(p)}${escapeHtml(p.name)}${rootTag(p, true)}
+
${avatar(p)}${favMark(p)}${escapeHtml(p.name)}${rootTag(p, true)}
${statusHtml(p.status)}${pubChip(p, true)}
${gitHtml(p.git, true)} ${cloudChip(p)} @@ -1388,13 +1443,20 @@ function renderHome() { const grid = document.getElementById('homeGrid') if (!items.length) { grid.innerHTML = `
${ic('search-x', 'xl')}
Keine Projekte gefunden.
`; return } grid.innerHTML = '' - for (const p of items) { + // "Alle": favorites get their own row on top + const favs = homeStatus === 'all' ? items.filter((p) => p.favorite) : [] + const head = (icon, text) => { const h = document.createElement('div'); h.className = 'hgroup'; h.innerHTML = `${ic(icon, 'sm')}${text}`; grid.appendChild(h) } + if (favs.length) head('star', 'Favoriten') + const ordered = favs.length ? [...favs, null, ...items.filter((p) => !p.favorite)] : items + for (const p of ordered) { + if (!p) { head('layout-grid', 'Alle Projekte'); continue } const desc = (p.description || p.notes || '').split(/\r?\n/).map((x) => x.trim()).find(Boolean) ?? '' const due = backupDue(p) const tile = document.createElement('div') tile.className = 'htile' tile.innerHTML = `
+ ${favBtn(p, 'ontile')}
${escapeHtml(initialsOf(p.name))}
${escapeHtml(p.name)}
@@ -1408,6 +1470,7 @@ function renderHome() { ${qsGroup(p, false, true)}
` wireQuickStart(tile, p) + wireFav(tile, p) tile.onclick = () => openEditor(p) grid.appendChild(tile) } @@ -2775,6 +2838,8 @@ function openEditor(p) { editingTasks = (p.tasks ?? []).map((t) => ({ ...t })) document.getElementById('pAvatar').innerHTML = avatar(p, 'lg') document.getElementById('panelTitle').textContent = p.name + document.getElementById('pFav').innerHTML = favBtn(p) + wireFav(document.getElementById('pFav'), p) document.getElementById('panelSub').innerHTML = uiMode === 'simple' ? `${statusHtml(p.status)}${rootTag(p)}` : `${statusHtml(p.status)}${gitHtml(p.git, true)}${techChips(p.tech?.types)}${pubChip(p)}` document.getElementById('fStatus').value = p.status document.getElementById('fPriority').value = p.priority diff --git a/public/index.html b/public/index.html index 897d5db..24d5690 100644 --- a/public/index.html +++ b/public/index.html @@ -601,6 +601,20 @@ .featrow { display: flex !important; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; } .featrow input { margin-top: 3px; } .featrow b { display: inline-flex; gap: 5px; align-items: center; } + /* favorites */ + .favbtn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 6px; display: inline-grid; place-items: center; opacity: .55; } + .favbtn:hover { opacity: 1; color: var(--yellow); background: var(--surface-2); } + .favbtn.on { color: var(--yellow); opacity: 1; } + .favbtn.on .i, .favmark .i { fill: currentColor; } + .favmark { color: var(--yellow); display: inline-flex; vertical-align: -2px; margin-right: 4px; } + .favbtn.onthumb { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.35); color: #fff; opacity: 0; z-index: 2; } + .tile:hover .favbtn.onthumb, .favbtn.onthumb.on { opacity: 1; } + .favbtn.onthumb.on { color: var(--yellow); } + .htile .hhead { position: relative; } + .favbtn.ontile { position: absolute; top: -8px; right: -8px; opacity: 0; } + .htile:hover .favbtn.ontile, .favbtn.ontile.on { opacity: 1; } + .hgroup { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 6px; } + .hgroup:first-child { margin-top: 0; } .pdesc { font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; } .pdesc.muted { color: var(--muted); font-style: italic; } .pdesc-edit textarea { width: 100%; min-height: 120px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.5; } @@ -921,7 +935,7 @@
-

+

@@ -1076,7 +1090,7 @@ auf
-
Sichert alle Projektordner – nur, solange das Dashboard geöffnet ist. Ein verpasster Termin (PC aus) wird beim nächsten Öffnen nachgeholt; ist das Ziel nicht erreichbar, folgt nach 30 Minuten ein neuer Versuch.
+
Sichert alle Projektordner – solange das Dashboard läuft, auch im Hintergrund (Symbol neben der Uhr, siehe Allgemein → Fenster). Ein verpasster Termin (PC aus) wird beim nächsten Start nachgeholt; ist das Ziel nicht erreichbar, folgt nach 30 Minuten ein neuer Versuch.
Wohin wird gesichert?
Jedes Projekt landet im Ziel in einem gleichnamigen Unterordner. Der Hauptordner geht direkt ins Ziel, jeder weitere Projektordner in einen Unterordner mit seinem Namen. Jedes Ziel hat seinen eigenen Backup-Stand; backup-projekte.bat sichert auf das erste. Im Backup wird nie etwas gelöscht.
@@ -1097,6 +1111,15 @@

Allgemein

Wo das Dashboard seine Daten ablegt.

+

Funktionen

Zusätzliches, das nicht jeder braucht. Ausgeschaltet ist davon nichts zu sehen.