@marimo-team/islands 0.23.9-dev10 → 0.23.9-dev11
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.
- package/dist/{ConnectedDataExplorerComponent-OzrfMM5L.js → ConnectedDataExplorerComponent-DFQ1yVhp.js} +4 -4
- package/dist/{chat-ui-BDI3FMI8.js → chat-ui-xfKWgbtB.js} +6 -6
- package/dist/{code-visibility-7NV5S02K.js → code-visibility-Dv-4kU3M.js} +948 -918
- package/dist/{formats-DQ5qjo_Q.js → formats-BHOojBDG.js} +1 -1
- package/dist/{glide-data-editor-DqRY9naW.js → glide-data-editor-CpzEdx8N.js} +2 -2
- package/dist/{html-to-image-CiSinpSR.js → html-to-image-DjEqYaQd.js} +5 -5
- package/dist/{input-CZD2z6X2.js → input-DBDlwwuD.js} +1 -1
- package/dist/main.js +17 -17
- package/dist/{mermaid-IU93XzmY.js → mermaid-D00onudG.js} +2 -2
- package/dist/{process-output-5qJjMRKh.js → process-output-Cz6wQSkL.js} +1 -1
- package/dist/{reveal-component-CBOpXCsm.js → reveal-component-BsyenC3H.js} +12 -12
- package/dist/{spec-a6DaqW__.js → spec-BQbOvWbq.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{toDate-ZVVIBmdk.js → toDate-DqrFDZlc.js} +1 -1
- package/dist/{useAsyncData-C008zUPi.js → useAsyncData-4lY05iWF.js} +1 -1
- package/dist/{useDeepCompareMemoize-BrA3_n61.js → useDeepCompareMemoize-C5Zu9gK6.js} +1 -1
- package/dist/{useLifecycle-BNaoJ5a4.js → useLifecycle-YLdDriVo.js} +1 -1
- package/dist/{useTheme-7O0YWlE5.js → useTheme-u3PW8S24.js} +19 -18
- package/dist/{vega-component-DJNmOdUj.js → vega-component-CdQu2ErN.js} +5 -5
- package/package.json +1 -1
- package/src/components/editor/output/MarimoErrorOutput.tsx +103 -25
- package/src/components/editor/output/MarimoTracebackOutput.tsx +24 -36
- package/src/core/codemirror/cells/traceback-decorations.ts +1 -1
- package/src/css/app/Cell.css +0 -1
|
@@ -6,7 +6,7 @@ import { _ as Logger } from "./button-C5K9fIPF.js";
|
|
|
6
6
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
7
7
|
import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
8
8
|
import { r as KnownQueryParams } from "./constants-T20xxyNf.js";
|
|
9
|
-
import {
|
|
9
|
+
import { b as atom, d as store, m as isIslands, p as waitFor } from "./useTheme-u3PW8S24.js";
|
|
10
10
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
11
11
|
var CircleQuestionMark = createLucideIcon("circle-question-mark", [
|
|
12
12
|
["circle", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
3
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
4
|
-
import {
|
|
4
|
+
import { T as useEvent_default } from "./useTheme-u3PW8S24.js";
|
|
5
5
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
6
6
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), Result = {
|
|
7
7
|
error(e, s) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
|
-
import {
|
|
3
|
+
import { w as dequal } from "./useTheme-u3PW8S24.js";
|
|
4
4
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
5
5
|
function useDeepCompareMemoize(e) {
|
|
6
6
|
let i = import_react.useRef(e);
|
|
@@ -4,7 +4,7 @@ import { t as require_react } from "./react-DA-nE2FX.js";
|
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
5
|
import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
7
|
-
import {
|
|
7
|
+
import { b as atom, v as useSetAtom } from "./useTheme-u3PW8S24.js";
|
|
8
8
|
var Calendar = createLucideIcon("calendar", [
|
|
9
9
|
["path", {
|
|
10
10
|
d: "M8 2v4",
|
|
@@ -777,28 +777,29 @@ function useTheme() {
|
|
|
777
777
|
return e[1] === j ? M = e[2] : (M = { theme: j }, e[1] = j, e[2] = M), M;
|
|
778
778
|
}
|
|
779
779
|
export {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
780
|
+
getBuildingBlocks as C,
|
|
781
|
+
buildStore as S,
|
|
782
|
+
useEvent_default as T,
|
|
783
|
+
useAtomValue as _,
|
|
783
784
|
getResolvedMarimoConfig as a,
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
785
|
+
atom as b,
|
|
786
|
+
useResolvedMarimoConfig as c,
|
|
787
|
+
store as d,
|
|
788
|
+
useJotaiEffect as f,
|
|
789
|
+
useAtom as g,
|
|
790
|
+
Provider as h,
|
|
790
791
|
autoInstantiateAtom as i,
|
|
791
|
-
|
|
792
|
-
|
|
792
|
+
AppConfigSchema as l,
|
|
793
|
+
isIslands as m,
|
|
793
794
|
useTheme as n,
|
|
794
795
|
localeAtom as o,
|
|
795
|
-
|
|
796
|
+
waitFor as p,
|
|
796
797
|
aiEnabledAtom as r,
|
|
797
|
-
|
|
798
|
+
resolvedMarimoConfigAtom as s,
|
|
798
799
|
resolvedThemeAtom as t,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
800
|
+
createDeepEqualAtom as u,
|
|
801
|
+
useSetAtom as v,
|
|
802
|
+
dequal as w,
|
|
803
|
+
createStore as x,
|
|
804
|
+
useStore as y
|
|
804
805
|
};
|
|
@@ -2,23 +2,23 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { _ as Logger, c as Objects, g as cn, h as Events } from "./button-C5K9fIPF.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { c as asRemoteURL, v as CircleQuestionMark } from "./toDate-
|
|
5
|
+
import { c as asRemoteURL, v as CircleQuestionMark } from "./toDate-DqrFDZlc.js";
|
|
6
6
|
import "./react-dom-BTJzcVJ9.js";
|
|
7
7
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
8
8
|
import "./zod-CoBiJ5v4.js";
|
|
9
9
|
import { n as ErrorBanner } from "./error-banner-5bz0L9hS.js";
|
|
10
10
|
import { t as Tooltip } from "./tooltip-C5FYOpQc.js";
|
|
11
11
|
import { i as debounce_default } from "./constants-T20xxyNf.js";
|
|
12
|
-
import {
|
|
12
|
+
import { T as useEvent_default, n as useTheme } from "./useTheme-u3PW8S24.js";
|
|
13
13
|
import { s as uniq } from "./arrays-sEtDRoG4.js";
|
|
14
|
-
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-
|
|
14
|
+
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-BHOojBDG.js";
|
|
15
15
|
import { n as formats } from "./vega-loader.browser-CZ-J8Py3.js";
|
|
16
16
|
import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-BWLPpjKK.js";
|
|
17
17
|
import { t as j } from "./react-vega-B0sAlDTL.js";
|
|
18
18
|
import "./defaultLocale-u-3osm0P.js";
|
|
19
19
|
import "./defaultLocale-BoHTsDG6.js";
|
|
20
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
21
|
-
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-
|
|
20
|
+
import { t as useAsyncData } from "./useAsyncData-4lY05iWF.js";
|
|
21
|
+
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-C5Zu9gK6.js";
|
|
22
22
|
import { t as Semaphore } from "./semaphore-CNDGTzkX.js";
|
|
23
23
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
24
24
|
function fixRelativeUrl(e) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
+
import { useAtomValue } from "jotai";
|
|
3
4
|
import {
|
|
5
|
+
ChevronDown,
|
|
6
|
+
ChevronRight,
|
|
7
|
+
InfoIcon,
|
|
4
8
|
NotebookPenIcon,
|
|
5
9
|
PackageIcon,
|
|
6
10
|
SquareArrowOutUpRightIcon,
|
|
7
11
|
TerminalIcon,
|
|
8
12
|
} from "lucide-react";
|
|
9
|
-
import { Fragment, type JSX } from "react";
|
|
13
|
+
import { Fragment, type JSX, useState } from "react";
|
|
10
14
|
import {
|
|
11
15
|
Accordion,
|
|
12
16
|
AccordionContent,
|
|
@@ -16,7 +20,9 @@ import {
|
|
|
16
20
|
import { Button } from "@/components/ui/button";
|
|
17
21
|
import { Kbd } from "@/components/ui/kbd";
|
|
18
22
|
import { ExternalLink } from "@/components/ui/links";
|
|
23
|
+
import { Tooltip } from "@/components/ui/tooltip";
|
|
19
24
|
import type { CellId } from "@/core/cells/ids";
|
|
25
|
+
import { resolvedMarimoConfigAtom } from "@/core/config/config";
|
|
20
26
|
import { renderHTML } from "@/plugins/core/RenderHTML";
|
|
21
27
|
import { splitMangledLocals } from "@/utils/local-variables";
|
|
22
28
|
import type { MarimoError } from "../../../core/kernel/messages";
|
|
@@ -29,6 +35,39 @@ import { MangledSegments } from "../errors/mangled-local-chip";
|
|
|
29
35
|
import { CellLinkError } from "../links/cell-link";
|
|
30
36
|
import { processTextForUrls } from "./console/text-rendering";
|
|
31
37
|
|
|
38
|
+
const CollapsibleTraceback = ({
|
|
39
|
+
traceback,
|
|
40
|
+
}: {
|
|
41
|
+
traceback: string;
|
|
42
|
+
}): JSX.Element => {
|
|
43
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
44
|
+
return (
|
|
45
|
+
<div className="mt-2">
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
49
|
+
aria-expanded={isOpen}
|
|
50
|
+
aria-label={isOpen ? "Collapse traceback" : "Expand traceback"}
|
|
51
|
+
className="flex items-center gap-1 text-muted-foreground/70 hover:text-muted-foreground transition-colors"
|
|
52
|
+
>
|
|
53
|
+
{isOpen ? (
|
|
54
|
+
<ChevronDown className="h-3 w-3" />
|
|
55
|
+
) : (
|
|
56
|
+
<ChevronRight className="h-3 w-3" />
|
|
57
|
+
)}
|
|
58
|
+
<span className="text-[0.6875rem] uppercase tracking-wider">
|
|
59
|
+
Traceback
|
|
60
|
+
</span>
|
|
61
|
+
</button>
|
|
62
|
+
{isOpen && (
|
|
63
|
+
<div className="font-code text-sm mt-1 p-3 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text">
|
|
64
|
+
{renderHTML({ html: traceback })}
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
32
71
|
const Tip = (props: {
|
|
33
72
|
title?: string;
|
|
34
73
|
className?: string;
|
|
@@ -37,10 +76,13 @@ const Tip = (props: {
|
|
|
37
76
|
return (
|
|
38
77
|
<Accordion type="single" collapsible={true} className={props.className}>
|
|
39
78
|
<AccordionItem value="item-1" className="text-muted-foreground">
|
|
40
|
-
<AccordionTrigger className="pt-2 pb-
|
|
79
|
+
<AccordionTrigger className="pt-2 pb-0 font-normal">
|
|
41
80
|
{props.title ?? "Tip"}
|
|
42
81
|
</AccordionTrigger>
|
|
43
|
-
<AccordionContent
|
|
82
|
+
<AccordionContent
|
|
83
|
+
className="mr-24 text-[0.84375rem]"
|
|
84
|
+
wrapperClassName="pt-0 pb-2"
|
|
85
|
+
>
|
|
44
86
|
{props.children}
|
|
45
87
|
</AccordionContent>
|
|
46
88
|
</AccordionItem>
|
|
@@ -63,10 +105,21 @@ export const MarimoErrorOutput = ({
|
|
|
63
105
|
className,
|
|
64
106
|
}: Props): JSX.Element => {
|
|
65
107
|
const chromeActions = useChromeActions();
|
|
66
|
-
|
|
67
|
-
|
|
108
|
+
// The console area (where tracebacks are shown) sits below the cell editor.
|
|
109
|
+
// When cell outputs are also displayed below the editor, the traceback is
|
|
110
|
+
// already adjacent, so the "See the console area" hint is redundant. It is
|
|
111
|
+
// only helpful when outputs are displayed above the editor.
|
|
112
|
+
const showConsoleHint =
|
|
113
|
+
useAtomValue(resolvedMarimoConfigAtom).display.cell_output === "above";
|
|
114
|
+
|
|
115
|
+
let titleContents: string | null =
|
|
116
|
+
"This cell wasn't run because it has errors";
|
|
68
117
|
let alertVariant: "destructive" | "default" = "destructive";
|
|
69
118
|
let titleColor = "text-error";
|
|
119
|
+
// A small muted overline shown above the title for static errors, where
|
|
120
|
+
// the cell genuinely never executes. These errors have no separate title:
|
|
121
|
+
// the body text already describes them, so the overline carries the status.
|
|
122
|
+
let statusOverline: string | null = null;
|
|
70
123
|
const liStyle = "my-0.5 ml-8 text-muted-foreground/40";
|
|
71
124
|
|
|
72
125
|
// Check for certain error types to adjust title and appearance
|
|
@@ -77,7 +130,6 @@ export const MarimoErrorOutput = ({
|
|
|
77
130
|
} else if (errors.some((e) => e.type === "ancestor-prevented")) {
|
|
78
131
|
titleContents = "Ancestor prevented from running";
|
|
79
132
|
alertVariant = "default";
|
|
80
|
-
titleColor = "text-muted-foreground";
|
|
81
133
|
titleColor = "text-secondary-foreground";
|
|
82
134
|
} else if (errors.some((e) => e.type === "ancestor-stopped")) {
|
|
83
135
|
titleContents = "Ancestor stopped";
|
|
@@ -85,6 +137,19 @@ export const MarimoErrorOutput = ({
|
|
|
85
137
|
titleColor = "text-secondary-foreground";
|
|
86
138
|
} else if (errors.some((e) => e.type === "sql-error")) {
|
|
87
139
|
titleContents = "SQL error";
|
|
140
|
+
} else if (
|
|
141
|
+
errors.some(
|
|
142
|
+
(e) =>
|
|
143
|
+
e.type === "multiple-defs" ||
|
|
144
|
+
e.type === "cycle" ||
|
|
145
|
+
e.type === "setup-refs" ||
|
|
146
|
+
e.type === "import-star",
|
|
147
|
+
)
|
|
148
|
+
) {
|
|
149
|
+
// Static errors: the body text describes the problem, so there is no
|
|
150
|
+
// separate title — only the status overline.
|
|
151
|
+
titleContents = null;
|
|
152
|
+
statusOverline = "Cell not run";
|
|
88
153
|
} else {
|
|
89
154
|
// Check for exception type
|
|
90
155
|
const exceptionError = errors.find((e) => e.type === "exception");
|
|
@@ -475,9 +540,11 @@ export const MarimoErrorOutput = ({
|
|
|
475
540
|
</ExternalLink>
|
|
476
541
|
).
|
|
477
542
|
</p>
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
543
|
+
{showConsoleHint && (
|
|
544
|
+
<div className="text-muted-foreground mt-2">
|
|
545
|
+
See the console area for a traceback.
|
|
546
|
+
</div>
|
|
547
|
+
)}
|
|
481
548
|
</div>
|
|
482
549
|
</li>
|
|
483
550
|
);
|
|
@@ -492,13 +559,13 @@ export const MarimoErrorOutput = ({
|
|
|
492
559
|
{processTextForUrls(error.msg, `exception-${idx}`)}
|
|
493
560
|
</p>
|
|
494
561
|
{"traceback" in error && error.traceback ? (
|
|
495
|
-
<
|
|
496
|
-
{renderHTML({ html: error.traceback })}
|
|
497
|
-
</div>
|
|
562
|
+
<CollapsibleTraceback traceback={error.traceback} />
|
|
498
563
|
) : (
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
564
|
+
showConsoleHint && (
|
|
565
|
+
<div className="text-muted-foreground mt-2">
|
|
566
|
+
See the console area for a traceback.
|
|
567
|
+
</div>
|
|
568
|
+
)
|
|
502
569
|
)}
|
|
503
570
|
</div>
|
|
504
571
|
) : (
|
|
@@ -506,9 +573,7 @@ export const MarimoErrorOutput = ({
|
|
|
506
573
|
{processTextForUrls(error.msg, `exception-${idx}`)}
|
|
507
574
|
<CellLinkError cellId={error.raising_cell} />
|
|
508
575
|
{"traceback" in error && error.traceback && (
|
|
509
|
-
<
|
|
510
|
-
{renderHTML({ html: error.traceback })}
|
|
511
|
-
</div>
|
|
576
|
+
<CollapsibleTraceback traceback={error.traceback} />
|
|
512
577
|
)}
|
|
513
578
|
</div>
|
|
514
579
|
)}
|
|
@@ -633,23 +698,36 @@ export const MarimoErrorOutput = ({
|
|
|
633
698
|
};
|
|
634
699
|
|
|
635
700
|
const title = (
|
|
636
|
-
<
|
|
637
|
-
{
|
|
638
|
-
|
|
701
|
+
<div className="space-y-0.5">
|
|
702
|
+
{statusOverline && (
|
|
703
|
+
<div className="flex items-center gap-1 font-code text-[0.6875rem] uppercase tracking-wider text-muted-foreground/70">
|
|
704
|
+
{statusOverline}
|
|
705
|
+
<Tooltip
|
|
706
|
+
content="marimo didn't run this cell because it detected an error."
|
|
707
|
+
delayDuration={200}
|
|
708
|
+
>
|
|
709
|
+
<InfoIcon className="size-3 cursor-help" />
|
|
710
|
+
</Tooltip>
|
|
711
|
+
</div>
|
|
712
|
+
)}
|
|
713
|
+
{titleContents && (
|
|
714
|
+
<AlertTitle className={`font-code font-medium ${titleColor}`}>
|
|
715
|
+
{titleContents}
|
|
716
|
+
</AlertTitle>
|
|
717
|
+
)}
|
|
718
|
+
</div>
|
|
639
719
|
);
|
|
640
720
|
|
|
641
721
|
return (
|
|
642
722
|
<Alert
|
|
643
723
|
variant={alertVariant}
|
|
644
724
|
className={cn(
|
|
645
|
-
"border-none font-code text-sm text-[0.84375rem]
|
|
725
|
+
"border-none font-code text-sm text-[0.84375rem] p-0 text-muted-foreground normal [&:has(svg)]:pl-0 space-y-2",
|
|
646
726
|
className,
|
|
647
727
|
)}
|
|
648
728
|
>
|
|
649
729
|
{title}
|
|
650
|
-
<div>
|
|
651
|
-
<div className="flex flex-col gap-8">{renderMessages()}</div>
|
|
652
|
-
</div>
|
|
730
|
+
<div className="flex flex-col gap-4">{renderMessages()}</div>
|
|
653
731
|
</Alert>
|
|
654
732
|
);
|
|
655
733
|
};
|
|
@@ -5,17 +5,13 @@ import { useAtomValue } from "jotai";
|
|
|
5
5
|
import {
|
|
6
6
|
BugPlayIcon,
|
|
7
7
|
ChevronDown,
|
|
8
|
+
ChevronRight,
|
|
8
9
|
CopyIcon,
|
|
9
10
|
ExternalLinkIcon,
|
|
10
11
|
MessageCircleIcon,
|
|
11
12
|
SearchIcon,
|
|
12
13
|
} from "lucide-react";
|
|
13
14
|
import { type JSX, useState } from "react";
|
|
14
|
-
import {
|
|
15
|
-
Accordion,
|
|
16
|
-
AccordionContent,
|
|
17
|
-
AccordionItem,
|
|
18
|
-
} from "@/components/ui/accordion";
|
|
19
15
|
import { Button } from "@/components/ui/button";
|
|
20
16
|
import {
|
|
21
17
|
DropdownMenu,
|
|
@@ -45,7 +41,6 @@ import {
|
|
|
45
41
|
extractAllTracebackInfo,
|
|
46
42
|
getTracebackInfo,
|
|
47
43
|
} from "@/utils/traceback";
|
|
48
|
-
import { cn } from "../../../utils/cn";
|
|
49
44
|
import { AIFixButton } from "../errors/auto-fix";
|
|
50
45
|
import { MangledSegments } from "../errors/mangled-local-chip";
|
|
51
46
|
import { CellLinkTraceback } from "../links/cell-link";
|
|
@@ -57,8 +52,6 @@ interface Props {
|
|
|
57
52
|
onRefactorWithAI?: OnRefactorWithAI;
|
|
58
53
|
}
|
|
59
54
|
|
|
60
|
-
const KEY = "item";
|
|
61
|
-
|
|
62
55
|
/**
|
|
63
56
|
* List of errors due to violations of Marimo semantics.
|
|
64
57
|
*/
|
|
@@ -75,7 +68,6 @@ export const MarimoTracebackOutput = ({
|
|
|
75
68
|
replaceMangledLocal,
|
|
76
69
|
],
|
|
77
70
|
});
|
|
78
|
-
const [expanded, setExpanded] = useState(true);
|
|
79
71
|
|
|
80
72
|
const lastTracebackLine = lastLine(traceback);
|
|
81
73
|
const aiEnabled = useAtomValue(aiEnabledAtom);
|
|
@@ -95,6 +87,8 @@ export const MarimoTracebackOutput = ({
|
|
|
95
87
|
|
|
96
88
|
const showSearch = !isStaticNotebook();
|
|
97
89
|
|
|
90
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
91
|
+
|
|
98
92
|
const handleRefactorWithAI = (triggerImmediately: boolean) => {
|
|
99
93
|
onRefactorWithAI?.({
|
|
100
94
|
prompt: `My code gives the following error:\n\n${lastTracebackLine}`,
|
|
@@ -102,35 +96,29 @@ export const MarimoTracebackOutput = ({
|
|
|
102
96
|
});
|
|
103
97
|
};
|
|
104
98
|
|
|
105
|
-
const [error, errorMessage] = lastTracebackLine.split(":", 2);
|
|
106
|
-
const errorMessageSegments = errorMessage
|
|
107
|
-
? splitMangledLocals(errorMessage)
|
|
108
|
-
: [];
|
|
109
|
-
|
|
110
99
|
return (
|
|
111
100
|
<div className="flex flex-col gap-2 min-w-full w-fit">
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
</Accordion>
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
104
|
+
aria-expanded={isOpen}
|
|
105
|
+
aria-label={isOpen ? "Collapse traceback" : "Expand traceback"}
|
|
106
|
+
className="self-start flex items-center gap-1 pt-2 text-muted-foreground/70 hover:text-muted-foreground transition-colors"
|
|
107
|
+
>
|
|
108
|
+
{isOpen ? (
|
|
109
|
+
<ChevronDown className="h-3 w-3" />
|
|
110
|
+
) : (
|
|
111
|
+
<ChevronRight className="h-3 w-3" />
|
|
112
|
+
)}
|
|
113
|
+
<span className="text-[0.6875rem] uppercase tracking-wider">
|
|
114
|
+
Traceback
|
|
115
|
+
</span>
|
|
116
|
+
</button>
|
|
117
|
+
{isOpen && (
|
|
118
|
+
<div className="text-muted-foreground pr-4 text-xs overflow-auto">
|
|
119
|
+
{htmlTraceback}
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
134
122
|
<div className="flex gap-2">
|
|
135
123
|
{showAIFix && (
|
|
136
124
|
<AIFixButton
|
|
@@ -147,7 +147,7 @@ export function errorLineHighlighter(
|
|
|
147
147
|
backgroundColor: "color-mix(in srgb, var(--red-4) 40%, transparent)",
|
|
148
148
|
},
|
|
149
149
|
"&.cm-focused .cm-error-line.cm-activeLine": {
|
|
150
|
-
backgroundColor: "color-mix(in srgb, var(--red-
|
|
150
|
+
backgroundColor: "color-mix(in srgb, var(--red-5) 40%, transparent)",
|
|
151
151
|
},
|
|
152
152
|
}),
|
|
153
153
|
];
|