Skip to content

Commit eb75b41

Browse files
authored
fix: prevent debugger button from showing in scratchpad (#7381)
1 parent f7a0b92 commit eb75b41

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

frontend/src/components/editor/output/MarimoTracebackOutput.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { Kbd } from "@/components/ui/kbd";
2727
import { Tooltip } from "@/components/ui/tooltip";
2828
import { getCellEditorView } from "@/core/cells/cells";
2929
import type { CellId } from "@/core/cells/ids";
30+
import { SCRATCH_CELL_ID } from "@/core/cells/ids";
3031
import { insertDebuggerAtLine } from "@/core/codemirror/editing/debugging";
3132
import { aiEnabledAtom } from "@/core/config/config";
3233
import { getRequestClient } from "@/core/network/requests";
@@ -58,6 +59,7 @@ const KEY = "item";
5859
export const MarimoTracebackOutput = ({
5960
onRefactorWithAI,
6061
traceback,
62+
cellId,
6163
}: Props): JSX.Element => {
6264
const htmlTraceback = renderHTML({
6365
html: traceback,
@@ -71,12 +73,13 @@ export const MarimoTracebackOutput = ({
7173
// Get last traceback info
7274
const tracebackInfo = extractAllTracebackInfo(traceback)?.at(0);
7375

74-
// Don't show in wasm or static notebooks
76+
// Don't show in wasm, static notebooks, or scratchpad
7577
const showDebugger =
7678
tracebackInfo &&
7779
tracebackInfo.kind === "cell" &&
7880
!isWasm() &&
79-
!isStaticNotebook();
81+
!isStaticNotebook() &&
82+
cellId !== SCRATCH_CELL_ID;
8083

8184
const showAIFix = onRefactorWithAI && aiEnabled && !isStaticNotebook();
8285

frontend/src/components/scratchpad/scratchpad.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export const ScratchPad: React.FC = () => {
208208
className="flex flex-col h-full overflow-hidden divide-y"
209209
id={HTMLCellId.create(cellId)}
210210
>
211-
<p className="mx-2 my-2 text-muted-foreground text-sm">
211+
<p className="p-2 text-muted-foreground text-sm">
212212
Use this scratchpad cell to experiment with code without restrictions on
213213
variable names. Scratchpad code is ephemeral: variables defined in the
214214
scratchpad aren't saved to notebook memory, and the code is not saved in

0 commit comments

Comments
 (0)