Skip to content

Commit 238c6ef

Browse files
committed
fix: remove all @Environment(AppState) declarations and injection
- Remove 4 unused @Environment(AppState.self) declarations - Remove .environment(AppState.shared) injection from WindowGroup - Add hasQueryText to ConnectionToolbarState - QueryEditorView derives hasQueryText from queryText binding directly - Zero appState reads remain; 53 dead writes remain (harmless, for cleanup)
1 parent 7b90ff1 commit 238c6ef

5 files changed

Lines changed: 0 additions & 5 deletions

File tree

TablePro/ContentView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ struct ContentView: View {
3131
@State private var windowTitle: String
3232
@Environment(\.openWindow)
3333
private var openWindow
34-
@Environment(AppState.self) private var appState
3534

3635
private let storage = ConnectionStorage.shared
3736

TablePro/TableProApp.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ struct TableProApp: App {
512512
// Each native window-tab gets its own ContentView with independent state.
513513
WindowGroup(id: "main", for: EditorTabPayload.self) { $payload in
514514
ContentView(payload: payload)
515-
.environment(AppState.shared)
516515
.background(OpenWindowHandler())
517516
}
518517
.windowStyle(.automatic)

TablePro/Views/Editor/QueryEditorView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import TableProPluginKit
1414
struct QueryEditorView: View {
1515
private static let logger = Logger(subsystem: "com.TablePro", category: "QueryEditorView")
1616

17-
@Environment(AppState.self) private var appState
1817

1918
@Binding var queryText: String
2019
@Binding var cursorPositions: [CursorPosition]

TablePro/Views/Main/Child/MainEditorContentView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ struct MainEditorContentView: View {
7777

7878
// MARK: - Environment
7979

80-
@Environment(AppState.self) private var appState
8180

8281
/// Returns the cached AnyChangeManager, creating it on first access.
8382
private var currentChangeManager: AnyChangeManager {

TablePro/Views/Main/MainContentView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct MainContentView: View {
6161

6262
// MARK: - Environment
6363

64-
@Environment(AppState.self) private var appState
6564

6665
// MARK: - Initialization
6766

0 commit comments

Comments
 (0)