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.

improvement: show last run in cell indicator (#2954)

Myles Scolnickde49311ddab4
diff --git a/frontend/src/components/editor/Cell.tsx b/frontend/src/components/editor/Cell.tsx
index c2a16185ae..55c3c78089 100644
--- a/frontend/src/components/editor/Cell.tsx
+++ b/frontend/src/components/editor/Cell.tsx
@@ -82,6 +82,7 @@ export interface CellProps
| "stopped"
| "staleInputs"
| "runStartTimestamp"
+ | "lastRunStartTimestamp"
| "runElapsedTimeMs"
| "debuggerActive"
>,
@@ -137,6 +138,7 @@ const CellComponent = (
consoleOutputs,
status,
runStartTimestamp,
+ lastRunStartTimestamp,
runElapsedTimeMs,
edited,
interrupted,
@@ -544,6 +546,7 @@ const CellComponent = (
elapsedTime={runElapsedTimeMs}
runStartTimestamp={runStartTimestamp}
uninstantiated={uninstantiated}
+ lastRunStartTimestamp={lastRunStartTimestamp}
/>
<div className="flex gap-2 items-end">
<CellDragHandle />
diff --git a/frontend/src/components/editor/cell/CellStatus.tsx b/frontend/src/components/editor/cell/CellStatus.tsx
index bc3c31984a..ceeee2cb48 100644
--- a/frontend/src/components/editor/cell/CellStatus.tsx
+++ b/frontend/src/components/editor/cell/CellStatus.tsx
@@ -13,11 +13,12 @@ import { MultiIcon } from "@/components/icons/multi-icon";
import "./cell-status.css";
import { Time } from "@/utils/time";
+import { formatDistanceToNow } from "date-fns";
export interface CellStatusComponentProps
extends Pick<
CellRuntimeState,
- "status" | "runStartTimestamp" | "interrupted"
+ "status" | "runStartTimestamp" | "interrupted" | "lastRunStartTimestamp"
> {
editing: boolean;
edited: boolean;
@@ -27,6 +28,26 @@ export interface CellStatusComponentProps
uninstantiated: boolean;
}
+// Looks like HH:MM:SS.SSS AM/PM
+const timeFormatter = new Intl.DateTimeFormat("en-US", {
+ hour: "numeric",
+ minute: "numeric",
+ second: "numeric",
+ fractionalSecondDigits: 3,
+ hour12: true,
+});
+
+// Looks like MM/DD HH:MM:SS.SSS AM/PM
+const dateTimeFormatter = new Intl.DateTimeFormat("en-US", {
+ month: "numeric",
+ day: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ second: "numeric",
+ fractionalSecondDigits: 3,
+ hour12: true,
+});
+
export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
editing,
status,
@@ -36,22 +57,32 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
interrupted,
elapsedTime,
runStartTimestamp,
+ lastRunStartTimestamp,
uninstantiated,
}) => {
if (!editing) {
return null;
}
+ const start = runStartTimestamp ?? lastRunStartTimestamp;
+ const lastRanTime = start ? <LastRanTime lastRanTime={start} /> : null;
+
// unexpected states
if (disabled && status === "running") {
Logger.error("CellStatusComponent: disabled and running");
return null;
}
+
// stale and disabled by self
if (disabled && staleInputs) {
return (
<Tooltip
- content={"This cell is stale, but it's disabled and can't be run"}
+ content={
+ <div className="flex flex-col gap-1">
+ <span>This cell is stale, but it's disabled and can't be run</span>
+ {lastRanTime}
+ </div>
+ }
usePortal={false}
>
<div
@@ -71,7 +102,15 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
// disabled, but not stale
if (disabled) {
return (
- <Tooltip content={"This cell is disabled"} usePortal={false}>
+ <Tooltip
+ content={
+ <div className="flex flex-col gap-1">
+ <span>This cell is disabled</span>
+ {lastRanTime}
+ </div>
+ }
+ usePortal={false}
+ >
<div
className="cell-status-icon cell-status-disabled"
data-testid="cell-status"
@@ -87,7 +126,14 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
if (!staleInputs && status === "disabled-transitively") {
return (
<Tooltip
- content={"An ancestor of this cell is disabled, so it can't be run"}
+ content={
+ <div className="flex flex-col gap-1">
+ <span>
+ An ancestor of this cell is disabled, so it can't be run
+ </span>
+ {lastRanTime}
+ </div>
+ }
usePortal={false}
>
<div
@@ -109,7 +155,12 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
return (
<Tooltip
content={
- "This cell is stale, but an ancestor is disabled so it can't be run"
+ <div className="flex flex-col gap-1">
+ <span>
+ This cell is stale, but an ancestor is disabled so it can't be run
+ </span>
+ {lastRanTime}
+ </div>
}
usePortal={false}
>
@@ -130,7 +181,15 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
// running & queued icons get priority over edited/interrupted
if (status === "running") {
return (
- <Tooltip content={"This cell is running"} usePortal={false}>
+ <Tooltip
+ content={
+ <div className="flex flex-col gap-1">
+ <span>This cell is running</span>
+ {lastRanTime}
+ </div>
+ }
+ usePortal={false}
+ >
<div
className={"cell-status-icon elapsed-time running"}
data-testid="cell-status"
@@ -147,7 +206,15 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
// queued
if (status === "queued") {
return (
- <Tooltip content={"This cell is queued to run"} usePortal={false}>
+ <Tooltip
+ content={
+ <div className="flex flex-col gap-1">
+ <span>This cell is queued to run</span>
+ {lastRanTime}
+ </div>
+ }
+ usePortal={false}
+ >
<div
className="cell-status-icon cell-status-queued"
data-testid="cell-status"
@@ -162,22 +229,30 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
// outdated: cell needs to be re-run
if (edited || interrupted || staleInputs || uninstantiated) {
const elapsedTimeStr = formatElapsedTime(elapsedTime);
+ const elapsedTimeComponent = elapsedTime ? (
+ <ElapsedTime elapsedTime={elapsedTimeStr} />
+ ) : null;
// Customize tooltips based on why the cell needs to be re-run
let title = "";
- let timerTitle = "";
+ let timerTitle: React.ReactNode = "";
+
if (uninstantiated) {
title = "This cell has not yet been run";
} else if (interrupted) {
title = "This cell was interrupted when it was last run";
- timerTitle = `This cell ran for ${elapsedTimeStr} before being interrupted`;
+ timerTitle = (
+ <span>
+ This cell ran for {elapsedTimeComponent} before being interrupted
+ </span>
+ );
} else if (edited) {
title = "This cell has been modified since it was last run";
- timerTitle = `This cell took ${elapsedTimeStr} to run`;
+ timerTitle = <span>This cell took {elapsedTimeComponent} to run</span>;
} else {
// staleInputs
title = "This cell has not been run with the latest inputs";
- timerTitle = `This cell took ${elapsedTimeStr} to run`;
+ timerTitle = <span>This cell took {elapsedTimeComponent} to run</span>;
}
return (
@@ -191,8 +266,16 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
<RefreshCwIcon className="h-5 w-5" strokeWidth={1.5} />
</div>
</Tooltip>
- {elapsedTimeStr && (
- <Tooltip content={timerTitle} usePortal={false}>
+ {elapsedTime && (
+ <Tooltip
+ content={
+ <div className="flex flex-col gap-1">
+ {timerTitle}
+ {lastRanTime}
+ </div>
+ }
+ usePortal={false}
+ >
<div
className={"elapsed-time hover-action"}
data-testid="cell-status"
@@ -209,9 +292,18 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
// either running or finished
if (elapsedTime !== null) {
const elapsedTimeStr = formatElapsedTime(elapsedTime);
+ const elapsedTimeComponent = elapsedTime ? (
+ <ElapsedTime elapsedTime={elapsedTimeStr} />
+ ) : null;
+
return (
<Tooltip
- content={`This cell took ${elapsedTimeStr} to run`}
+ content={
+ <div className="flex flex-col gap-1">
+ <span>This cell took {elapsedTimeComponent} to run</span>
+ {lastRanTime}
+ </div>
+ }
usePortal={false}
>
<div
@@ -229,6 +321,31 @@ export const CellStatusComponent: React.FC<CellStatusComponentProps> = ({
return null;
};
+const ElapsedTime = (props: { elapsedTime: string }) => {
+ return (
+ <span className="tracking-wide font-semibold">{props.elapsedTime}</span>
+ );
+};
+const LastRanTime = (props: { lastRanTime: number }) => {
+ const date = new Date(props.lastRanTime * 1000);
+ const today = new Date();
+ const formatter =
+ date.toDateString() === today.toDateString()
+ ? timeFormatter
+ : dateTimeFormatter;
+ return (
+ <span>
+ Ran at{" "}
+ <strong className="tracking-wide font-semibold">
+ {formatter.format(date)}
+ </strong>{" "}
+ <span className="text-muted-foreground">
+ ({formatDistanceToNow(date)} ago)
+ </span>
+ </span>
+ );
+};
+
function formatElapsedTime(elapsedTime: number | null) {
if (elapsedTime === null) {
return "";
diff --git a/frontend/src/components/editor/renderers/CellArray.tsx b/frontend/src/components/editor/renderers/CellArray.tsx
index e4bf47b081..398b5fe9ba 100644
--- a/frontend/src/components/editor/renderers/CellArray.tsx
+++ b/frontend/src/components/editor/renderers/CellArray.tsx
@@ -162,6 +162,9 @@ export const CellArray: React.FC<CellArrayProps> = ({
stopped={cellRuntime.stopped}
staleInputs={cellRuntime.staleInputs}
runStartTimestamp={cellRuntime.runStartTimestamp}
+ lastRunStartTimestamp={
+ cellRuntime.lastRunStartTimestamp
+ }
runElapsedTimeMs={
cellRuntime.runElapsedTimeMs ??
(cellData.lastExecutionTime as Milliseconds)
diff --git a/frontend/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap b/frontend/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap
index db690e27a2..5e8dc054cc 100644
--- a/frontend/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap
+++ b/frontend/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap
@@ -16,6 +16,7 @@ exports[`cell reducer > can initialize stdin 1`] = `
"interrupted": false,
"lastCodeRun": null,
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -44,6 +45,7 @@ exports[`cell reducer > can initialize stdin 2`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -72,6 +74,7 @@ exports[`cell reducer > can initialize stdin 3`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -100,6 +103,7 @@ exports[`cell reducer > can initialize stdin 4`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -135,6 +139,7 @@ exports[`cell reducer > can initialize stdin 5`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -170,6 +175,7 @@ exports[`cell reducer > can initialize stdin 6`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -211,6 +217,7 @@ exports[`cell reducer > can initialize stdin 7`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -253,6 +260,7 @@ exports[`cell reducer > can initialize stdin 8`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -301,6 +309,7 @@ exports[`cell reducer > can initialize stdin 9`] = `
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -329,6 +338,7 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
"interrupted": false,
"lastCodeRun": null,
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -364,6 +374,7 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -399,6 +410,7 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -427,6 +439,7 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -462,6 +475,7 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
"interrupted": false,
"lastCodeRun": "",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -490,6 +504,7 @@ exports[`cell reducer > can run a stale cell 1`] = `
"interrupted": false,
"lastCodeRun": "mo.slider()",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -518,6 +533,7 @@ exports[`cell reducer > can run a stale cell 2`] = `
"interrupted": false,
"lastCodeRun": "mo.slider()",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -546,6 +562,7 @@ exports[`cell reducer > can run a stopped cell 1`] = `
"interrupted": false,
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -574,6 +591,7 @@ exports[`cell reducer > can run a stopped cell 2`] = `
"interrupted": false,
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -602,6 +620,7 @@ exports[`cell reducer > can run a stopped cell 3`] = `
"interrupted": false,
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": {
@@ -641,6 +660,7 @@ exports[`cell reducer > can run a stopped cell 4`] = `
"interrupted": false,
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": {
@@ -680,6 +700,7 @@ exports[`cell reducer > can run a stopped cell 5`] = `
"interrupted": false,
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 40,
"name": "__",
"outline": null,
"output": null,
@@ -708,6 +729,7 @@ exports[`cell reducer > can run cell and receive cell messages 1`] = `
"interrupted": false,
"lastCodeRun": null,
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -736,6 +758,7 @@ exports[`cell reducer > can run cell and receive cell messages 2`] = `
"interrupted": false,
"lastCodeRun": null,
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -764,6 +787,7 @@ exports[`cell reducer > can run cell and receive cell messages 3`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -792,6 +816,7 @@ exports[`cell reducer > can run cell and receive cell messages 4`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -820,6 +845,7 @@ exports[`cell reducer > can run cell and receive cell messages 5`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -855,6 +881,7 @@ exports[`cell reducer > can run cell and receive cell messages 6`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": null,
@@ -890,6 +917,7 @@ exports[`cell reducer > can run cell and receive cell messages 7`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": {
@@ -931,6 +959,7 @@ import numpy",
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": {
@@ -971,6 +1000,7 @@ exports[`cell reducer > can run cell and receive cell messages 9`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": {
@@ -1012,6 +1042,7 @@ import numpy",
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 20,
"name": "__",
"outline": null,
"output": {
@@ -1054,6 +1085,7 @@ import numpy",
"lastCodeRun": "import marimo as mo
import numpy",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 50,
"name": "__",
"outline": null,
"output": {
@@ -1102,6 +1134,7 @@ import numpy",
"lastCodeRun": "import marimo as mo
import numpy",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": 50,
"name": "__",
"outline": null,
"output": {
@@ -1139,6 +1172,7 @@ exports[`cell reducer > errors reset status to idle 1`] = `
"interrupted": false,
"lastCodeRun": null,
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -1167,6 +1201,7 @@ exports[`cell reducer > errors reset status to idle 2`] = `
"interrupted": false,
"lastCodeRun": null,
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -1195,6 +1230,7 @@ exports[`cell reducer > errors reset status to idle 3`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": null,
@@ -1223,6 +1259,7 @@ exports[`cell reducer > errors reset status to idle 4`] = `
"interrupted": false,
"lastCodeRun": "import marimo as mo",
"lastExecutionTime": null,
+ "lastRunStartTimestamp": null,
"name": "__",
"outline": null,
"output": {
diff --git a/frontend/src/core/cells/__tests__/cells.test.ts b/frontend/src/core/cells/__tests__/cells.test.ts
index 1a8576673d..af0980c1fc 100644
--- a/frontend/src/core/cells/__tests__/cells.test.ts
+++ b/frontend/src/core/cells/__tests__/cells.test.ts
@@ -420,6 +420,7 @@ describe("cell reducer", () => {
expect(cell.edited).toBe(false);
expect(cell.runElapsedTimeMs).toBe(null);
expect(cell.runStartTimestamp).toBe(null);
+ expect(cell.lastRunStartTimestamp).toBe(null);
expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
// Receive running messages
@@ -437,6 +438,7 @@ describe("cell reducer", () => {
expect(cell.edited).toBe(false);
expect(cell.runElapsedTimeMs).toBe(null);
expect(cell.runStartTimestamp).toBe(20);
+ expect(cell.lastRunStartTimestamp).toBe(20);
expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
// Console messages shouldn't transition status
@@ -458,6 +460,7 @@ describe("cell reducer", () => {
expect(cell.edited).toBe(false);
expect(cell.runElapsedTimeMs).toBe(null);
expect(cell.runStartTimestamp).toBe(20);
+ expect(cell.lastRunStartTimestamp).toBe(20);
expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
// Receive output messages
@@ -484,6 +487,7 @@ describe("cell reducer", () => {
expect(cell.edited).toBe(false);
expect(cell.runElapsedTimeMs).toBe(13_000);
expect(cell.runStartTimestamp).toBe(null);
+ expect(cell.lastRunStartTimestamp).toBe(20);
expect(cell).toMatchSnapshot(); // snapshot everything as a catch all
// EDITING BACK AND FORTH
diff --git a/frontend/src/core/cells/cell.ts b/frontend/src/core/cells/cell.ts
index 8075f7090c..d891c739e2 100644
--- a/frontend/src/core/cells/cell.ts
+++ b/frontend/src/core/cells/cell.ts
@@ -39,6 +39,8 @@ export function transitionCell(
}
nextCell.stopped = false;
nextCell.runStartTimestamp = message.timestamp as Seconds;
+ // Store the last run timestamp, since this gets cleared once idle
+ nextCell.lastRunStartTimestamp = message.timestamp as Seconds;
break;
case "idle":
if (cell.runStartTimestamp) {
@@ -48,6 +50,11 @@ export function transitionCell(
nextCell.runStartTimestamp = null;
nextCell.staleInputs = false;
}
+ // If last run start timestamp is not set, set it to the current timestamp
+ // This happens on a resumed session
+ if (!cell.lastRunStartTimestamp && message.timestamp) {
+ nextCell.lastRunStartTimestamp = message.timestamp as Seconds;
+ }
nextCell.debuggerActive = false;
break;
case null:
diff --git a/frontend/src/core/cells/types.ts b/frontend/src/core/cells/types.ts
index a9ec8dcd14..4c006e61cf 100644
--- a/frontend/src/core/cells/types.ts
+++ b/frontend/src/core/cells/types.ts
@@ -50,6 +50,7 @@ export function createCellRuntimeState(
stopped: false,
runElapsedTimeMs: null,
runStartTimestamp: null,
+ lastRunStartTimestamp: null,
debuggerActive: false,
...state,
};
@@ -100,6 +101,8 @@ export interface CellRuntimeState {
runStartTimestamp: Seconds | null;
/** run elapsed time, in milliseconds */
runElapsedTimeMs: Milliseconds | null;
+ /** last run timestamp, as seconds since epoch */
+ lastRunStartTimestamp: Seconds | null;
/** debugger active */
debuggerActive: boolean;
}
diff --git a/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap b/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap
index 91d30e16a8..5d34c5f13a 100644
--- a/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap
+++ b/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap
@@ -545,106 +545,6 @@ exports[`makeSelectable > should work for geoshape 1`] = `
}
`;
-exports[`makeSelectable > should work for layered charts 1`] = `
-{
- "data": {
- "name": "data-34c3e7380bd529c27667c64406db8bb8",
- },
- "datasets": {
- "data-34c3e7380bd529c27667c64406db8bb8": [
- {
- "Level1": "a",
- "count": 1,
- "stage": "france",
- },
- {
- "Level1": "b",
- "count": 2,
- "stage": "france",
- },
- {
- "Level1": "c",
- "count": 3,
- "stage": "england",
- },
- ],
- },
- "layer": [
- {
- "encoding": {
- "color": {
- "condition": {
- "field": "stage",
- "param": "param_22",
- },
- "value": "lightgray",
- },
- "x": {
- "field": "Level1",
- "sort": {
- "order": "descending",
- },
- "title": "Subpillar",
- "type": "nominal",
- },
- "y": {
- "field": "count",
- "title": "Number of Companies",
- "type": "quantitative",
- },
- },
- "mark": {
- "type": "bar",
- },
- "name": "view_21",
- "params": [
- {
- "bind": "scales",
- "name": "pan_zoom",
- "select": {
- "on": "[mousedown[event.metaKey], window:mouseup] > window:mousemove!",
- "translate": "[mousedown[event.metaKey], window:mouseup] > window:mousemove!",
- "type": "interval",
- "zoom": "wheel![event.metaKey]",
- },
- },
- ],
- },
- {
- "encoding": {
- "color": {
- "datum": "england",
- },
- "y": {
- "datum": 2,
- },
- },
- "mark": {
- "strokeDash": [
- 2,
- 2,
- ],
- "type": "rule",
- },
- },
- ],
- "params": [
- {
- "name": "param_22",
- "select": {
- "encodings": [
- "x",
- ],
- "type": "point",
- },
- "views": [
- "view_21",
- ],
- },
- ],
-}
-`;
-
exports[`makeSelectable > should work for layered charts, with existing legend selection 1`] = `
{
"data": {
diff --git a/frontend/src/stories/cell.stories.tsx b/frontend/src/stories/cell.stories.tsx
index 8c38c11f43..7a680d79d9 100644
--- a/frontend/src/stories/cell.stories.tsx
+++ b/frontend/src/stories/cell.stories.tsx
@@ -33,6 +33,7 @@ const props: CellProps = {
prepareForRun: Logger.log,
runStartTimestamp: 0 as Seconds,
runElapsedTimeMs: 10 as Milliseconds,
+ lastRunStartTimestamp: 0 as Seconds,
serializedEditorState: null,
mode: "edit",
name: "cell_1",