diff options
| author | Christian Cleberg <[email protected]> | 2026-07-17 17:12:46 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-17 17:12:46 -0500 |
| commit | 277e2a7209047ed1514ea7b34034c510a4e51a4f (patch) | |
| tree | 3a0f5ae9c088a14f09831e23f8cb8608210d78cd /octosentry/SecurityEventListView.swift | |
| parent | 8e6d29f1806cc569b48d913564c7d80a1c2f2355 (diff) | |
| download | octosentry-0.5.0.tar.gz octosentry-0.5.0.tar.bz2 octosentry-0.5.0.zip | |
Add mark-seen action, critical-alert badge, and a dedicated window0.5.0
Closes #8-#10 (milestone 0.5.0).
- Mark-seen: each row gets a checkmark button (separate from the
click-to-open button) that persists the event into seenEventIDs and
removes it from the active stream immediately, no API write.
- Menu bar icon switches to a filled exclamation-shield with a red badge
showing the count of unseen critical alerts when any exist.
- Added a dedicated Window (singleton scene, not WindowGroup — avoids
spawning duplicates) opened via a header button, sharing the exact
same store/authStore instances as the popover. The button hides itself
when already viewing the standalone window.
Diffstat (limited to 'octosentry/SecurityEventListView.swift')
| -rw-r--r-- | octosentry/SecurityEventListView.swift | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/octosentry/SecurityEventListView.swift b/octosentry/SecurityEventListView.swift index 298aa2f..d817370 100644 --- a/octosentry/SecurityEventListView.swift +++ b/octosentry/SecurityEventListView.swift @@ -9,7 +9,9 @@ import SwiftUI struct SecurityEventListView: View { var store: SecurityEventStore var authStore: AuthStore + var isStandaloneWindow: Bool = false @State private var showingRepoManager = false + @Environment(\.openWindow) private var openWindow var body: some View { VStack(alignment: .leading, spacing: 0) { @@ -23,7 +25,6 @@ struct SecurityEventListView: View { content } } - .frame(width: 380, height: 420) .task(id: authStore.isSignedIn) { guard authStore.isSignedIn else { return } await store.refresh() @@ -66,6 +67,16 @@ struct SecurityEventListView: View { } if authStore.isSignedIn { + if !isStandaloneWindow { + Button { + openWindow(id: SecurityEventWindow.id) + } label: { + Image(systemName: "macwindow") + } + .buttonStyle(.plain) + .help("Open in Window") + } + Button { showingRepoManager.toggle() } label: { @@ -116,7 +127,9 @@ struct SecurityEventListView: View { Divider() } ForEach(store.events) { event in - SecurityEventRow(event: event) + SecurityEventRow(event: event) { + Task { await store.markSeen(event.id) } + } Divider() } } @@ -250,4 +263,5 @@ private struct StatusView: View { #Preview { SecurityEventListView(store: SecurityEventStore(), authStore: AuthStore()) + .frame(width: 380, height: 420) } |
