Skip to content

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.

929 B
Raw Blame
/* Copyright 2026 Marimo. All rights reserved. */

import {
  expandAccordionSection,
  fileExplorerPanelAtom,
  sessionPanelAtom,
} from "@/components/editor/chrome/panels/panel-accordion-state";
import { openPanel } from "@/components/editor/chrome/state";
import { assertNever } from "@/utils/assertNever";
import type { CodeLensKind } from "./entities";

/**
 * Opens the panel associated with a code lens target, expanding the accordion
 * section that holds it.
 */
export function openLensTarget(kind: CodeLensKind): void {
  switch (kind) {
    case "table":
    case "connection":
      openPanel("variables");
      expandAccordionSection(sessionPanelAtom, "datasources");
      return;
    case "bucket":
      openPanel("files");
      expandAccordionSection(fileExplorerPanelAtom, "remote-storage");
      return;
    case "cache":
      openPanel("cache");
      return;
    default:
      assertNever(kind);
  }
}