Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements a database switcher feature that allows users to quickly switch between databases on the same server, similar to TablePlus's "Open database" feature (⌘K). The implementation adds a modal sheet UI for database selection with keyboard navigation and search functionality.
Key changes:
- Added a DatabaseSwitcherSheet modal with search, keyboard navigation, and database selection UI
- Implemented
fetchDatabases()method across all database drivers (MySQL, PostgreSQL, SQLite) - Added database name display in the toolbar with clickable UI to open the switcher
- Integrated focused values to manage ESC key behavior when sheets are open
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| DatabaseSwitcherSheet.swift | New modal sheet component for database switching with search and keyboard navigation |
| OpenTableApp.swift | Refactored pasteboard commands to support focused values and added ⌘K shortcut for database switcher |
| MainContentView.swift | Added database switcher state management and connection switching logic |
| ConnectionStatusView.swift | Added clickable database name section in toolbar |
| OpenTableToolbarView.swift | Passed database name to ConnectionStatusView |
| ConnectionSidebarHeader.swift | Changed display from connection name to database name |
| PostgreSQLDriver.swift | Implemented fetchDatabases() using pg_database query |
| MySQLDriver.swift | Implemented fetchDatabases() using SHOW DATABASES |
| SQLiteDriver.swift | Implemented fetchDatabases() returning empty array (file-based) |
| DatabaseDriver.swift | Added fetchDatabases() protocol requirement |
| FocusedValues+Extensions.swift | New file defining isDatabaseSwitcherOpen focused value key |
| ConnectionToolbarState.swift | Added databaseName property to state |
| ContentView.swift | Enhanced ESC key handling to respect sheet presentation state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Refactor DatabaseSwitcherSheet to use custom listRowBackground with native selection color instead of focus-dependent List selection - Fix scroll-to-selection timing by adding delay for List rendering - Unify all row deletion paths to use notification system, fixing bug where deleting newly added rows only cleared background but didn't remove the row from the data source - Remove unused deleteRow/deleteRows methods from TableViewCoordinator
- Simplify fetchDatabases() using flatMap instead of redundant nil coalescing - Restore missing listRowInsets in DatabaseSwitcherSheet - Show error alert when database switch fails instead of just logging - Remove xcuserstate from git tracking (already in .gitignore)
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.