Skip to content

All-databases mode: empty selection loads every database automatically - #572

Merged
debba merged 2 commits into
feat/connection-test-uxfrom
feat/all-databases-mode
Aug 1, 2026
Merged

All-databases mode: empty selection loads every database automatically#572
debba merged 2 commits into
feat/connection-test-uxfrom
feat/all-databases-mode

Conversation

@debba

@debba debba commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

TablePro-style "leave it empty to browse everything" for multi-database drivers: a connection can now be saved without selecting any database, and the client loads the full server list dynamically at connect — new databases show up on their own, dropped ones disappear, no connection editing needed. An explicit selection remains available as an opt-in filter.

Stacked on #570. Retarget to main once it merges.

UX

  • Databases tab: mode switch between All databases (default for new connections) and Choose databases (existing list + search + select-all). The "select at least one database" save-block only applies to explicit mode.
  • Connection cards/list: an all-databases connection is labeled ("All databases" / "Tutti i database") instead of showing a dangling host:port · separator — and the previously hard-coded "N databases" counter is now localized.
  • Editing an all-databases connection no longer auto-fetches the database list on dialog open (which could silently spawn SSH/K8s tunnels).

Mechanics

  • Persisted as an empty database param. On connect, get_available_databases provides the list; the sidebar refresh button re-syncs it (nothing persisted) and toasts +added / -removed. Choosing a subset from the sidebar manage popover persists it and exits the mode.
  • build_mysql_options skips .database(...) when empty — it now means "no default schema" instead of a handshake rejected with Unknown database ''. ⚠️ GitNexus flags this symbol as HIGH impact (24 direct callers: pools, test, explain, dump); the change is a pure domain extension — behavior for any non-empty database is untouched, covered by 2 new unit tests plus the full suite.
  • New shared usesMultiDatabaseLayout helper replaces the seven scattered selectedDatabases.length > 1 gates (sidebar, editor, notebooks, autocomplete, window title): the multi-db presentation now turns on for any non-empty runtime selection, so an all-databases connection with a single database still issues db-qualified queries (it has no default schema). Side benefit: a multi-db connection narrowed to one database keeps its tree and manage button instead of losing them.

i18n

New keys in all 11 locales, including the Databases-tab hints that previously existed only as English defaultValues.

Test plan

  • pnpm vitest run — 3417 green (new: all-databases subtitle labels, usesMultiDatabaseLayout).
  • cargo test --lib — 1044 green (new: .database(...) skipped when empty / kept when set).
  • Manual: create MySQL connection without picking databases → connect shows every database; CREATE DATABASE elsewhere + sidebar refresh → appears; pick subset via manage popover → persists and exits all-mode; re-open modal → "Choose databases" preselected.

const subtitle = connectionSubtitle(conn, capabilities, {
allDatabases: t("newConnection.allDatabases"),
databaseCount: (count) =>
t("connections.databaseCount", { count, defaultValue: "{{count}} databases" }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: i18n key mismatch - connections.databaseCount does not exist

The code references t("connections.databaseCount", ...) but this key was never added to any locale. The PR added databaseCount_one / databaseCount_other at the root level, yet they remain unused because the lookup points to a non-existent nested key. As a result, the database count subtitle always falls back to the hardcoded English defaultValue and never picks up localized plural forms.

Suggested change
t("connections.databaseCount", { count, defaultValue: "{{count}} databases" }),
databaseCount: (count) =>
t("databaseCount", { count, defaultValue: "{{count}} databases" }),

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

const subtitle = connectionSubtitle(conn, capabilities, {
allDatabases: t("newConnection.allDatabases"),
databaseCount: (count) =>
t("connections.databaseCount", { count, defaultValue: "{{count}} databases" }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: i18n key mismatch - connections.databaseCount does not exist

The code references t("connections.databaseCount", ...) but this key was never added to any locale. The PR added databaseCount_one / databaseCount_other at the root level, yet they remain unused because the lookup points to a non-existent nested key. As a result, the database count subtitle always falls back to the hardcoded English defaultValue and never picks up localized plural forms.

Suggested change
t("connections.databaseCount", { count, defaultValue: "{{count}} databases" }),
databaseCount: (count) =>
t("databaseCount", { count, defaultValue: "{{count}} databases" }),

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@@ -2157,6 +2188,7 @@ export const NewConnectionModal = ({

if (parsedIsMultiDb && parsed.database) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: Missing loadAllDatabases initialization for empty multi-db import

When importing a connection string for a multi-db driver without a database value, the if (parsedIsMultiDb && parsed.database) guard skips the empty case and leaves loadAllDatabases with its previous state. Add an else if branch to set the all-databases mode explicitly.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src/components/modals/NewConnectionModal.tsx

Fix these issues in Kilo Cloud

Previous Review Summaries (2 snapshots, latest commit 4441615)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 4441615)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 1
Issue Details (click to expand)

WARNING

File Line Issue
src/components/modals/NewConnectionModal.tsx 2274 Missing loadAllDatabases initialization when importing empty database for multi-db driver
Files Reviewed (52 files)
  • src/components/modals/NewConnectionModal.tsx - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit fa72ab0)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
src/components/connections/ConnectionCard.tsx 62 connections.databaseCount i18n key does not exist; added databaseCount_one/other keys are unused
src/components/connections/ConnectionListItem.tsx 62 connections.databaseCount i18n key does not exist; added databaseCount_one/other keys are unused

SUGGESTION

File Line Issue
src/components/modals/NewConnectionModal.tsx 2189 Missing loadAllDatabases initialization when importing empty database for multi-db driver
Files Reviewed (28 files)
  • src-tauri/src/pool_manager.rs - 0 issues
  • src-tauri/src/pool_manager_tests.rs - 0 issues
  • src/components/connections/ConnectionCard.tsx - 1 issue
  • src/components/connections/ConnectionListItem.tsx - 1 issue
  • src/components/layout/ExplorerSidebar.tsx - 0 issues
  • src/components/modals/NewConnectionModal.tsx - 1 issue
  • src/components/notebook/NotebookCellHeader.tsx - 0 issues
  • src/components/notebook/NotebookView.tsx - 0 issues
  • src/contexts/DatabaseContext.ts - 0 issues
  • src/contexts/DatabaseProvider.tsx - 0 issues
  • src/hooks/useSqlAutocompleteRegistration.ts - 0 issues
  • src/i18n/locales/de.json - 0 issues
  • src/i18n/locales/en.json - 0 issues
  • src/i18n/locales/es.json - 0 issues
  • src/i18n/locales/fr.json - 0 issues
  • src/i18n/locales/it.json - 0 issues
  • src/i18n/locales/ja.json - 0 issues
  • src/i18n/locales/ko.json - 0 issues
  • src/i18n/locales/pt-BR.json - 0 issues
  • src/i18n/locales/ru.json - 0 issues
  • src/i18n/locales/tl.json - 0 issues
  • src/i18n/locales/zh.json - 0 issues
  • src/pages/Editor.tsx - 0 issues
  • src/utils/connections.ts - 0 issues
  • src/utils/database.ts - 0 issues
  • tests/utils/connections.test.ts - 0 issues
  • tests/utils/database.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by ling-3.0-flash-free · Input: 39.3K · Output: 10.9K · Cached: 284K

…thing)

Multi-database connections no longer require picking databases up front:

- The Databases tab gets a mode switch — "All databases" (new default) vs
  "Choose databases" (the existing explicit selection). All-databases
  connections persist an empty database param.
- On connect, an empty selection fetches the full server list, so
  databases created or dropped outside the app appear on their own; the
  sidebar refresh re-syncs the list without persisting anything.
- Picking a subset from the sidebar manage popover persists it and
  leaves all-databases mode; the connection modal is the way back.
- build_mysql_options skips `.database(...)` when empty: it now means
  "connect with no default schema" instead of a rejected handshake.
- The multi-database presentation gates (sidebar tree, editor, notebook,
  autocomplete, window title) move to a shared usesMultiDatabaseLayout
  helper that turns on for any non-empty runtime selection, so a
  one-database server still gets db-qualified queries.
- Connection cards/list label all-databases connections instead of
  showing a dangling separator, and the previously untranslated
  "N databases" counter and Databases-tab hints are now localized in all
  11 locales.
- Editing a connection in all-databases mode no longer auto-fetches the
  database list (which could spawn SSH/K8s tunnels on dialog open).
@debba
debba force-pushed the feat/all-databases-mode branch from fa72ab0 to 4441615 Compare July 31, 2026 21:17

@kilo-code-bot kilo-code-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Missing loadAllDatabases initialization when importing empty database for multi-db driver

When importing a connection string for a multi-db driver without a database value, the if (parsedIsMultiDb && parsed.database) guard skips the empty case and leaves loadAllDatabases with its previous state. Add an else if branch to set the all-databases mode explicitly when parsedIsMultiDb && !parsed.database.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@@ -2242,6 +2273,7 @@ export const NewConnectionModal = ({

if (parsedIsMultiDb && parsed.database) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Missing loadAllDatabases initialization when importing empty database for multi-db driver

When importing a connection string for a multi-db driver without a database value, the if (parsedIsMultiDb && parsed.database) guard skips the empty case and leaves loadAllDatabases with its previous state. Add an else if branch to set the all-databases mode explicitly when parsedIsMultiDb && !parsed.database.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@TabularisDB TabularisDB deleted a comment from kilo-code-bot Bot Jul 31, 2026
… database

A multi-db connection string without a database left loadAllDatabases at
its previous value, so a form already in "Choose databases" ended up in
explicit mode with an empty selection (save blocked). Set all-databases
mode explicitly and skip the picker fetch, which can spawn SSH/K8s
tunnels, in that case.
@debba
debba merged commit 5110f3e into main Aug 1, 2026
2 checks 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.

1 participant