@marimo-team/frontend 0.18.5-dev184 → 0.18.5-dev187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/assets/{CellStatus-DqLx71xI.js → CellStatus-Bo1x1B6n.js} +1 -1
  2. package/dist/assets/{JsonOutput-3u2O9mUd.js → JsonOutput-BCHaEg3R.js} +1 -1
  3. package/dist/assets/MarimoErrorOutput-BIIhR96K.js +7 -0
  4. package/dist/assets/{RenderHTML-Dp8s4Bzr.js → RenderHTML-BUhX0rkG.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-DTIq0l6h.js → add-cell-with-ai-CLrEdPGH.js} +1 -1
  6. package/dist/assets/{add-database-form-C20ZnUUx.js → add-database-form-DkSxzOXk.js} +1 -1
  7. package/dist/assets/{agent-panel-D08HI0-X.js → agent-panel-Bz7HLWO3.js} +2 -2
  8. package/dist/assets/{ai-model-dropdown-CK5sei5N.js → ai-model-dropdown-ea-cOLAL.js} +1 -1
  9. package/dist/assets/{app-config-button-Ce5Tkr5O.js → app-config-button-BFjdAlTt.js} +1 -1
  10. package/dist/assets/{cell-link-B7EjqLUL.js → cell-link-DNVmmRzI.js} +1 -1
  11. package/dist/assets/{cells-BLhvmrVl.js → cells-Dk_j8HX9.js} +50 -50
  12. package/dist/assets/{chat-components-DHkUyXWV.js → chat-components-BMWBGknq.js} +1 -1
  13. package/dist/assets/{chat-display-DZMIiHZy.js → chat-display-CEYX5MXY.js} +1 -1
  14. package/dist/assets/{chat-panel-Bm-_lPiR.js → chat-panel-DmUjYxAt.js} +1 -1
  15. package/dist/assets/{client-hHcgVFo7.js → client-D08Rbi3p.js} +1 -1
  16. package/dist/assets/{column-preview-B1AyyIgE.js → column-preview-Cqovvoyb.js} +1 -1
  17. package/dist/assets/{command-CDWT71Ts.js → command-gUA-HncX.js} +1 -1
  18. package/dist/assets/{command-palette-BcPZK2Wg.js → command-palette-Dt43cGFk.js} +1 -1
  19. package/dist/assets/{common-4ZdFNk6L.js → common-BWR26KIv.js} +1 -1
  20. package/dist/assets/{datasource-DNy_uzDr.js → datasource-i415crE1.js} +1 -1
  21. package/dist/assets/dependency-graph-panel-BwaKuCE7.js +4 -0
  22. package/dist/assets/{documentation-panel-BRHbbFlV.js → documentation-panel-C4aTmugE.js} +1 -1
  23. package/dist/assets/{download-DPiYP-j0.js → download-Dsuja3On.js} +1 -1
  24. package/dist/assets/edit-page-sCQCmucY.js +12 -0
  25. package/dist/assets/{error-panel-qGIXpWqc.js → error-panel-DCozbyWc.js} +1 -1
  26. package/dist/assets/{es-CR1H2K7u.js → es-DjCjT1hB.js} +1 -1
  27. package/dist/assets/{file-explorer-panel-DdOLBo1H.js → file-explorer-panel-BvRpCXWv.js} +1 -1
  28. package/dist/assets/{floating-outline-foC3RCPc.js → floating-outline-DYdnwTX9.js} +1 -1
  29. package/dist/assets/{focus-CgHW_IRL.js → focus-U1ePwk4d.js} +1 -1
  30. package/dist/assets/{form-NWifpNWT.js → form-D8BW7hlS.js} +1 -1
  31. package/dist/assets/{globals-CiRTn5Vt.js → globals-BBskDqJi.js} +1 -1
  32. package/dist/assets/{home-page-WElJkZm5.js → home-page-c43aYnLs.js} +1 -1
  33. package/dist/assets/index-BIeqDcea.css +2 -0
  34. package/dist/assets/{index-3FOfqUYt.js → index-DuCNx6yI.js} +3 -3
  35. package/dist/assets/{kiosk-mode-vS4t3di8.js → kiosk-mode-C23fjW_G.js} +1 -1
  36. package/dist/assets/{layout-D1qNIXxE.js → layout-DenYhPfS.js} +1 -1
  37. package/dist/assets/{logs-panel-BUqhCH8r.js → logs-panel-CmImbuAp.js} +1 -1
  38. package/dist/assets/{markdown-renderer-DgV_KnEf.js → markdown-renderer-COkLQ1b5.js} +1 -1
  39. package/dist/assets/{mode-BeOhz3YE.js → mode-BOijHAOc.js} +1 -1
  40. package/dist/assets/{name-cell-input-lVGcUDBb.js → name-cell-input-Cf2CUXDm.js} +1 -1
  41. package/dist/assets/{outline-panel-DHLUaY4X.js → outline-panel-CdaUT0TE.js} +1 -1
  42. package/dist/assets/{packages-panel-DhVyvWkj.js → packages-panel-CghFsvM0.js} +1 -1
  43. package/dist/assets/{panel-context-B3nGD1_W.js → panel-context-DUUPei-R.js} +1 -1
  44. package/dist/assets/{panels-BMfGXS7h.js → panels-CymS0QU-.js} +1 -1
  45. package/dist/assets/{process-output-C2mignv4.js → process-output-BAfpcew-.js} +1 -1
  46. package/dist/assets/{readonly-python-code-C3URGhHv.js → readonly-python-code-B8gfuyX1.js} +1 -1
  47. package/dist/assets/{run-page-BqTaOWHL.js → run-page-rr9Ilre7.js} +1 -1
  48. package/dist/assets/{scratchpad-panel-5FCgSkW8.js → scratchpad-panel-fzQUjA3o.js} +1 -1
  49. package/dist/assets/{session-panel-6od-_OeM.js → session-panel-BsMBi24k.js} +1 -1
  50. package/dist/assets/{snippets-panel-CAAC62vz.js → snippets-panel-DW6lWuPh.js} +1 -1
  51. package/dist/assets/{state-CGIjjAWG.js → state-DWEWL_KV.js} +1 -1
  52. package/dist/assets/{state-CoslvOiH.js → state-HUtu_wpA.js} +1 -1
  53. package/dist/assets/{switch-BLEwkiUl.js → switch-Cd5iA-KH.js} +1 -1
  54. package/dist/assets/{textarea-S24k5l8r.js → textarea-jTWtOsHe.js} +1 -1
  55. package/dist/assets/{tracing-Cl31yJ-W.js → tracing-CDJRdFd4.js} +1 -1
  56. package/dist/assets/{tracing-panel-Cw103_Tm.js → tracing-panel-BrBmQCJr.js} +2 -2
  57. package/dist/assets/{types-DiksLxkJ.js → types-CiMSegk1.js} +1 -1
  58. package/dist/assets/{useAddCell-DGhb_PpU.js → useAddCell-FisWjOQO.js} +1 -1
  59. package/dist/assets/{useCellActionButton-COxDEyF8.js → useCellActionButton-DLwn_yx9.js} +1 -1
  60. package/dist/assets/{useDeleteCell-BVWdwuvc.js → useDeleteCell-CFtiNna2.js} +1 -1
  61. package/dist/assets/useDependencyPanelTab-DWfKzMhf.js +1 -0
  62. package/dist/assets/{useNotebookActions-BeEH92nn.js → useNotebookActions-B4HR9n-p.js} +1 -1
  63. package/dist/assets/{useRunCells-Buew9vMX.js → useRunCells-DLQFWY1L.js} +1 -1
  64. package/dist/assets/{useSplitCell-LsoCeBEb.js → useSplitCell-DDFoE9WM.js} +1 -1
  65. package/dist/assets/{utilities.esm-BAGxBLhu.js → utilities.esm-DlnAwGsz.js} +1 -1
  66. package/dist/index.html +32 -32
  67. package/package.json +1 -1
  68. package/src/components/dependency-graph/dependency-graph.tsx +5 -22
  69. package/src/components/{editor/chrome/wrapper/minimap.tsx → dependency-graph/minimap-content.tsx} +49 -76
  70. package/src/components/dependency-graph/panels.tsx +4 -15
  71. package/src/components/dependency-graph/types.ts +0 -1
  72. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +12 -5
  73. package/src/components/editor/chrome/state.ts +62 -24
  74. package/src/components/editor/chrome/wrapper/app-chrome.tsx +36 -11
  75. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  76. package/src/components/editor/chrome/wrapper/footer.tsx +9 -4
  77. package/src/components/editor/chrome/wrapper/minimap-state.ts +0 -2
  78. package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -3
  79. package/src/components/editor/chrome/wrapper/useDependencyPanelTab.ts +16 -0
  80. package/src/components/editor/output/MarimoErrorOutput.tsx +2 -2
  81. package/src/components/terminal/hooks.ts +2 -2
  82. package/dist/assets/MarimoErrorOutput-HLzwepOd.js +0 -7
  83. package/dist/assets/cell-actions-By11JcES.js +0 -1
  84. package/dist/assets/dependency-graph-panel-Xl6gHQbe.js +0 -4
  85. package/dist/assets/edit-page-Dkay6iPX.js +0 -13
  86. package/dist/assets/index-G6ss-VDT.css +0 -2
  87. package/src/components/dependency-graph/dependency-graph-minimap.tsx +0 -197
  88. package/src/components/editor/chrome/wrapper/footer-items/minimap-status.tsx +0 -21
@@ -1,9 +1,12 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
- import { useAtom, useAtomValue } from "jotai";
4
- import { XIcon } from "lucide-react";
3
+ import { useAtomValue } from "jotai";
5
4
  import * as React from "react";
6
- import { Button } from "@/components/ui/button";
5
+ import {
6
+ type CellGraph,
7
+ cellGraphsAtom,
8
+ isVariableAffectedBySelectedCell,
9
+ } from "@/components/editor/chrome/wrapper/minimap-state";
7
10
  import {
8
11
  useCellActions,
9
12
  useCellData,
@@ -13,14 +16,7 @@ import {
13
16
  import { cellFocusAtom, useCellFocusActions } from "@/core/cells/focus";
14
17
  import type { CellId } from "@/core/cells/ids";
15
18
  import { useVariables } from "@/core/variables/state";
16
- import { useHotkey } from "@/hooks/useHotkey";
17
19
  import { cn } from "@/utils/cn";
18
- import {
19
- type CellGraph,
20
- cellGraphsAtom,
21
- isVariableAffectedBySelectedCell,
22
- minimapOpenAtom,
23
- } from "./minimap-state";
24
20
 
25
21
  interface MinimapCellProps {
26
22
  cellId: CellId;
@@ -127,72 +123,6 @@ const MinimapCell: React.FC<MinimapCellProps> = (props) => {
127
123
  );
128
124
  };
129
125
 
130
- const MinimapInternal: React.FC<{
131
- open: boolean;
132
- setOpen: (update: boolean) => void;
133
- }> = ({ open, setOpen }) => {
134
- const cellIds = useCellIds();
135
- const cellPositions: Record<CellId, number> = Object.fromEntries(
136
- cellIds.inOrderIds.map((id, idx) => [id, idx]),
137
- );
138
- const columnBoundaries: number[] = [];
139
- let cellCount = 0;
140
- for (const [idx, column] of cellIds.getColumns().entries()) {
141
- if (idx > 0) {
142
- columnBoundaries.push(cellCount);
143
- }
144
- cellCount += column.inOrderIds.length;
145
- }
146
- return (
147
- <div
148
- className={cn(
149
- "fixed top-14 right-5 z-50 bg-background/95 backdrop-blur-sm supports-backdrop-filter:bg-background/60 rounded-lg border shadow-lg w-64 flex flex-col max-h-[58vh]",
150
- "motion-safe:transition-transform motion-safe:duration-200 motion-safe:ease-in-out",
151
- open ? "translate-x-0" : "translate-x-[calc(100%+20px)]",
152
- )}
153
- >
154
- <div className="flex items-center justify-between p-4 border-b">
155
- <span className="text-sm font-semibold">Minimap</span>
156
- <Button
157
- variant="ghost"
158
- size="icon"
159
- className="h-6 w-6"
160
- onClick={() => setOpen(false)}
161
- >
162
- <XIcon className="h-4 w-4" />
163
- </Button>
164
- </div>
165
- <div className="overflow-y-auto overflow-x-hidden flex-1 scrollbar-none">
166
- <div className="py-3 pl-3 pr-4 relative min-h-full">
167
- {cellIds.inOrderIds.map((cellId, idx) => {
168
- const isColumnBoundary = columnBoundaries.includes(idx);
169
- return (
170
- <React.Fragment key={cellId}>
171
- {/* Subtle visual divider between nodes */}
172
- {isColumnBoundary && (
173
- <div
174
- className="absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none"
175
- aria-hidden="true"
176
- />
177
- )}
178
- <MinimapCell cellId={cellId} cellPositions={cellPositions} />
179
- </React.Fragment>
180
- );
181
- })}
182
- </div>
183
- {/* Invisible element to prevent SVG overflow from affecting scroll */}
184
- <div className="h-0 overflow-hidden" aria-hidden="true" />
185
- </div>
186
- </div>
187
- );
188
- };
189
-
190
- export const Minimap: React.FC = () => {
191
- const [open, setOpen] = useAtom(minimapOpenAtom);
192
- useHotkey("global.toggleMinimap", () => setOpen((prev) => !prev));
193
- return <MinimapInternal open={open} setOpen={setOpen} />;
194
- };
195
-
196
126
  function codePreview(code: string): string | undefined {
197
127
  return code.split("\n")[0].trim() || undefined;
198
128
  }
@@ -443,3 +373,46 @@ function isNonReferenceableCell(graph: CellGraph): boolean {
443
373
  graph.descendants.size === 0
444
374
  );
445
375
  }
376
+
377
+ /**
378
+ * Minimap content component for display in the dependencies panel.
379
+ * Shows a scrollable list of cells with dependency visualization.
380
+ */
381
+ export const MinimapContent: React.FC = () => {
382
+ const cellIds = useCellIds();
383
+ const cellPositions: Record<CellId, number> = Object.fromEntries(
384
+ cellIds.inOrderIds.map((id, idx) => [id, idx]),
385
+ );
386
+ const columnBoundaries: number[] = [];
387
+ let cellCount = 0;
388
+ for (const [idx, column] of cellIds.getColumns().entries()) {
389
+ if (idx > 0) {
390
+ columnBoundaries.push(cellCount);
391
+ }
392
+ cellCount += column.inOrderIds.length;
393
+ }
394
+
395
+ return (
396
+ <div className="overflow-y-auto overflow-x-hidden flex-1 scrollbar-none h-full max-w-80">
397
+ <div className="py-3 pl-3 pr-4 relative min-h-full">
398
+ {cellIds.inOrderIds.map((cellId, idx) => {
399
+ const isColumnBoundary = columnBoundaries.includes(idx);
400
+ return (
401
+ <React.Fragment key={cellId}>
402
+ {/* Subtle visual divider between nodes */}
403
+ {isColumnBoundary && (
404
+ <div
405
+ className="absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none"
406
+ aria-hidden="true"
407
+ />
408
+ )}
409
+ <MinimapCell cellId={cellId} cellPositions={cellPositions} />
410
+ </React.Fragment>
411
+ );
412
+ })}
413
+ </div>
414
+ {/* Invisible element to prevent SVG overflow from affecting scroll */}
415
+ <div className="h-0 overflow-hidden" aria-hidden="true" />
416
+ </div>
417
+ );
418
+ };
@@ -6,7 +6,6 @@ import {
6
6
  ArrowRightToLineIcon,
7
7
  MoreVerticalIcon,
8
8
  NetworkIcon,
9
- Rows3Icon,
10
9
  SettingsIcon,
11
10
  SquareFunction,
12
11
  WorkflowIcon,
@@ -26,11 +25,11 @@ import { Checkbox } from "../ui/checkbox";
26
25
  import { Label } from "../ui/label";
27
26
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
28
27
  import { VariableName } from "../variables/common";
29
- import type { GraphLayoutView, GraphSelection, GraphSettings } from "./types";
28
+ import type { GraphSelection, GraphSettings, LayoutDirection } from "./types";
30
29
 
31
30
  interface Props {
32
- view: GraphLayoutView;
33
- onChange: (view: GraphLayoutView) => void;
31
+ view: LayoutDirection;
32
+ onChange: (view: LayoutDirection) => void;
34
33
  settings: GraphSettings;
35
34
  onSettingsChange: (settings: GraphSettings) => void;
36
35
  }
@@ -73,16 +72,6 @@ export const GraphToolbar: React.FC<Props> = memo(
73
72
  return (
74
73
  <Panel position="top-right" className="flex flex-col items-end gap-2">
75
74
  <div className="flex gap-2">
76
- <Button
77
- variant="outline"
78
- className="bg-background"
79
- aria-selected={view === "_minimap_"}
80
- size="xs"
81
- onClick={() => onChange("_minimap_")}
82
- >
83
- <Rows3Icon className="w-4 h-4 mr-1" />
84
- Mini Map
85
- </Button>
86
75
  <Button
87
76
  variant="outline"
88
77
  className="bg-background"
@@ -104,7 +93,7 @@ export const GraphToolbar: React.FC<Props> = memo(
104
93
  Horizontal Tree
105
94
  </Button>
106
95
  </div>
107
- {view !== "_minimap_" && settingsButton}
96
+ {settingsButton}
108
97
  </Panel>
109
98
  );
110
99
  },
@@ -2,7 +2,6 @@
2
2
  import type { CellId } from "@/core/cells/ids";
3
3
 
4
4
  export type LayoutDirection = "TB" | "LR";
5
- export type GraphLayoutView = LayoutDirection | "_minimap_";
6
5
 
7
6
  export type GraphSelection =
8
7
  | {
@@ -5,19 +5,26 @@ import { useCellDataAtoms, useCellIds } from "@/core/cells/cells";
5
5
  import { useVariables } from "@/core/variables/state";
6
6
  import { cn } from "@/utils/cn";
7
7
  import { DependencyGraph } from "../../../dependency-graph/dependency-graph";
8
+ import { MinimapContent } from "../../../dependency-graph/minimap-content";
9
+ import { useDependencyPanelTab } from "../wrapper/useDependencyPanelTab";
8
10
 
9
11
  const DependencyGraphPanel: React.FC = () => {
12
+ const { dependencyPanelTab } = useDependencyPanelTab();
10
13
  const variables = useVariables();
11
14
  const cellIds = useCellIds();
12
15
  const [cells] = useCellDataAtoms();
13
16
 
14
17
  return (
15
18
  <div className={cn("w-full h-full flex-1 mx-auto -mb-4 relative")}>
16
- <DependencyGraph
17
- cellAtoms={cells}
18
- variables={variables}
19
- cellIds={cellIds.inOrderIds}
20
- />
19
+ {dependencyPanelTab === "minimap" ? (
20
+ <MinimapContent />
21
+ ) : (
22
+ <DependencyGraph
23
+ cellAtoms={cells}
24
+ variables={variables}
25
+ cellIds={cellIds.inOrderIds}
26
+ />
27
+ )}
21
28
  </div>
22
29
  );
23
30
  };
@@ -3,10 +3,11 @@
3
3
  import { useAtomValue } from "jotai";
4
4
  import { atomWithStorage } from "jotai/utils";
5
5
  import { z } from "zod";
6
+ import { store } from "@/core/state/jotai";
6
7
  import { createReducerAndAtoms } from "@/utils/createReducer";
7
8
  import { jotaiJsonStorage } from "@/utils/storage/jotai";
8
9
  import { ZodLocalStorage } from "@/utils/storage/typed";
9
- import type { PanelType } from "./types";
10
+ import type { PanelSection, PanelType } from "./types";
10
11
  import { isPanelHidden, PANELS } from "./types";
11
12
 
12
13
  export interface ChromeState {
@@ -41,6 +42,20 @@ export const panelLayoutAtom = atomWithStorage<PanelLayout>(
41
42
  { getOnInit: true },
42
43
  );
43
44
 
45
+ /**
46
+ * Resolve which section a panel belongs to based on current layout.
47
+ */
48
+ function resolvePanelLocation(panelType: PanelType): PanelSection | null {
49
+ const layout = store.get(panelLayoutAtom);
50
+ if (layout.sidebar.includes(panelType)) {
51
+ return "sidebar";
52
+ }
53
+ if (layout.developerPanel.includes(panelType)) {
54
+ return "developer-panel";
55
+ }
56
+ return null;
57
+ }
58
+
44
59
  const KEY = "marimo:sidebar";
45
60
  const storage = new ZodLocalStorage<ChromeState>(
46
61
  z.object({
@@ -76,20 +91,52 @@ const {
76
91
  } = createReducerAndAtoms(
77
92
  () => storage.get(KEY),
78
93
  {
79
- openApplication: (state, selectedPanel: PanelType) => ({
80
- ...state,
81
- selectedPanel,
82
- isSidebarOpen: true,
83
- }),
84
- toggleApplication: (state, selectedPanel: PanelType) => ({
85
- ...state,
86
- selectedPanel,
87
- // If it was closed, open it
88
- // If it was open, keep it open unless it was the same application
89
- isSidebarOpen: state.isSidebarOpen
90
- ? state.selectedPanel !== selectedPanel
91
- : true,
92
- }),
94
+ openApplication: (state, selectedPanel: PanelType) => {
95
+ const location = resolvePanelLocation(selectedPanel);
96
+ if (location === "sidebar") {
97
+ return {
98
+ ...state,
99
+ selectedPanel,
100
+ isSidebarOpen: true,
101
+ };
102
+ }
103
+ if (location === "developer-panel") {
104
+ return {
105
+ ...state,
106
+ selectedDeveloperPanelTab: selectedPanel,
107
+ isDeveloperPanelOpen: true,
108
+ };
109
+ }
110
+ // Panel not found in layout, no-op
111
+ return state;
112
+ },
113
+ toggleApplication: (state, selectedPanel: PanelType) => {
114
+ const location = resolvePanelLocation(selectedPanel);
115
+ if (location === "sidebar") {
116
+ return {
117
+ ...state,
118
+ selectedPanel,
119
+ // If it was closed, open it
120
+ // If it was open, keep it open unless it was the same application
121
+ isSidebarOpen: state.isSidebarOpen
122
+ ? state.selectedPanel !== selectedPanel
123
+ : true,
124
+ };
125
+ }
126
+ if (location === "developer-panel") {
127
+ return {
128
+ ...state,
129
+ selectedDeveloperPanelTab: selectedPanel,
130
+ // If it was closed, open it
131
+ // If it was open, keep it open unless it was the same tab
132
+ isDeveloperPanelOpen: state.isDeveloperPanelOpen
133
+ ? state.selectedDeveloperPanelTab !== selectedPanel
134
+ : true,
135
+ };
136
+ }
137
+ // Panel not found in layout, no-op
138
+ return state;
139
+ },
93
140
  toggleSidebarPanel: (state) => ({
94
141
  ...state,
95
142
  isSidebarOpen: !state.isSidebarOpen,
@@ -106,15 +153,6 @@ const {
106
153
  ...state,
107
154
  isDeveloperPanelOpen: isOpen,
108
155
  }),
109
- setSelectedDeveloperPanelTab: (state, tab: PanelType) => ({
110
- ...state,
111
- selectedDeveloperPanelTab: tab,
112
- }),
113
- openDeveloperPanelTab: (state, tab: PanelType) => ({
114
- ...state,
115
- isDeveloperPanelOpen: true,
116
- selectedDeveloperPanelTab: tab,
117
- }),
118
156
  },
119
157
  [(_prevState, newState) => storage.set(KEY, newState)],
120
158
  );
@@ -35,10 +35,10 @@ import {
35
35
  type PanelDescriptor,
36
36
  } from "../types";
37
37
  import { BackendConnectionStatus } from "./footer-items/backend-status";
38
- import { Minimap } from "./minimap";
39
38
  import { PanelsWrapper } from "./panels";
40
39
  import { PendingAICells } from "./pending-ai-cells";
41
40
  import { useAiPanelTab } from "./useAiPanel";
41
+ import { useDependencyPanelTab } from "./useDependencyPanelTab";
42
42
  import { handleDragging } from "./utils";
43
43
 
44
44
  const LazyTerminal = React.lazy(() => import("@/components/terminal/terminal"));
@@ -75,15 +75,12 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
75
75
  selectedPanel,
76
76
  selectedDeveloperPanelTab,
77
77
  } = useChromeState();
78
- const {
79
- setIsSidebarOpen,
80
- setIsDeveloperPanelOpen,
81
- setSelectedDeveloperPanelTab,
82
- openApplication,
83
- } = useChromeActions();
78
+ const { setIsSidebarOpen, setIsDeveloperPanelOpen, openApplication } =
79
+ useChromeActions();
84
80
  const sidebarRef = React.useRef<ImperativePanelHandle>(null);
85
81
  const developerPanelRef = React.useRef<ImperativePanelHandle>(null);
86
82
  const { aiPanelTab, setAiPanelTab } = useAiPanelTab();
83
+ const { dependencyPanelTab, setDependencyPanelTab } = useDependencyPanelTab();
87
84
  const errorCount = useAtomValue(cellErrorCount);
88
85
  const [panelLayout, setPanelLayout] = useAtom(panelLayoutAtom);
89
86
 
@@ -122,7 +119,7 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
122
119
  }
123
120
 
124
121
  // Select the dropped item in developer panel
125
- setSelectedDeveloperPanelTab(item.type);
122
+ openApplication(item.type);
126
123
  };
127
124
 
128
125
  // Get panels available for developer panel context menu
@@ -231,7 +228,36 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
231
228
  <PanelSectionProvider value="sidebar">
232
229
  <div className="flex flex-col h-full flex-1 overflow-hidden mr-[-4px]">
233
230
  <div className="p-3 border-b flex justify-between items-center">
234
- {selectedPanel === "ai" && agentsEnabled ? (
231
+ {selectedPanel === "dependencies" ? (
232
+ <div className="flex items-center justify-between flex-1">
233
+ <span className="text-sm text-(--slate-11) uppercase tracking-wide font-semibold">
234
+ Dependencies
235
+ </span>
236
+ <Tabs
237
+ value={dependencyPanelTab}
238
+ onValueChange={(value) => {
239
+ if (value === "minimap" || value === "graph") {
240
+ setDependencyPanelTab(value);
241
+ }
242
+ }}
243
+ >
244
+ <TabsList>
245
+ <TabsTrigger
246
+ value="minimap"
247
+ className="py-0.5 text-xs uppercase tracking-wide font-bold"
248
+ >
249
+ Minimap
250
+ </TabsTrigger>
251
+ <TabsTrigger
252
+ value="graph"
253
+ className="py-0.5 text-xs uppercase tracking-wide font-bold"
254
+ >
255
+ Graph
256
+ </TabsTrigger>
257
+ </TabsList>
258
+ </Tabs>
259
+ </div>
260
+ ) : selectedPanel === "ai" && agentsEnabled ? (
235
261
  <Tabs
236
262
  value={aiPanelTab}
237
263
  onValueChange={(value) => {
@@ -382,7 +408,7 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
382
408
  ariaLabel="Developer panel tabs"
383
409
  className="flex flex-row gap-1"
384
410
  minItems={0}
385
- onAction={(panel) => setSelectedDeveloperPanelTab(panel.type)}
411
+ onAction={(panel) => openApplication(panel.type)}
386
412
  renderItem={(panel) => (
387
413
  <div
388
414
  className={cn(
@@ -481,7 +507,6 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
481
507
  </Panel>
482
508
  <ContextAwarePanel />
483
509
  </PanelGroup>
484
- <Minimap />
485
510
  <PendingAICells />
486
511
  <ErrorBoundary>
487
512
  <TooltipProvider>
@@ -125,7 +125,7 @@ export const BackendConnectionStatus: React.FC = () => {
125
125
  if (isAppNotStarted(connection)) {
126
126
  void connectToRuntime();
127
127
  } else {
128
- void refetch();
128
+ refetch();
129
129
  }
130
130
  };
131
131
 
@@ -18,13 +18,14 @@ import {
18
18
  } from "./footer-items/backend-status";
19
19
  import { CopilotStatusIcon } from "./footer-items/copilot-status";
20
20
  import { MachineStats } from "./footer-items/machine-stats";
21
- import { MinimapStatusIcon } from "./footer-items/minimap-status";
22
21
  import { RTCStatus } from "./footer-items/rtc-status";
23
22
  import { RuntimeSettings } from "./footer-items/runtime-settings";
23
+ import { useSetDependencyPanelTab } from "./useDependencyPanelTab";
24
24
 
25
25
  export const Footer: React.FC = () => {
26
26
  const { isDeveloperPanelOpen } = useChromeState();
27
- const { toggleDeveloperPanel } = useChromeActions();
27
+ const { toggleDeveloperPanel, toggleApplication } = useChromeActions();
28
+ const setDependencyPanelTab = useSetDependencyPanelTab();
28
29
 
29
30
  const errorCount = useAtomValue(cellErrorCount);
30
31
  const connectionStatus = useAtomValue(connectionStatusAtom);
@@ -39,13 +40,18 @@ export const Footer: React.FC = () => {
39
40
  const warningCount = 0;
40
41
 
41
42
  useHotkey("global.toggleTerminal", () => {
42
- toggleDeveloperPanel();
43
+ toggleApplication("terminal");
43
44
  });
44
45
 
45
46
  useHotkey("global.togglePanel", () => {
46
47
  toggleDeveloperPanel();
47
48
  });
48
49
 
50
+ useHotkey("global.toggleMinimap", () => {
51
+ toggleApplication("dependencies");
52
+ setDependencyPanelTab("minimap");
53
+ });
54
+
49
55
  return (
50
56
  <footer className="h-10 py-1 gap-1 bg-background flex items-center text-muted-foreground text-md pl-2 pr-1 border-t border-border select-none no-print text-sm z-50 print:hidden hide-on-fullscreen overflow-x-auto overflow-y-hidden scrollbar-thin">
51
57
  <FooterItem
@@ -92,7 +98,6 @@ export const Footer: React.FC = () => {
92
98
 
93
99
  <div className="flex items-center shrink-0 min-w-0">
94
100
  <MachineStats />
95
- <MinimapStatusIcon />
96
101
  <AIStatusIcon />
97
102
  <CopilotStatusIcon />
98
103
  <RTCStatus />
@@ -6,8 +6,6 @@ import type { CellId } from "@/core/cells/ids";
6
6
  import { variablesAtom } from "@/core/variables/state";
7
7
  import type { Variable, VariableName, Variables } from "@/core/variables/types";
8
8
 
9
- export const minimapOpenAtom = atom(false);
10
-
11
9
  export interface CellGraph {
12
10
  variables: readonly VariableName[];
13
11
 
@@ -20,8 +20,7 @@ import {
20
20
 
21
21
  export const Sidebar: React.FC = () => {
22
22
  const { selectedPanel, selectedDeveloperPanelTab } = useChromeState();
23
- const { toggleApplication, setSelectedDeveloperPanelTab } =
24
- useChromeActions();
23
+ const { toggleApplication, openApplication } = useChromeActions();
25
24
  const [panelLayout, setPanelLayout] = useAtom(panelLayoutAtom);
26
25
 
27
26
  const renderIcon = ({ Icon }: PanelDescriptor, className?: string) => {
@@ -73,7 +72,7 @@ export const Sidebar: React.FC = () => {
73
72
  (id) => id !== item.type,
74
73
  );
75
74
  if (remainingDevPanels.length > 0) {
76
- setSelectedDeveloperPanelTab(remainingDevPanels[0]);
75
+ openApplication(remainingDevPanels[0]);
77
76
  }
78
77
  }
79
78
  }
@@ -0,0 +1,16 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { atom, useAtom, useSetAtom } from "jotai";
4
+
5
+ export const dependencyPanelTabAtom = atom<"minimap" | "graph">("minimap");
6
+
7
+ export function useDependencyPanelTab() {
8
+ const [dependencyPanelTab, setDependencyPanelTab] = useAtom(
9
+ dependencyPanelTabAtom,
10
+ );
11
+ return { dependencyPanelTab, setDependencyPanelTab };
12
+ }
13
+
14
+ export function useSetDependencyPanelTab() {
15
+ return useSetAtom(dependencyPanelTabAtom);
16
+ }
@@ -142,7 +142,7 @@ export const MarimoErrorOutput = ({
142
142
  );
143
143
 
144
144
  const openScratchpad = () => {
145
- chromeActions.openDeveloperPanelTab("scratchpad");
145
+ chromeActions.openApplication("scratchpad");
146
146
  };
147
147
 
148
148
  const renderMessages = () => {
@@ -186,7 +186,7 @@ export const MarimoErrorOutput = ({
186
186
  size="xs"
187
187
  variant="outline"
188
188
  className="mt-2 font-normal"
189
- onClick={() => chromeActions.openDeveloperPanelTab("terminal")}
189
+ onClick={() => chromeActions.openApplication("terminal")}
190
190
  >
191
191
  <TerminalIcon className="h-3.5 w-3.5 mr-1.5" />
192
192
  <span>Open terminal</span>
@@ -25,11 +25,11 @@ import { useTerminalActions } from "./state";
25
25
  */
26
26
  export function useTerminalCommands() {
27
27
  const { addCommand } = useTerminalActions();
28
- const { openDeveloperPanelTab } = useChromeActions();
28
+ const { openApplication } = useChromeActions();
29
29
 
30
30
  const sendCommand = (text: string) => {
31
31
  // First, ensure the terminal is open
32
- openDeveloperPanelTab("terminal");
32
+ openApplication("terminal");
33
33
 
34
34
  // Add the command to the queue
35
35
  addCommand(text);
@@ -1,7 +0,0 @@
1
- import{s as G}from"./chunk-LvLJmgfZ.js";import{d as ye,f as ve,l as Ne,u as be}from"./useEvent-DlWF5OMa.js";import{t as we}from"./react-BGmjiNul.js";import{C as ke,Fr as J,Kr as Ie,Pn as $e,Pr as _e,fn as Fe,q as Te,rn as Ae,v as Ce}from"./cells-BLhvmrVl.js";import{t as z}from"./compiler-runtime-DeeZ7FnK.js";import{t as Se}from"./invariant-C6yE60hi.js";import{r as Me}from"./utils-CJJIceVn.js";import{t as Pe}from"./jsx-runtime-DN_bIXfG.js";import{r as X,t as $}from"./button-DuYGqRtX.js";import{t as Y}from"./cn-C1rgT0yh.js";import{t as H}from"./createLucideIcon-CW2xpJ57.js";import{_ as qe}from"./select-D0g5GnIs.js";import{a as ze,p as Ee,r as Le,t as We}from"./dropdown-menu-BP4_BZLr.js";import{a as De,n as Ve}from"./state-CoslvOiH.js";import{c as Z,n as Be}from"./datasource-DNy_uzDr.js";import{a as Qe}from"./dist-RKnr9SNh.js";import{t as ee}from"./tooltip-CvjcEpZC.js";import{a as Oe,i as He,n as Ue,r as Ke}from"./multi-map-fjX9ImVF.js";import{t as te}from"./kbd-Czc5z_04.js";import{t as T}from"./links-DNmjkr65.js";import{r as Re,t as Ge}from"./alert-BEdExd6A.js";import{o as Je,t as Xe}from"./useInstallPackage-RldLPyJs.js";import{n as b}from"./cell-link-B7EjqLUL.js";var Ye=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),A=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),re=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function Ze(r){let e=null,s=r.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function et(r){let e=r.split(`
2
- `),s=" ",n=Ze(Qe.parse(r));if(!n)return["def _():",...U(e,s),`${s}return`,"","","_()"].join(`
3
- `);let i=r.slice(0,n.from).trim(),l=r.slice(n.from).trim(),a=i.split(`
4
- `),c=l.split(`
5
- `);return["def _():",...U(a,s),`${s}return ${c[0]}`,...U(c.slice(1),s),"","","_()"].join(`
6
- `)}function U(r,e){if(r.length===1&&r[0]==="")return[];let s=[];for(let n of r)n===""?s.push(""):s.push(e+n);return s}function tt(r,e){var s;if(r.type==="multiple-defs")return[{title:"Fix: Wrap in a function",description:"Make this cell's variables local by wrapping the cell in a function.",fixType:"manual",onFix:async n=>{Se(n.editor,"Editor is null");let i=et(n.editor.state.doc.toString());n.editor.dispatch({changes:{from:0,to:n.editor.state.doc.length,insert:i}})}}];if(r.type==="exception"&&r.exception_type==="NameError"){let n=(s=r.msg.match(/name '(.+)' is not defined/))==null?void 0:s[1];if(!n||!(n in se))return[];let i=rt(n);return[{title:`Fix: Add '${i}'`,description:"Add a new cell for the missing import",fixType:"manual",onFix:async l=>{l.addCodeBelow(i)}}]}return r.type==="sql-error"&&e.aiEnabled?[{title:"Fix with AI",description:"Fix the SQL statement",fixType:"ai",onFix:async n=>{var a;let i=Be(n.cellId),l=`Fix the SQL statement: ${r.msg}.`;i&&(l+=`
7
- Database schema: ${i}`),(a=n.aiFix)==null||a.setAiCompletionCell({cellId:n.cellId,initialPrompt:l,triggerImmediately:n.aiFix.triggerFix})}}]:[]}function rt(r){let e=se[r];return e===r?`import ${e}`:`import ${e} as ${r}`}var se={mo:"marimo",alt:"altair",bokeh:"bokeh",dask:"dask",np:"numpy",pd:"pandas",pl:"polars",plotly:"plotly",plt:"matplotlib.pyplot",px:"plotly.express",scipy:"scipy",sk:"sklearn",sns:"seaborn",stats:"scipy.stats",tf:"tensorflow",torch:"torch",xr:"xarray",dt:"datetime",json:"json",math:"math",os:"os",re:"re",sys:"sys"},st=z(),nt=Ie("marimo:ai-autofix-mode","autofix",Fe);function lt(){let r=(0,st.c)(3),[e,s]=Ne(nt),n;return r[0]!==e||r[1]!==s?(n={fixMode:e,setFixMode:s},r[0]=e,r[1]=s,r[2]=n):n=r[2],n}var K=z(),t=G(Pe(),1);const N=r=>{let e=(0,K.c)(21),{errors:s,cellId:n,className:i}=r,l=ve(),{createNewCell:a}=ke(),c=be(Me),o;if(e[0]!==c||e[1]!==s){let x;e[3]===c?x=e[4]:(x=y=>tt(y,{aiEnabled:c}),e[3]=c,e[4]=x),o=s.flatMap(x),e[0]=c,e[1]=s,e[2]=o}else o=e[2];let m=o,p=ye(Ve);if(m.length===0)return null;let d=m[0],f;e[5]!==n||e[6]!==a||e[7]!==d||e[8]!==p||e[9]!==l?(f=x=>{var w;let y=(w=l.get(Ce).cellHandles[n].current)==null?void 0:w.editorView;d.onFix({addCodeBelow:_=>{a({cellId:n,autoFocus:!1,before:!1,code:_})},editor:y,cellId:n,aiFix:{setAiCompletionCell:p,triggerFix:x}}),y==null||y.focus()},e[5]=n,e[6]=a,e[7]=d,e[8]=p,e[9]=l,e[10]=f):f=e[10];let u=f,j;e[11]===i?j=e[12]:(j=Y("my-2",i),e[11]=i,e[12]=j);let h;e[13]!==d.description||e[14]!==d.fixType||e[15]!==d.title||e[16]!==u?(h=d.fixType==="ai"?(0,t.jsx)(oe,{tooltip:d.description,openPrompt:()=>u(!1),applyAutofix:()=>u(!0)}):(0,t.jsx)(ee,{content:d.description,align:"start",children:(0,t.jsxs)($,{size:"xs",variant:"outline",className:"font-normal",onClick:()=>u(!1),children:[(0,t.jsx)(Z,{className:"h-3 w-3 mr-2"}),d.title]})}),e[13]=d.description,e[14]=d.fixType,e[15]=d.title,e[16]=u,e[17]=h):h=e[17];let g;return e[18]!==j||e[19]!==h?(g=(0,t.jsx)("div",{className:j,children:h}),e[18]=j,e[19]=h,e[20]=g):g=e[20],g};var ne=De,le=Z,ie="Suggest a prompt",ae="Fix with AI";const oe=r=>{let e=(0,K.c)(21),{tooltip:s,openPrompt:n,applyAutofix:i}=r,{fixMode:l,setFixMode:a}=lt(),c=l==="prompt"?n:i,o;e[0]===l?o=e[1]:(o=l==="prompt"?(0,t.jsx)(ne,{className:"h-3 w-3 mr-2 mb-0.5"}):(0,t.jsx)(le,{className:"h-3 w-3 mr-2 mb-0.5"}),e[0]=l,e[1]=o);let m=l==="prompt"?ie:ae,p;e[2]!==c||e[3]!==o||e[4]!==m?(p=(0,t.jsxs)($,{size:"xs",variant:"outline",className:"font-normal rounded-r-none border-r-0",onClick:c,children:[o,m]}),e[2]=c,e[3]=o,e[4]=m,e[5]=p):p=e[5];let d;e[6]!==p||e[7]!==s?(d=(0,t.jsx)(ee,{content:s,align:"start",children:p}),e[6]=p,e[7]=s,e[8]=d):d=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(Ee,{asChild:!0,children:(0,t.jsx)($,{size:"xs",variant:"outline",className:"rounded-l-none px-2","aria-label":"Fix options",children:(0,t.jsx)(qe,{className:"h-3 w-3"})})}),e[9]=f):f=e[9];let u;e[10]!==l||e[11]!==a?(u=()=>{a(l==="prompt"?"autofix":"prompt")},e[10]=l,e[11]=a,e[12]=u):u=e[12];let j=l==="prompt"?"autofix":"prompt",h;e[13]===j?h=e[14]:(h=(0,t.jsx)(it,{mode:j}),e[13]=j,e[14]=h);let g;e[15]!==u||e[16]!==h?(g=(0,t.jsxs)(We,{children:[f,(0,t.jsx)(Le,{align:"end",className:"w-56",children:(0,t.jsx)(ze,{className:"flex items-center gap-2",onClick:u,children:h})})]}),e[15]=u,e[16]=h,e[17]=g):g=e[17];let x;return e[18]!==g||e[19]!==d?(x=(0,t.jsxs)("div",{className:"flex",children:[d,g]}),e[18]=g,e[19]=d,e[20]=x):x=e[20],x};var it=r=>{let e=(0,K.c)(12),{mode:s}=r,n;e[0]===s?n=e[1]:(n=s==="prompt"?(0,t.jsx)(ne,{className:"h-4 w-4"}):(0,t.jsx)(le,{className:"h-4 w-4"}),e[0]=s,e[1]=n);let i=n,l=s==="prompt"?ie:ae,a=s==="prompt"?"Edit the prompt before applying":"Apply AI fixes automatically",c;e[2]===l?c=e[3]:(c=(0,t.jsx)("span",{className:"font-medium",children:l}),e[2]=l,e[3]=c);let o;e[4]===a?o=e[5]:(o=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a}),e[4]=a,e[5]=o);let m;e[6]!==c||e[7]!==o?(m=(0,t.jsxs)("div",{className:"flex flex-col",children:[c,o]}),e[6]=c,e[7]=o,e[8]=m):m=e[8];let p;return e[9]!==i||e[10]!==m?(p=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i,m]}),e[9]=i,e[10]=m,e[11]=p):p=e[11],p},ce=/(https?:\/\/\S+)/,at=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,de=/^data:image\//i,ot=["avatars.githubusercontent.com"];function me(r){return de.test(r)?[{type:"image",url:r}]:r.split(ce).filter(e=>e.trim()!=="").map(e=>ce.test(e)?at.test(e)||de.test(e)||ot.some(s=>e.includes(s))?{type:"image",url:e}:{type:"url",url:e}:{type:"text",value:e})}var pe=z(),E=G(we(),1),ct=new Te;const R=r=>{let e=RegExp("\x1B\\[[0-9;]*m","g");return r.replaceAll(e,"")};var ue=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi;function dt(r){ue.lastIndex=0;let e=ue.exec(r);if(!e)return null;let s=e.index+e[0].length,n=r.slice(s).split(/\s+/),i="",l=0;for(let c of n){let o=c.trim();if(!o)continue;if(o.startsWith("-")){l+=o.length+1;continue}let m=o.match(/^[\w,.[\]-]+/);if(m){i=m[0];break}break}if(!i)return null;let a=s+l+i.length;return{package:i,endIndex:a}}function k(r,e=""){if(!r)return null;if(!/https?:\/\//.test(r))return r;let s=me(r);return s.length===1&&s[0].type==="text"?r:(0,t.jsx)(t.Fragment,{children:s.map((n,i)=>{let l=e?`${e}-${i}`:i;if(n.type==="url"){let a=R(n.url);return(0,t.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:X.stopPropagation(),className:"text-link hover:underline",children:a},l)}if(n.type==="image"){let a=R(n.url);return(0,t.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:X.stopPropagation(),className:"text-link hover:underline",children:a},l)}return(0,t.jsx)(E.Fragment,{children:n.value},l)})})}var mt=r=>{let e=(0,pe.c)(6),{packages:s,children:n}=r,{handleInstallPackages:i}=Xe(),l;e[0]!==i||e[1]!==s?(l=c=>{i(s),c.preventDefault()},e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;return e[3]!==n||e[4]!==l?(a=(0,t.jsx)("button",{onClick:l,className:"text-link hover:underline",type:"button",children:n}),e[3]=n,e[4]=l,e[5]=a):a=e[5],a};const pt=r=>{if(!(r instanceof J.Text))return;let e=R(r.data);if(!/(pip\s+install|uv\s+add|uv\s+pip\s+install)/i.test(e))return;let s=[],n=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi,i;for(;(i=n.exec(e))!==null;){let c=i.index,o=dt(e.slice(c));o&&s.push({match:i,result:o})}if(s.length===0)return;let l=[],a=0;if(s.forEach((c,o)=>{let{match:m,result:p}=c,d=m.index,f=d+p.endIndex;if(a<d){let j=e.slice(a,d);l.push((0,t.jsx)(E.Fragment,{children:k(j,`before-${o}`)},`before-${o}`))}let u=e.slice(d,f);l.push((0,t.jsx)(mt,{packages:[p.package],children:u},`install-${o}`)),a=f}),a<e.length){let c=e.slice(a);l.push((0,t.jsx)(E.Fragment,{children:k(c,"after")},"after"))}return(0,t.jsx)(t.Fragment,{children:l})},ut=r=>{if(!(r instanceof J.Text))return;let e=r.data;if(!/https?:\/\//.test(e))return;let s=k(e);if(typeof s!="string")return(0,t.jsx)(t.Fragment,{children:s})},ht=(...r)=>e=>{for(let s of r){let n=s(e);if(n!==void 0)return n}},xt=(r,e)=>(0,t.jsx)("span",{children:_e(ct.ansi_to_html(r),{replace:s=>e(s)})}),ft=r=>{let e=(0,pe.c)(4),{text:s}=r,n;e[0]===s?n=e[1]:(n=xt(s,ht(pt,ut)),e[0]=s,e[1]=n);let i=n,l;return e[2]===i?l=e[3]:(l=(0,t.jsx)(t.Fragment,{children:i}),e[2]=i,e[3]=l),l};var he=z(),I=r=>{let e=(0,he.c)(10),s=r.title??"Tip",n;e[0]===s?n=e[1]:(n=(0,t.jsx)(Oe,{className:"pt-2 pb-2 font-normal",children:s}),e[0]=s,e[1]=n);let i;e[2]===r.children?i=e[3]:(i=(0,t.jsx)(Ke,{className:"mr-24 text-[0.84375rem]",children:r.children}),e[2]=r.children,e[3]=i);let l;e[4]!==n||e[5]!==i?(l=(0,t.jsxs)(He,{value:"item-1",className:"text-muted-foreground",children:[n,i]}),e[4]=n,e[5]=i,e[6]=l):l=e[6];let a;return e[7]!==r.className||e[8]!==l?(a=(0,t.jsx)(Ue,{type:"single",collapsible:!0,className:r.className,children:l}),e[7]=r.className,e[8]=l,e[9]=a):a=e[9],a};const jt=r=>{let e=(0,he.c)(31),{errors:s,cellId:n,className:i}=r,l=Ae(),a="This cell wasn't run because it has errors",c="destructive",o="text-error";if(s.some(gt))a="Interrupted";else if(s.some(yt))a="An internal error occurred";else if(s.some(vt))a="Ancestor prevented from running",c="default",o="text-secondary-foreground";else if(s.some(Nt))a="Ancestor stopped",c="default",o="text-secondary-foreground";else if(s.some(bt))a="SQL error";else{let x;e[0]===s?x=e[1]:(x=s.find(wt),e[0]=s,e[1]=x);let y=x;y&&"exception_type"in y&&(a=y.exception_type)}let m,p,d,f,u,j;if(e[2]!==c||e[3]!==n||e[4]!==l||e[5]!==i||e[6]!==s||e[7]!==o||e[8]!==a){let x=s.filter(kt),y=s.filter(It),w=s.filter($t),_=s.filter(_t),L=s.filter(Ft),C=s.filter(Tt),S=s.filter(At),W=s.filter(Ct),D=s.filter(St),V=s.filter(Mt),F=s.filter(Pt),B=s.filter(qt),Q=s.filter(zt),M;e[15]===l?M=e[16]:(M=()=>{l.openDeveloperPanelTab("scratchpad")},e[15]=l,e[16]=M);let xe=M,fe=()=>{let v=[];if(F.length>0||B.length>0){let q=F.some(Et),ge=!q&&F.some(Lt);v.push((0,t.jsxs)("div",{children:[F.map(Wt),B.map(Dt),q&&(0,t.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>Je(l),children:[(0,t.jsx)(Ye,{className:"h-3.5 w-3.5 mr-1.5 mb-0.5"}),(0,t.jsx)("span",{children:"Open package manager"})]}),ge&&(0,t.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>l.openDeveloperPanelTab("terminal"),children:[(0,t.jsx)(re,{className:"h-3.5 w-3.5 mr-1.5"}),(0,t.jsx)("span",{children:"Open terminal"})]}),n&&(0,t.jsx)(N,{errors:[...F,...B],cellId:n})]},"syntax-unknown"))}if(x.length>0&&v.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"The setup cell cannot be run because it has references."}),(0,t.jsx)("ul",{className:"list-disc",children:x.flatMap(Vt)}),n&&(0,t.jsx)(N,{errors:x,cellId:n}),(0,t.jsxs)(I,{title:"Why can't the setup cell have references?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"The setup cell contains logic that must be run before any other cell runs, including top-level imports used by top-level functions. For this reason, it can't refer to other cells' variables."}),(0,t.jsx)("p",{className:"py-2",children:"Try simplifying the setup cell to only contain only necessary variables."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(T,{href:"https://links.marimo.app/errors-setup",children:["Learn more at our docs"," ",(0,t.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"setup-refs")),y.length>0&&v.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell is in a cycle."}),(0,t.jsx)("ul",{className:"list-disc",children:y.flatMap(Bt)}),n&&(0,t.jsx)(N,{errors:y,cellId:n}),(0,t.jsxs)(I,{title:"What are cycles and how do I resolve them?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"An example of a cycle is if one cell declares a variable 'a' and reads 'b', and another cell declares 'b' and and reads 'a'. Cycles like this make it impossible for marimo to know how to run your cells, and generally suggest that your code has a bug."}),(0,t.jsx)("p",{className:"py-2",children:"Try merging these cells into a single cell to eliminate the cycle."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(T,{href:"https://links.marimo.app/errors-cycles",children:["Learn more at our docs"," ",(0,t.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"cycle")),w.length>0){let q=w[0].name;v.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell redefines variables from other cells."}),w.map(Ot),n&&(0,t.jsx)(N,{errors:w,cellId:n}),(0,t.jsxs)(I,{title:"Why can't I redefine variables?",children:[(0,t.jsx)("p",{className:"pb-2",children:"marimo requires that each variable is defined in just one cell. This constraint enables reactive and reproducible execution, arbitrary cell reordering, seamless UI elements, execution as a script, and more."}),(0,t.jsxs)("p",{className:"py-2",children:["Try merging this cell with the mentioned cells or wrapping it in a function. Alternatively, prefix variables with an underscore (e.g., ",(0,t.jsxs)(te,{className:"inline",children:["_",q]}),"). to make them private to this cell."]}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(T,{href:"https://links.marimo.app/errors-multiple-definitions",children:["Learn more at our docs"," ",(0,t.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]}),(0,t.jsx)(I,{title:"Need a scratchpad?",children:(0,t.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,t.jsxs)($,{size:"xs",variant:"link",className:"my-2 font-normal mx-0 px-0",onClick:xe,children:[(0,t.jsx)($e,{className:"h-3"}),(0,t.jsx)("span",{children:"Try the scratchpad"})]}),(0,t.jsx)("span",{children:"to experiment without restrictions on variable names."})]})})]},"multiple-defs"))}return _.length>0&&v.push((0,t.jsxs)("div",{children:[_.map(Ht),n&&(0,t.jsx)(N,{errors:_,cellId:n}),(0,t.jsxs)(I,{title:"Why can't I use `import *`?",children:[(0,t.jsx)("p",{className:"pb-2",children:"Star imports are incompatible with marimo's git-friendly file format and reproducible reactive execution."}),(0,t.jsx)("p",{className:"py-2",children:"marimo's Python file format stores code in functions, so notebooks can be imported as regular Python modules without executing all their code. But Python disallows `import *` everywhere except at the top-level of a module."}),(0,t.jsx)("p",{className:"py-2",children:"Star imports would also silently add names to globals, which would be incompatible with reactive execution."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(T,{href:"https://links.marimo.app/errors-import-star",children:["Learn more at our docs"," ",(0,t.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"import-star")),L.length>0&&v.push((0,t.jsxs)("div",{children:[L.map(Ut),n&&(0,t.jsx)(N,{errors:L,cellId:n})]},"interruption")),C.length>0&&v.push((0,t.jsxs)("ul",{children:[C.map(Kt),C.some(Rt)&&(0,t.jsx)(I,{children:"Fix the error in the mentioned cells, or handle the exceptions with try/except blocks."}),n&&(0,t.jsx)(N,{errors:C,cellId:n})]},"exception")),S.length>0&&v.push((0,t.jsxs)("ul",{children:[S.map(Gt),n&&(0,t.jsx)(N,{errors:S,cellId:n}),(0,t.jsx)(I,{children:S.some(Jt)?"Ensure that the referenced cells define the required variables, or turn off strict execution.":"Something is wrong with your declarations. Fix any discrepancies, or turn off strict execution."})]},"strict-exception")),W.length>0&&v.push((0,t.jsxs)("div",{children:[W.map(Xt),n&&(0,t.jsx)(N,{errors:W,cellId:n})]},"internal")),D.length>0&&v.push((0,t.jsxs)("div",{children:[D.map(Yt),n&&(0,t.jsx)(N,{errors:D,cellId:n})]},"ancestor-prevented")),V.length>0&&v.push((0,t.jsxs)("div",{children:[V.map(Zt),n&&(0,t.jsx)(N,{errors:V,cellId:n})]},"ancestor-stopped")),Q.length>0&&v.push((0,t.jsxs)("div",{children:[Q.map(er),n&&(0,t.jsx)(N,{errors:Q,cellId:n,className:"mt-2.5"})]},"sql-errors")),v},O=`font-code font-medium tracking-wide ${o}`,P;e[17]!==O||e[18]!==a?(P=(0,t.jsx)(Re,{className:O,children:a}),e[17]=O,e[18]=a,e[19]=P):P=e[19];let je=P;m=Ge,f=c,e[20]===i?u=e[21]:(u=Y("border-none font-code text-sm text-[0.84375rem] px-0 text-muted-foreground normal [&:has(svg)]:pl-0 space-y-4",i),e[20]=i,e[21]=u),j=je,p="flex flex-col gap-8",d=fe(),e[2]=c,e[3]=n,e[4]=l,e[5]=i,e[6]=s,e[7]=o,e[8]=a,e[9]=m,e[10]=p,e[11]=d,e[12]=f,e[13]=u,e[14]=j}else m=e[9],p=e[10],d=e[11],f=e[12],u=e[13],j=e[14];let h;e[22]!==p||e[23]!==d?(h=(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:p,children:d})}),e[22]=p,e[23]=d,e[24]=h):h=e[24];let g;return e[25]!==m||e[26]!==f||e[27]!==u||e[28]!==j||e[29]!==h?(g=(0,t.jsxs)(m,{variant:f,className:u,children:[j,h]}),e[25]=m,e[26]=f,e[27]=u,e[28]=j,e[29]=h,e[30]=g):g=e[30],g};function gt(r){return r.type==="interruption"}function yt(r){return r.type==="internal"}function vt(r){return r.type==="ancestor-prevented"}function Nt(r){return r.type==="ancestor-stopped"}function bt(r){return r.type==="sql-error"}function wt(r){return r.type==="exception"}function kt(r){return r.type==="setup-refs"}function It(r){return r.type==="cycle"}function $t(r){return r.type==="multiple-defs"}function _t(r){return r.type==="import-star"}function Ft(r){return r.type==="interruption"}function Tt(r){return r.type==="exception"}function At(r){return r.type==="strict-exception"}function Ct(r){return r.type==="internal"}function St(r){return r.type==="ancestor-prevented"}function Mt(r){return r.type==="ancestor-stopped"}function Pt(r){return r.type==="syntax"}function qt(r){return r.type==="unknown"}function zt(r){return r.type==="sql-error"}function Et(r){return r.msg.includes("!pip")}function Lt(r){return r.msg.includes("use os.subprocess")}function Wt(r,e){return(0,t.jsx)("pre",{children:k(r.msg,`syntax-${e}`)},`syntax-${e}`)}function Dt(r,e){return(0,t.jsx)("pre",{children:k(r.msg,`unknown-${e}`)},`unknown-${e}`)}function Vt(r,e){return r.edges_with_vars.map((s,n)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(b,{cellId:s[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[": "," ",s[1].length===1?s[1][0]:s[1].join(", ")]})]},`setup-refs-${e}-${n}`))}function Bt(r,e){return r.edges_with_vars.map((s,n)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(b,{cellId:s[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" -> ",s[1].length===1?s[1][0]:s[1].join(", ")," -> "]}),(0,t.jsx)(b,{cellId:s[2]})]},`cycle-${e}-${n}`))}function Qt(r,e){return(0,t.jsx)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:(0,t.jsx)(b,{cellId:r})},`cell-${e}`)}function Ot(r,e){return(0,t.jsxs)(E.Fragment,{children:[(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:`'${r.name}' was also defined by:`}),(0,t.jsx)("ul",{className:"list-disc",children:r.cells.map(Qt)})]},`multiple-defs-${e}`)}function Ht(r,e){return(0,t.jsx)("p",{className:"text-muted-foreground",children:r.msg},`import-star-${e}`)}function Ut(r,e){return(0,t.jsx)("p",{children:"This cell was interrupted and needs to be re-run."},`interruption-${e}`)}function Kt(r,e){return r.exception_type==="NameError"&&r.msg.startsWith("name 'mo'")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"name 'mo' is not defined."}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["The marimo module (imported as"," ",(0,t.jsx)(te,{className:"inline",children:"mo"}),") is required for Markdown, SQL, and UI elements."]})]})},`exception-${e}`):r.exception_type==="NameError"&&r.msg.startsWith("name '_")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:r.msg}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["Variables prefixed with an underscore are local to a cell"," ","(",(0,t.jsxs)(T,{href:"https://links.marimo.app/local-variables",children:["docs"," ",(0,t.jsx)(A,{size:"0.75rem",className:"inline"})]}),")."]}),(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]})},`exception-${e}`):(0,t.jsx)("li",{className:"my-2",children:r.raising_cell==null?(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:k(r.msg,`exception-${e}`)}),(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]}):(0,t.jsxs)("div",{children:[k(r.msg,`exception-${e}`),(0,t.jsx)(b,{cellId:r.raising_cell})]})},`exception-${e}`)}function Rt(r){return r.raising_cell!=null}function Gt(r,e){return(0,t.jsx)("li",{className:"my-2",children:r.blamed_cell==null?(0,t.jsx)("p",{children:r.msg}):(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(b,{cellId:r.blamed_cell})]})},`strict-exception-${e}`)}function Jt(r){return r.blamed_cell!=null}function Xt(r,e){return(0,t.jsx)("p",{children:r.msg},`internal-${e}`)}function Yt(r,e){return(0,t.jsxs)("div",{children:[r.msg,r.blamed_cell==null?(0,t.jsxs)("span",{children:["(",(0,t.jsx)(b,{cellId:r.raising_cell}),")"]}):(0,t.jsxs)("span",{children:["(",(0,t.jsx)(b,{cellId:r.raising_cell}),"\xA0blames\xA0",(0,t.jsx)(b,{cellId:r.blamed_cell}),")"]})]},`ancestor-prevented-${e}`)}function Zt(r,e){return(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(b,{cellId:r.raising_cell})]},`ancestor-stopped-${e}`)}function er(r,e){return(0,t.jsx)("div",{className:"space-y-2 mt-2",children:(0,t.jsx)("p",{className:"text-muted-foreground whitespace-pre-wrap",children:r.msg})},`sql-error-${e}`)}export{re as a,oe as i,ft as n,me as r,jt as t};