Skip to content

refactor(ios): restructure app with TabView at root#680

Closed
datlechin wants to merge 0 commit intomainfrom
refactor/ios-tabview-root
Closed

refactor(ios): restructure app with TabView at root#680
datlechin wants to merge 0 commit intomainfrom
refactor/ios-tabview-root

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

Major architecture refactor: replaces NavigationSplitView + segmented control with TabView at the app root after connecting. This is the correct Apple pattern for tab-based navigation with NavigationStack per tab.

Before

NavigationSplitView
  ├── sidebar: ConnectionListView
  └── detail: NavigationStack → ConnectedView → segmented [Tables|Query]

After

[no activeConnection] → NavigationStack { ConnectionListView (full screen) }
[activeConnection]    → TabView (root)
                          ├── Tab "Tables": NavigationStack { TableListView → ... }
                          └── Tab "Query": NavigationStack { QueryEditorView → ... }

Changes

  • AppState: Added activeConnection: DatabaseConnection? to control root transition
  • ConnectedTabView (new): TabView with NavigationStack per tab, replaces ConnectedView
  • ConnectionListView: Removed NavigationSplitView, standalone list with Button taps
  • TableProMobileApp: New root conditional, deep-link/Handoff handlers set activeConnection
  • ConnectedView: Deleted (replaced by ConnectedTabView)

Benefits

  • Each tab owns its own NavigationStack — toolbar items propagate correctly
  • TabView preserves both tab contents in memory (query text survives tab switches)
  • No nested NavigationStack issues
  • "< Connections" button in toolbar to disconnect and return to connection list
  • Clean separation: connection list is the launch screen, TabView is the connected experience

Test plan

  • Launch → full-screen ConnectionListView with large title "Connections"
  • Tap connection → TabView with bottom tab bar (Tables/Query)
  • Tables tab: table list, tap → DataBrowserView pushes correctly with toolbar
  • Query tab: SQL editor with play button and overflow menu in toolbar
  • "< Connections" button → returns to connection list
  • Database switcher dropdown works on both tabs
  • Schema switcher appears only on Tables tab
  • Safe mode indicator visible
  • Query text preserved when switching tabs
  • Pull-to-refresh on table list works
  • Deep-link opens correct connection
  • Handoff works bidirectionally
  • Background → disconnect, foreground → reconnect

@datlechin datlechin closed this Apr 11, 2026
@datlechin datlechin force-pushed the refactor/ios-tabview-root branch from fbe773a to a28e2f9 Compare April 11, 2026 13:25
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