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.

fix: don't grey out streaming output in grid and slides layouts (#10094)

Myles Scolnick83c8db8a3d0a
diff --git a/frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx b/frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx
index 8a90469080..733f186e52 100644
--- a/frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx
+++ b/frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx
@@ -35,7 +35,7 @@ import {
import { Label } from "@/components/ui/label";
import { NumberField } from "@/components/ui/number-field";
import { Switch } from "@/components/ui/switch";
-import { outputIsLoading } from "@/core/cells/cell";
+import { outputIsLoading, outputIsStale } from "@/core/cells/cell";
import type { CellId } from "@/core/cells/ids";
import type { AppMode } from "@/core/mode";
import { useIsDragging } from "@/hooks/useIsDragging";
@@ -222,6 +222,7 @@ export const GridLayoutRenderer: React.FC<Props> = ({
cellId={cell.id}
output={cell.output}
status={cell.status}
+ stale={outputIsStale(cell, false)}
isScrollable={isScrollable}
side={side}
hidden={cell.errored || cell.interrupted || cell.stopped}
@@ -288,6 +289,7 @@ export const GridLayoutRenderer: React.FC<Props> = ({
cellId={cell.id}
output={cell.output}
status={cell.status}
+ stale={outputIsStale(cell, false)}
isScrollable={false}
hidden={false}
/>
@@ -358,6 +360,7 @@ export const GridLayoutRenderer: React.FC<Props> = ({
output={cell.output}
isScrollable={false}
status={cell.status}
+ stale={outputIsStale(cell, false)}
hidden={false}
/>
</div>
@@ -376,6 +379,7 @@ interface GridCellProps extends Pick<CellRuntimeState, "output" | "status"> {
hidden: boolean;
isScrollable: boolean;
side?: GridLayoutCellSide;
+ stale: boolean;
}
const GridCell = memo(
@@ -389,6 +393,7 @@ const GridCell = memo(
isScrollable,
side,
className,
+ stale,
}: GridCellProps) => {
const loading = outputIsLoading(status);
@@ -415,7 +420,7 @@ const GridCell = memo(
allowExpand={false}
output={output}
cellId={cellId}
- stale={loading}
+ stale={stale}
loading={loading}
/>
</div>
diff --git a/frontend/src/components/slides/__tests__/slide.test.tsx b/frontend/src/components/slides/__tests__/slide.test.tsx
new file mode 100644
index 0000000000..d5ec8b5bd4
--- /dev/null
+++ b/frontend/src/components/slides/__tests__/slide.test.tsx
@@ -0,0 +1,33 @@
+/* Copyright 2026 Marimo. All rights reserved. */
+
+import { render } from "@testing-library/react";
+import { describe, expect, it } from "vitest";
+import type { CellId } from "@/core/cells/ids";
+import type { OutputMessage } from "@/core/kernel/messages";
+import type { Seconds } from "@/utils/time";
+import { Slide } from "../slide";
+
+const cellId = "cell-1" as CellId;
+
+const output: OutputMessage = {
+ channel: "output",
+ mimetype: "text/plain",
+ data: "hello",
+ timestamp: 0 as Seconds,
+};
+
+describe("Slide", () => {
+ it("does not grey out the output when stale is false", () => {
+ const { container } = render(
+ <Slide cellId={cellId} status="running" output={output} stale={false} />,
+ );
+ expect(container.querySelector(".marimo-output-stale")).toBeNull();
+ });
+
+ it("greys out the output when stale is true", () => {
+ const { container } = render(
+ <Slide cellId={cellId} status="queued" output={output} stale={true} />,
+ );
+ expect(container.querySelector(".marimo-output-stale")).not.toBeNull();
+ });
+});
diff --git a/frontend/src/components/slides/minimap.tsx b/frontend/src/components/slides/minimap.tsx
index cd6a9d6a91..0d51fafc5f 100644
--- a/frontend/src/components/slides/minimap.tsx
+++ b/frontend/src/components/slides/minimap.tsx
@@ -1,6 +1,7 @@
/* Copyright 2026 Marimo. All rights reserved. */
import { useDeleteCellCallback } from "@/components/editor/cell/useDeleteCell";
+import { outputIsStale } from "@/core/cells/cell";
import { useCellActions, useCellIds } from "@/core/cells/cells";
import type { CellId } from "@/core/cells/ids";
import type { CellColumnId } from "@/utils/id-tree";
@@ -670,7 +671,12 @@ const SlideThumbnailCard = ({
{isNoOutput ? (
<MiniCodePreview code={cell.code} />
) : (
- <Slide cellId={cell.id} status={cell.status} output={cell.output} />
+ <Slide
+ cellId={cell.id}
+ status={cell.status}
+ output={cell.output}
+ stale={outputIsStale(cell, false)}
+ />
)}
</div>
)}
diff --git a/frontend/src/components/slides/reveal-component.tsx b/frontend/src/components/slides/reveal-component.tsx
index cdad147efe..8c01205644 100644
--- a/frontend/src/components/slides/reveal-component.tsx
+++ b/frontend/src/components/slides/reveal-component.tsx
@@ -16,6 +16,7 @@ import { Slide as CellOutputSlide } from "@/components/slides/slide";
import { Button } from "@/components/ui/button";
import { useFullScreenElement } from "@/components/ui/fullscreen";
import { Tooltip } from "@/components/ui/tooltip";
+import { outputIsStale } from "@/core/cells/cell";
import type { CellId } from "@/core/cells/ids";
import type { RuntimeCell } from "@/core/cells/types";
import type { RevealApi, RevealConfig } from "reveal.js";
@@ -333,6 +334,7 @@ const SubslideView = ({
cellId={cell.id}
status={cell.status}
output={cell.output}
+ stale={outputIsStale(cell, false)}
/>
);
}
@@ -397,6 +399,7 @@ const ParkedPreviewContent = ({
cellId={cell.id}
status={cell.status}
output={cell.output}
+ stale={outputIsStale(cell, false)}
/>
);
};
diff --git a/frontend/src/components/slides/slide-cell-view.tsx b/frontend/src/components/slides/slide-cell-view.tsx
index 753711e085..8933d59410 100644
--- a/frontend/src/components/slides/slide-cell-view.tsx
+++ b/frontend/src/components/slides/slide-cell-view.tsx
@@ -13,6 +13,7 @@ import { StopButton } from "@/components/editor/cell/StopButton";
import { useRunCell } from "@/components/editor/cell/useRunCells";
import { Slide as CellOutputSlide } from "@/components/slides/slide";
import { maybeAddMarimoImport } from "@/core/cells/add-missing-import";
+import { outputIsStale } from "@/core/cells/cell";
import { useCellActions } from "@/core/cells/cells";
import { autoInstantiateAtom, useUserConfig } from "@/core/config/config";
import {
@@ -96,6 +97,7 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
cellId={cell.id}
status={cell.status}
output={cell.output}
+ stale={outputIsStale(cell, false)}
/>
);
@@ -195,6 +197,7 @@ export const SlideCellReadOnlyView = ({ cell }: { cell: RuntimeCell }) => {
cellId={cell.id}
status={cell.status}
output={cell.output}
+ stale={outputIsStale(cell, false)}
/>
);
diff --git a/frontend/src/components/slides/slide.tsx b/frontend/src/components/slides/slide.tsx
index 5670e77f56..deb81568e9 100644
--- a/frontend/src/components/slides/slide.tsx
+++ b/frontend/src/components/slides/slide.tsx
@@ -11,19 +11,22 @@ interface SlideContentProps extends Pick<
"output" | "status"
> {
cellId: CellId;
+ stale: boolean;
}
-export const Slide = memo(({ output, cellId, status }: SlideContentProps) => {
- const loading = outputIsLoading(status);
- return (
- <OutputArea
- className="contents"
- allowExpand={false}
- output={output}
- cellId={cellId}
- stale={loading}
- loading={loading}
- />
- );
-});
+export const Slide = memo(
+ ({ output, cellId, status, stale }: SlideContentProps) => {
+ const loading = outputIsLoading(status);
+ return (
+ <OutputArea
+ className="contents"
+ allowExpand={false}
+ output={output}
+ cellId={cellId}
+ stale={stale}
+ loading={loading}
+ />
+ );
+ },
+);
Slide.displayName = "Slide";