Skip to content

refactor(database-switcher): rebuild as native macOS popover anchored to toolbar#1274

Merged
datlechin merged 3 commits into
mainfrom
refactor/database-switcher-native-popover
May 15, 2026
Merged

refactor(database-switcher): rebuild as native macOS popover anchored to toolbar#1274
datlechin merged 3 commits into
mainfrom
refactor/database-switcher-native-popover

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

  • Database switcher: replaced the modal .sheet with a native NSPopover-equivalent anchored to the ⌘K toolbar button. Selection-as-action (click row to switch), no Cancel/Open footer. Search field, Refresh, Drop, and New Database all available within the popover.
  • Create Database sheet: removed NavigationStack and .formStyle(.grouped) (iOS-style with dark-mode background bug). Replaced with manual VStack + .formStyle(.columns) matching Mail "New Mailbox" / System Settings "Add Network" pattern. Width 380pt, hug-content height.
  • Drop Database: deleted the custom DropDatabaseSheet. Replaced with native .confirmationDialog attached to the main view.

Backup/restore flows

DatabaseSwitcherSheet slimmed to backup/restore handoff only — wrapped in NavigationStack with .cancellationAction / .confirmationAction toolbar items, checkmark indicator instead of custom "current" pill.

Test plan

  • Press ⌘K — popover opens anchored to the database toolbar button
  • Click the chip in the toolbar center — same popover opens, anchored to ⌘K button
  • Switch tab Databases ↔ Schemas — popover stays the same size (no reflow)
  • Type in search field — list filters in real time, text size matches body font
  • Press ↑ ↓ — list navigation works from search field
  • Press Return — switches to selected database/schema and dismisses
  • Press Esc with text — clears search; press Esc empty — dismisses popover
  • Click "+ New Database…" — popover dismisses, Create Database sheet opens from main window
  • Create Database sheet renders correctly in both light and dark mode (no white background bug)
  • Right-click a non-current database row — "Drop Database…" context menu appears, confirmation dialog is native style
  • PostgreSQL backup/restore flow still works (uses DatabaseSwitcherSheet)
  • ⌘N inside popover opens Create Database; ⌘R refreshes the list

@datlechin datlechin merged commit 251d447 into main May 15, 2026
1 check was pending
@datlechin datlechin deleted the refactor/database-switcher-native-popover branch May 15, 2026 08:05
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