Skip to content

feat(ios): Live Activity for running queries and iPad multi-window support#1182

Merged
datlechin merged 8 commits intomainfrom
feat/multi-window-and-live-activity
May 10, 2026
Merged

feat(ios): Live Activity for running queries and iPad multi-window support#1182
datlechin merged 8 commits intomainfrom
feat/multi-window-and-live-activity

Conversation

@datlechin
Copy link
Copy Markdown
Member

@datlechin datlechin commented May 10, 2026

Summary

Two iOS-first features bundled because they share Info.plist edits and target a common goal of bringing the app onto more iPad surfaces.

Live Activity (iOS 16.1+)

Long-running queries now surface on the Lock Screen and Dynamic Island via ActivityKit:

  • Lock Screen: terminal icon, connection name, query preview (first 60 chars, monospaced), elapsed time, and streamed row count
  • Dynamic Island compact: terminal icon + elapsed time
  • Dynamic Island expanded: leading icon, trailing elapsed, center connection name, bottom row with query preview + row count

TableProWidget extension converts from a single @main Widget to @main WidgetBundle so it can ship both QuickConnectWidget and the new QueryLiveActivityWidget.

QueryActivityAttributes lives in TableProWidget/Shared/ and is in both the app target (to start/end the activity) and the widget target (to render). The pbxproj membershipExceptions for the app target gains the new file alongside the existing two shared files.

QueryEditorView.executeQueryDirect calls Activity.request(...) when execution starts and activity.end(...) in the defer block. When the user has Live Activities disabled in Settings the request silently no-ops via ActivityAuthorizationInfo().areActivitiesEnabled.

Info.plist gains NSSupportsLiveActivities = true.

Privacy toggle: Settings → Privacy adds "Hide query in Live Activities". When on, the lock screen and Dynamic Island show "Running query" instead of the SQL preview. Off by default.

iPad multi-window

Info.plist gains UIApplicationSceneManifest.UIApplicationSupportsMultipleScenes = true.

ConnectionListView.selectedConnectionIdString switches from @AppStorage to @SceneStorage so each window remembers its own selected connection across cold launches and Stage Manager rearrangement. The two preference flags lastFilterTagId and groupByGroup stay @AppStorage because tag filter and grouping are global preferences, not per-window state. The searchText keys in the Data Browser and Table List are already @SceneStorage.

AppState, coordinatorCache, and the appState.connections array are shared across windows by design - users want the same list of connections in every window.

Side fixes

  • SQLHighlightTextView keyboard accessory toolbar: revert from UIInputView back to plain UIView with .secondarySystemBackground, which resolves the keyboard layout constraint conflict logged on iOS 26.
  • ConnectionCoordinator.reconnectIfNeeded(): only set isReconnecting = true after the ping health check fails, so the "Reconnecting" chip no longer flashes during routine ping checks (e.g., after tapping a Live Activity).

Test plan

  • Run a SELECT that takes 5+ seconds: lock screen shows the activity, Dynamic Island shows compact + expanded states, query preview matches, elapsed time advances
  • Cancel via Stop button: activity dismisses immediately
  • Toggle off Live Activities in Settings → Notifications → TablePro: query runs without surfacing the activity, no crash
  • Toggle "Hide query in Live Activities" on, run a query: lock screen shows "Running query" instead of the SQL
  • iPad: drag a tab off the title bar to create a second window, pick a different connection in each window, both selections survive a relaunch (@SceneStorage per scene)
  • Stage Manager: arrange three TablePro windows side by side, each operates on its own connection independently
  • iPhone: behavior unchanged (single scene, full-screen)

@datlechin datlechin merged commit a21022d into main May 10, 2026
3 checks passed
@datlechin datlechin deleted the feat/multi-window-and-live-activity branch May 10, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant