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 {
|
} else {
|
||||||
popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY)
|
popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY)
|
||||||
popover.contentViewController?.view.window?.makeKey()
|
popover.contentViewController?.view.window?.makeKey()
|
||||||
// Refresh on open (PollerService deduplicates if already fetching)
|
|
||||||
Task { await PollerService.shared.fetchNow() }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,17 @@ struct BugListPopover: View {
|
||||||
Image(systemName: "arrow.triangle.2.circlepath")
|
Image(systemName: "arrow.triangle.2.circlepath")
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
Text(bugStore.lastUpdated.map(formatted) ?? "Never")
|
if let lastUpdated = bugStore.lastUpdated {
|
||||||
.font(.caption)
|
TimelineView(.periodic(from: lastUpdated, by: 30)) { _ in
|
||||||
.foregroundStyle(.secondary)
|
Text(formatted(lastUpdated))
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Text("Never")
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Button("Mark all seen") {
|
Button("Mark all seen") {
|
||||||
bugStore.markAllSeen()
|
bugStore.markAllSeen()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue