Quick Switcher revamp: floating panel, fuzzy engine, frecency ranking#1644
Quick Switcher revamp: floating panel, fuzzy engine, frecency ranking#1644datlechin wants to merge 6 commits into
Conversation
…d frecency ranking
… demand, opens full history queries
…boost, and row actions
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1871f30b4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| init(contentView: NSView) { | ||
| super.init( | ||
| contentRect: NSRect(origin: .zero, size: contentView.fittingSize), |
There was a problem hiding this comment.
Resize the panel after async content loads
When the quick switcher is opened before its items finish loading, the panel frame is fixed from the initial loading view's fittingSize; after QuickSwitcherPanelView switches to the taller results list there is no code that updates the NSPanel frame, and the borderless panel is not user-resizable. In that common uncached/async-load path, the list/footer can be clipped to the loading-height window until the panel is recreated, so the panel should observe the hosting view's size/preferredContentSize and call setFrame/re-anchor when it changes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f20daefd1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let openTableNames = Set( | ||
| tabManager.tabs | ||
| .filter { $0.tabType == .table } | ||
| .compactMap(\.tableContext.tableName) | ||
| ) |
There was a problem hiding this comment.
Key open-tab markers by database/schema
In contexts where tabs from another database or schema can remain open, this collects only bare table names even though tab activation later compares databaseName and schemaName. QuickSwitcherViewModel.loadItems then uses openTableNames.contains(table.name), so a closed users table in the current database/schema is shown and boosted as already “Open” whenever any other users tab exists. Please key this by the same database/schema/table identity used for tab matching.
Useful? React with 👍 / 👎.
What
Full revamp of the Quick Switcher (Cmd+Shift+O), in 5 commits that each build and test on their own.
Matching engine
FuzzyMatcherrewritten as an fzy-style dynamic program with affine gap penalties. It finds the best alignment instead of the first one, returns matched character indices, and treats_ . - / $and camelCase transitions as word boundaries. Candidates over 1024 chars fall back to the old greedy pass.QuickSwitcherFrecencyStore: Firefox-style recency buckets (4/14/31/90 days), 10 samples per item, 100 items per connection. Migrates the old MRU list and removes it.Surface
NSPanelanchored 20% from the top of the window, not a modal sheet. It dismisses on Escape and on losing key focus.ActiveSheet.quickSwitcheris gone.unemphasizedSelectedContentBackgroundColorwash, like real Spotlight; text does not invert and there is no accent fill. Matched characters render semibold.NSGlassEffectViewon macOS 26,NSVisualEffectView(.popover) on macOS 14/15.Corpus and freshness
SQLSchemaProvider.loadSchemawhen the table cache is empty, so the panel no longer opens with zero tables before autocomplete has warmed up. Concurrent callers coalesce on the provider's in-flight task.SQLFavorite) join the corpus. History items carry the full query in a newpayloadfield, so opening one loads the real query instead of the 100-char preview.Actions
forceNewWindowTabonopenTableTab).Openbadge, a 1.2x rank boost, and Return focuses the existing tab.Consolidation
upvfindsuser_profile_vieweverywhere. The database switcher also ranks by score.Out of scope, deliberate
Testing
swiftlint lint --strictclean on every touched file (SidebarViewModelTests has pre-existing strict violations, untouched).