Skip to content

Fix quick navigator database selection - #597

Merged
debba merged 3 commits into
TabularisDB:mainfrom
DhruvShah-Dev:fix-quick-navigator-live-databases
Aug 14, 2026
Merged

Fix quick navigator database selection#597
debba merged 3 commits into
TabularisDB:mainfrom
DhruvShah-Dev:fix-quick-navigator-live-databases

Conversation

@DhruvShah-Dev

Copy link
Copy Markdown
Contributor

Summary

  • use the provider's live selectedDatabases list for quick navigator multi-database items
  • align quick navigator multi-database branching with usesMultiDatabaseLayout
  • add regression coverage for stale database data being ignored

Testing

  • pnpm.cmd exec vitest run tests/utils/quickNavigator.test.ts --pool=forks --maxWorkers=1
  • pnpm.cmd typecheck
  • pnpm.cmd lint
  • pnpm.cmd build

Fixes #591

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @DhruvShah-Dev, I reviewed this one locally too. The fix itself is exactly right, and honestly this is the better of your two takes on #591: you memoized isMultiDb and used it consistently in the click handlers as well, so table refs get quoted the same way the rest of the app decides multi-db layout. All 9 tests pass on your branch, including the new regression test for stale database data, which is a nice touch.

The problem is timing: the command palette refactor merged on Aug 10 (778b5cc, ff51644) deleted QuickNavigatorModal.tsx entirely, so this branch is now conflicting and the main file it patches no longer exists.

The good news is that the bug is still alive on current main and your fix ports over cleanly:

  • The logic moved to src/hooks/useCommandPaletteObjectItems.ts, which still does getDatabaseList(connection?.params.database) (around line 95). On current main, ConnectionData in the provider already carries selectedDatabases per connection, so you can read connectionData?.selectedDatabases right there. It's actually a nicer fit than the old modal, because the hook is per-connection.
  • While you're at it, isMultiDatabaseCapable(connectionData?.capabilities) in that hook should become usesMultiDatabaseLayout(capabilities, selectedDatabases) to match the sidebar and the editor.
  • Your quickNavigator.ts param rename (configuredDatabases to selectedDatabases) and the regression test still apply almost as-is. The util was reshaped into a groups/flatMap structure on main, but the semantics are unchanged, so it's just a mechanical adjustment.

One more thing: #613 includes a subset of this same fix, so both PRs claim #591. I'd consolidate on this one since it's the more complete version, and drop the navigator changes from #613 (see my review over there).

So: rework on top of current main targeting useCommandPaletteObjectItems.ts, keep the test, and this should go in quickly. Thanks for the patience with the moving target, the palette refactor landed right under your feet.

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for porting the fix to the command palette flow. The implementation now uses the live per-connection selected database list, aligns multi-database detection with the rest of the app, and includes regression coverage ensuring stale cached database data is ignored. Verified locally: 7/7 targeted tests pass, typecheck passes, and lint passes. Looks good to merge.

@debba
debba merged commit 39678ac into TabularisDB:main Aug 14, 2026
1 check passed
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.

Object palette reads the database list from connection params instead of the live selection

2 participants