From 3f1367790ed67ed5bf07e2f75eadeaf902cd1888 Mon Sep 17 00:00:00 2001 From: tigerenwork Date: Mon, 29 Jun 2026 23:54:28 +0800 Subject: [PATCH] fix: timestamp auto-updates without triggering fetch on tray open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reverted auto-refresh on tray click (fetch only happens on schedule or manual Refresh button) - Timestamp now uses TimelineView(.periodic) to auto-update every 30s: 'Just now' → '1m ago' → '5m ago' → etc. without any user action Co-Authored-By: Claude --- Sources/AppDelegate.swift | 2 -- Sources/Views/MenuBar/BugListPopover.swift | 14 +++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Sources/AppDelegate.swift b/Sources/AppDelegate.swift index 99c9e6a..bf03572 100644 --- a/Sources/AppDelegate.swift +++ b/Sources/AppDelegate.swift @@ -64,8 +64,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate { } else { popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY) popover.contentViewController?.view.window?.makeKey() - // Refresh on open (PollerService deduplicates if already fetching) - Task { await PollerService.shared.fetchNow() } } } diff --git a/Sources/Views/MenuBar/BugListPopover.swift b/Sources/Views/MenuBar/BugListPopover.swift index 0503072..967aa04 100644 --- a/Sources/Views/MenuBar/BugListPopover.swift +++ b/Sources/Views/MenuBar/BugListPopover.swift @@ -31,9 +31,17 @@ struct BugListPopover: View { Image(systemName: "arrow.triangle.2.circlepath") .font(.caption2) .foregroundStyle(.secondary) - Text(bugStore.lastUpdated.map(formatted) ?? "Never") - .font(.caption) - .foregroundStyle(.secondary) + if let lastUpdated = bugStore.lastUpdated { + TimelineView(.periodic(from: lastUpdated, by: 30)) { _ in + Text(formatted(lastUpdated)) + .font(.caption) + .foregroundStyle(.secondary) + } + } else { + Text("Never") + .font(.caption) + .foregroundStyle(.secondary) + } } Button("Mark all seen") { bugStore.markAllSeen()