fix: auto-refresh on tray click, widen 'Just now' to 60s
- Opening the popover now triggers a fetch (via PollerService.fetchNow which deduplicates if already in progress) - 'Just now' now covers 0-60s, then switches to 'Xm ago'. Avoids the frozen-timer look since the text only updates on re-render. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
2f2a65f1f7
commit
5b1811db10
|
|
@ -64,6 +64,8 @@ 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() }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,8 +112,7 @@ struct BugListPopover: View {
|
|||
private func formatted(_ date: Date) -> String {
|
||||
let seconds = Int(Date().timeIntervalSince(date))
|
||||
switch seconds {
|
||||
case ..<5: return "Just now"
|
||||
case ..<60: return "\(seconds)s ago"
|
||||
case ..<60: return "Just now"
|
||||
case ..<3600:
|
||||
let m = seconds / 60
|
||||
return m == 1 ? "1m ago" : "\(m)m ago"
|
||||
|
|
|
|||
Loading…
Reference in New Issue