git.iko.soy/parseable-macos
on master help sign in
Add Cmd+R keyboard shortcut to refresh the current query (#30)

Cmd+R now re-executes the current query in QueryView via a queryRefreshToken on AppState. The previous "Refresh Streams" shortcut moves to Cmd+Shift+R. https://claude.ai/code/session_01MA9bNZardyun2c8ispbkha Co-authored-by: Claude <noreply@anthropic.com>

commit4c2254e818a4f54bd0053a57865ee893c8e5a6df authoriko <mail@iko.soy> dateSun 15 Feb 2026, 19:49 (8 months ago) parentc70284f
3 files changed+19−1
ParseableViewer/App/AppState.swift+4 ParseableViewer/App/ParseableViewerApp.swift+7−1 ParseableViewer/Views/QueryView.swift+8
ParseableViewer/App/AppState.swift+4
@@ -37,6 +37,10 @@ final class AppState {
3737 /// Set by sidebar when user clicks a saved query; consumed by QueryView.
3838 var pendingSavedQuery: SavedQuery?
3939
40+ // MARK: - Query Refresh
41+ /// Incremented by the Cmd+R shortcut; QueryView observes changes to re-execute the current query.
42+ var queryRefreshToken = UUID()
43+
4044 enum AppTab: String, CaseIterable, Identifiable {
4145 case query = "Query"
4246 case liveTail = "Live Tail"
ParseableViewer/App/ParseableViewerApp.swift+7−1
@@ -22,12 +22,18 @@ struct ParseableViewerApp: App {
2222
2323 Divider()
2424
25+ Button("Refresh Query") {
26+ appState.queryRefreshToken = UUID()
27+ }
28+ .keyboardShortcut("r", modifiers: [.command])
29+ .disabled(!appState.isConnected)
30+
2531 Button("Refresh Streams") {
2632 Task {
2733 await appState.refreshStreams()
2834 }
2935 }
30− .keyboardShortcut("r", modifiers: [.command])
36+ .keyboardShortcut("r", modifiers: [.command, .shift])
3137 .disabled(!appState.isConnected)
3238 }
3339
ParseableViewer/Views/QueryView.swift+8
@@ -287,6 +287,14 @@ struct QueryView: View {
287287 viewModel.cancelQuery()
288288 }
289289 }
290+ .onChange(of: appState.queryRefreshToken) { _, _ in
291+ Task {
292+ await viewModel.executeQuery(
293+ client: appState.client,
294+ stream: appState.selectedStream
295+ )
296+ }
297+ }
290298 .onChange(of: appState.pendingSavedQuery) { _, newQuery in
291299 if let query = newQuery {
292300 viewModel.sqlQuery = query.sql