fix: timestamp auto-updates without triggering fetch on tray open
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
5b1811db10
commit
3f1367790e
|
|
@ -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() }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,10 +31,18 @@ struct BugListPopover: View {
|
|||
Image(systemName: "arrow.triangle.2.circlepath")
|
||||
.font(.caption2)
|
||||
.foregroundStyle(.secondary)
|
||||
Text(bugStore.lastUpdated.map(formatted) ?? "Never")
|
||||
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()
|
||||
AppDelegate.shared?.updateBadge(count: bugStore.activeBugs.count)
|
||||
|
|
|
|||
Loading…
Reference in New Issue