A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
feat: find connections by provider in command palette (#10749)
Shahmir Varqhad71a29f064fa
diff --git a/frontend/src/components/editor/actions/__tests__/types.test.ts b/frontend/src/components/editor/actions/__tests__/types.test.tsnew file mode 100644index 0000000000..760dd6bfa1--- /dev/null+++ b/frontend/src/components/editor/actions/__tests__/types.test.ts@@ -0,0 +1,44 @@+/* Copyright 2026 Marimo. All rights reserved. */++import { describe, expect, it, vi } from "vitest";+import type { ActionButton } from "../types";+import { flattenActions } from "../types";++const handle = vi.fn();++describe("flattenActions", () => {+ it("does not apply parent search keywords to child actions", () => {+ const actions: ActionButton[] = [+ {+ label: "Add remote storage",+ handle,+ additionalKeywords: ["s3", "gcs"],+ dropdown: [+ {+ label: "Browse all connections",+ handle,+ additionalKeywords: ["gcs", "drive"],+ },+ ],+ },+ ];++ expect(flattenActions(actions)).toEqual([+ expect.objectContaining({+ label: "Add remote storage > Browse all connections",+ additionalKeywords: ["gcs", "drive"],+ }),+ ]);+ });++ it("does not add an empty keyword array", () => {+ const actions: ActionButton[] = [{ label: "Run", handle }];++ expect(flattenActions(actions)).toEqual([+ expect.objectContaining({+ label: "Run",+ additionalKeywords: undefined,+ }),+ ]);+ });+});diff --git a/frontend/src/components/editor/actions/useNotebookActions.tsx b/frontend/src/components/editor/actions/useNotebookActions.tsxindex a4227a8f0c..0ccca730c2 100644--- a/frontend/src/components/editor/actions/useNotebookActions.tsx+++ b/frontend/src/components/editor/actions/useNotebookActions.tsx@@ -83,6 +83,8 @@ import { useChromeActions, useChromeState } from "../chrome/state";import { isPanelHidden, PANELS } from "../chrome/types";import { AddConnectionDialogContent } from "../connections/add-connection-dialog";import { useAddDetectedDataSource } from "../connections/components";+import { DATABASE_CONNECTION_KEYWORDS } from "../connections/database/add-database-form";+import { STORAGE_CONNECTION_KEYWORDS } from "../connections/storage/add-storage-form";import { keyboardShortcutsAtom } from "../controls/keyboard-shortcuts";import { commandPaletteAtom } from "../controls/state";import { displayLayoutName, getLayoutIcon } from "../renderers/layout-select";@@ -152,6 +154,16 @@ export function useNotebookActions({const sharingWasmEnabled = resolvedConfig.sharing?.wasm ?? true;const sharingMolabEnabled = resolvedConfig.sharing?.molab ?? true;const isSlidesLayout = selectedLayout === "slides";+ const databaseConnectionKeywords = [+ "db",+ "sql",+ ...DATABASE_CONNECTION_KEYWORDS,+ ];+ const storageConnectionKeywords = [+ "bucket",+ "object storage",+ ...STORAGE_CONNECTION_KEYWORDS,+ ];const renderCheckboxElement = (checked: boolean) => (<div className="w-8 flex justify-end">@@ -458,6 +470,7 @@ export function useNotebookActions({{icon: <DatabaseIcon size={14} strokeWidth={1.5} />,label: "Add database connection",+ additionalKeywords: databaseConnectionKeywords,handle: () => {openModal(<AddConnectionDialogContent onClose={closeModal} />);},@@ -475,6 +488,7 @@ export function useNotebookActions({divider: true,icon: <DatabaseIcon size={14} strokeWidth={1.5} />,label: "Browse all connections",+ additionalKeywords: databaseConnectionKeywords,handle: () => {openModal(<AddConnectionDialogContent onClose={closeModal} />,@@ -486,6 +500,7 @@ export function useNotebookActions({{icon: <HardDrive size={14} strokeWidth={1.5} />,label: "Add remote storage",+ additionalKeywords: storageConnectionKeywords,handle: () => {openModal(<AddConnectionDialogContent@@ -508,6 +523,7 @@ export function useNotebookActions({divider: true,icon: <HardDrive size={14} strokeWidth={1.5} />,label: "Browse all connections",+ additionalKeywords: storageConnectionKeywords,handle: () => {openModal(<AddConnectionDialogContentdiff --git a/frontend/src/components/editor/chrome/types.ts b/frontend/src/components/editor/chrome/types.tsindex 3de3c0b1e9..7ca8534fa8 100644--- a/frontend/src/components/editor/chrome/types.ts+++ b/frontend/src/components/editor/chrome/types.ts@@ -73,7 +73,7 @@ export const PANELS: PanelDescriptor[] = [type: "files",Icon: FolderTreeIcon,label: "Files",- tooltip: "View files",+ tooltip: "View files and remote storage",defaultSection: "sidebar",additionalKeywords: ["explorer", "browser", "directory"],},diff --git a/frontend/src/components/editor/connections/database/add-database-form.tsx b/frontend/src/components/editor/connections/database/add-database-form.tsxindex 144eff3fcc..83e72aff34 100644--- a/frontend/src/components/editor/connections/database/add-database-form.tsx+++ b/frontend/src/components/editor/connections/database/add-database-form.tsx@@ -220,6 +220,10 @@ const DATA_CATALOGS = [const ALL_ENTRIES = [...DATABASES, ...DATA_CATALOGS];+export const DATABASE_CONNECTION_KEYWORDS = [+ ...new Set(ALL_ENTRIES.flatMap(({ name, logo }) => [name, logo])),+];+const DatabaseSchemaSelector: React.FC<{onSelect: (schema: z.ZodType<DatabaseConnection, FieldValues>) => void;}> = ({ onSelect }) => {diff --git a/frontend/src/components/editor/connections/storage/add-storage-form.tsx b/frontend/src/components/editor/connections/storage/add-storage-form.tsxindex bac7674a69..efade6c1b1 100644--- a/frontend/src/components/editor/connections/storage/add-storage-form.tsx+++ b/frontend/src/components/editor/connections/storage/add-storage-form.tsx@@ -101,6 +101,12 @@ const STORAGE_PROVIDERS = [},] satisfies StorageProviderSchema[];+export const STORAGE_CONNECTION_KEYWORDS = [+ ...new Set(+ STORAGE_PROVIDERS.flatMap(({ name, protocol }) => [name, protocol]),+ ),+];+const StorageProviderSelector: React.FC<{onSelect: (schema: z.ZodType<StorageConnection, FieldValues>) => void;}> = ({ onSelect }) => {