@marimo-team/islands 0.25.3-dev275 → 0.25.3-dev279
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/{ErrorBoundary-BuIXiuc5.js → ErrorBoundary-DmTMuDPR.js} +1 -1
- package/dist/{chat-ui-SZ6lSH52.js → chat-ui-v1Fdh0NA.js} +270 -270
- package/dist/{code-visibility-BEAPMrC-.js → code-visibility-Dw4-TXN0.js} +2 -2
- package/dist/{common-CEmzaoJ8.js → common-BXMFi4lr.js} +4947 -4943
- package/dist/{data-grid-overlay-editor-CUo25_W8.js → data-grid-overlay-editor-hZzwX7Ia.js} +1 -1
- package/dist/{error-entries-B-1yUdcH.js → error-entries-C1S-Rmyt.js} +545 -535
- package/dist/{feedback-button-BqiR7zMO.js → feedback-button-6Ui2TDLR.js} +5 -5
- package/dist/{glide-data-editor-B7dguvqk.js → glide-data-editor-PZNlrSDI.js} +3 -3
- package/dist/{globals-CYykXfGI.js → globals-DX6FPZYq.js} +1 -1
- package/dist/{html-to-image-DC_pmZLs.js → html-to-image-CqGUd58T.js} +14452 -14452
- package/dist/main.js +6031 -6036
- package/dist/{number-overlay-editor-C4u7SJAJ.js → number-overlay-editor-D0CsL3_R.js} +1 -1
- package/dist/{process-output-DYu84VfZ.js → process-output-DskX9jLa.js} +2 -2
- package/dist/{reveal-component-DGi-irHV.js → reveal-component-D7xeI1QR.js} +906 -906
- package/package.json +1 -1
- package/src/__mocks__/executions.ts +4 -2
- package/src/__mocks__/notebook.ts +0 -2
- package/src/__tests__/CellStatus.test.tsx +6 -6
- package/src/components/editor/__tests__/data-attributes.test.tsx +0 -2
- package/src/components/editor/__tests__/output-persistence.test.tsx +20 -5
- package/src/components/editor/cell/CellStatus.tsx +6 -5
- package/src/components/editor/cell/__tests__/useRunCells.test.tsx +169 -0
- package/src/components/editor/cell/collapse.tsx +3 -4
- package/src/components/editor/cell/useRunCells.ts +32 -3
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +2 -3
- package/src/components/editor/notebook-cell.tsx +23 -37
- package/src/components/editor/renderers/grid-layout/grid-layout.tsx +4 -10
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -2
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +8 -5
- package/src/components/slides/minimap.tsx +3 -2
- package/src/components/slides/reveal-component.tsx +3 -2
- package/src/components/slides/slide-cell-view.tsx +8 -8
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -101
- package/src/core/cells/__tests__/actions.test.ts +0 -1
- package/src/core/cells/__tests__/cell.test.ts +81 -17
- package/src/core/cells/__tests__/cells.test.ts +0 -100
- package/src/core/cells/__tests__/document.test.ts +2 -8
- package/src/core/cells/__tests__/utils.test.ts +93 -24
- package/src/core/cells/actions.ts +0 -1
- package/src/core/cells/cell.ts +37 -14
- package/src/core/cells/cells.ts +10 -99
- package/src/core/cells/document.ts +2 -13
- package/src/core/cells/types.ts +0 -23
- package/src/core/cells/utils.ts +44 -17
- package/src/core/codemirror/cells/extensions.ts +0 -14
- package/src/core/errors/__tests__/error-entries.test.ts +40 -1
- package/src/core/errors/error-entries.ts +2 -3
- package/src/core/executions/__tests__/freshness.test.ts +420 -0
- package/src/core/executions/__tests__/hooks.test.tsx +106 -0
- package/src/core/executions/atoms.ts +22 -0
- package/src/core/executions/freshness.ts +164 -0
- package/src/core/executions/hooks.ts +17 -1
- package/src/core/executions/index.ts +3 -1
- package/src/core/islands/bootstrap.ts +0 -1
- package/src/core/kernel/handlers.ts +0 -4
- package/src/core/session/useNotebookSession.tsx +2 -7
- package/src/stories/cell-status.stories.tsx +12 -14
- package/src/stories/cell.stories.tsx +44 -10
- package/src/stories/layout/vertical/one-column.stories.tsx +0 -10
- package/src/components/editor/cell/__tests__/useRunCells.test.ts +0 -45
|
@@ -11,13 +11,10 @@ exports[`cell reducer > can initialize stdin > initial state 1`] = `
|
|
|
11
11
|
},
|
|
12
12
|
"consoleOutputs": [],
|
|
13
13
|
"debuggerActive": false,
|
|
14
|
-
"edited": false,
|
|
15
14
|
"id": "0",
|
|
16
|
-
"lastCodeRun": null,
|
|
17
15
|
"name": "_",
|
|
18
16
|
"outline": null,
|
|
19
17
|
"output": null,
|
|
20
|
-
"staleInputs": false,
|
|
21
18
|
}
|
|
22
19
|
`;
|
|
23
20
|
|
|
@@ -32,13 +29,10 @@ exports[`cell reducer > can initialize stdin > prepared for run 1`] = `
|
|
|
32
29
|
},
|
|
33
30
|
"consoleOutputs": [],
|
|
34
31
|
"debuggerActive": false,
|
|
35
|
-
"edited": false,
|
|
36
32
|
"id": "0",
|
|
37
|
-
"lastCodeRun": "",
|
|
38
33
|
"name": "_",
|
|
39
34
|
"outline": null,
|
|
40
35
|
"output": null,
|
|
41
|
-
"staleInputs": false,
|
|
42
36
|
}
|
|
43
37
|
`;
|
|
44
38
|
|
|
@@ -53,13 +47,10 @@ exports[`cell reducer > can initialize stdin > queued message received 1`] = `
|
|
|
53
47
|
},
|
|
54
48
|
"consoleOutputs": [],
|
|
55
49
|
"debuggerActive": false,
|
|
56
|
-
"edited": false,
|
|
57
50
|
"id": "0",
|
|
58
|
-
"lastCodeRun": "",
|
|
59
51
|
"name": "_",
|
|
60
52
|
"outline": null,
|
|
61
53
|
"output": null,
|
|
62
|
-
"staleInputs": false,
|
|
63
54
|
}
|
|
64
55
|
`;
|
|
65
56
|
|
|
@@ -74,13 +65,10 @@ exports[`cell reducer > can initialize stdin > running message received 1`] = `
|
|
|
74
65
|
},
|
|
75
66
|
"consoleOutputs": [],
|
|
76
67
|
"debuggerActive": false,
|
|
77
|
-
"edited": false,
|
|
78
68
|
"id": "0",
|
|
79
|
-
"lastCodeRun": "",
|
|
80
69
|
"name": "_",
|
|
81
70
|
"outline": null,
|
|
82
71
|
"output": null,
|
|
83
|
-
"staleInputs": false,
|
|
84
72
|
}
|
|
85
73
|
`;
|
|
86
74
|
|
|
@@ -117,14 +105,11 @@ exports[`cell reducer > can initialize stdin > second stdin requested 1`] = `
|
|
|
117
105
|
},
|
|
118
106
|
],
|
|
119
107
|
"debuggerActive": false,
|
|
120
|
-
"edited": false,
|
|
121
108
|
"id": "0",
|
|
122
109
|
"interrupted": false,
|
|
123
|
-
"lastCodeRun": "",
|
|
124
110
|
"name": "_",
|
|
125
111
|
"outline": null,
|
|
126
112
|
"output": null,
|
|
127
|
-
"staleInputs": false,
|
|
128
113
|
}
|
|
129
114
|
`;
|
|
130
115
|
|
|
@@ -154,14 +139,11 @@ exports[`cell reducer > can initialize stdin > stdin answered 1`] = `
|
|
|
154
139
|
},
|
|
155
140
|
],
|
|
156
141
|
"debuggerActive": false,
|
|
157
|
-
"edited": false,
|
|
158
142
|
"id": "0",
|
|
159
143
|
"interrupted": false,
|
|
160
|
-
"lastCodeRun": "",
|
|
161
144
|
"name": "_",
|
|
162
145
|
"outline": null,
|
|
163
146
|
"output": null,
|
|
164
|
-
"staleInputs": false,
|
|
165
147
|
}
|
|
166
148
|
`;
|
|
167
149
|
|
|
@@ -190,13 +172,10 @@ exports[`cell reducer > can initialize stdin > stdin requested 1`] = `
|
|
|
190
172
|
},
|
|
191
173
|
],
|
|
192
174
|
"debuggerActive": false,
|
|
193
|
-
"edited": false,
|
|
194
175
|
"id": "0",
|
|
195
|
-
"lastCodeRun": "",
|
|
196
176
|
"name": "_",
|
|
197
177
|
"outline": null,
|
|
198
178
|
"output": null,
|
|
199
|
-
"staleInputs": false,
|
|
200
179
|
}
|
|
201
180
|
`;
|
|
202
181
|
|
|
@@ -218,13 +197,10 @@ exports[`cell reducer > can initialize stdin > stdout received 1`] = `
|
|
|
218
197
|
},
|
|
219
198
|
],
|
|
220
199
|
"debuggerActive": false,
|
|
221
|
-
"edited": false,
|
|
222
200
|
"id": "0",
|
|
223
|
-
"lastCodeRun": "",
|
|
224
201
|
"name": "_",
|
|
225
202
|
"outline": null,
|
|
226
203
|
"output": null,
|
|
227
|
-
"staleInputs": false,
|
|
228
204
|
}
|
|
229
205
|
`;
|
|
230
206
|
|
|
@@ -246,13 +222,10 @@ exports[`cell reducer > can initialize stdin > stdout verified 1`] = `
|
|
|
246
222
|
},
|
|
247
223
|
],
|
|
248
224
|
"debuggerActive": false,
|
|
249
|
-
"edited": false,
|
|
250
225
|
"id": "0",
|
|
251
|
-
"lastCodeRun": "",
|
|
252
226
|
"name": "_",
|
|
253
227
|
"outline": null,
|
|
254
228
|
"output": null,
|
|
255
|
-
"staleInputs": false,
|
|
256
229
|
}
|
|
257
230
|
`;
|
|
258
231
|
|
|
@@ -267,13 +240,10 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
267
240
|
},
|
|
268
241
|
"consoleOutputs": [],
|
|
269
242
|
"debuggerActive": false,
|
|
270
|
-
"edited": false,
|
|
271
243
|
"id": "0",
|
|
272
|
-
"lastCodeRun": "",
|
|
273
244
|
"name": "_",
|
|
274
245
|
"outline": null,
|
|
275
246
|
"output": null,
|
|
276
|
-
"staleInputs": false,
|
|
277
247
|
}
|
|
278
248
|
`;
|
|
279
249
|
|
|
@@ -295,13 +265,10 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
295
265
|
},
|
|
296
266
|
],
|
|
297
267
|
"debuggerActive": false,
|
|
298
|
-
"edited": false,
|
|
299
268
|
"id": "0",
|
|
300
|
-
"lastCodeRun": "",
|
|
301
269
|
"name": "_",
|
|
302
270
|
"outline": null,
|
|
303
271
|
"output": null,
|
|
304
|
-
"staleInputs": false,
|
|
305
272
|
}
|
|
306
273
|
`;
|
|
307
274
|
|
|
@@ -316,13 +283,10 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
316
283
|
},
|
|
317
284
|
"consoleOutputs": [],
|
|
318
285
|
"debuggerActive": false,
|
|
319
|
-
"edited": false,
|
|
320
286
|
"id": "0",
|
|
321
|
-
"lastCodeRun": null,
|
|
322
287
|
"name": "_",
|
|
323
288
|
"outline": null,
|
|
324
289
|
"output": null,
|
|
325
|
-
"staleInputs": false,
|
|
326
290
|
}
|
|
327
291
|
`;
|
|
328
292
|
|
|
@@ -344,13 +308,10 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
344
308
|
},
|
|
345
309
|
],
|
|
346
310
|
"debuggerActive": false,
|
|
347
|
-
"edited": false,
|
|
348
311
|
"id": "0",
|
|
349
|
-
"lastCodeRun": "",
|
|
350
312
|
"name": "_",
|
|
351
313
|
"outline": null,
|
|
352
314
|
"output": null,
|
|
353
|
-
"staleInputs": false,
|
|
354
315
|
}
|
|
355
316
|
`;
|
|
356
317
|
|
|
@@ -372,13 +333,10 @@ exports[`cell reducer > can receive console when the cell is idle and will clear
|
|
|
372
333
|
},
|
|
373
334
|
],
|
|
374
335
|
"debuggerActive": false,
|
|
375
|
-
"edited": false,
|
|
376
336
|
"id": "0",
|
|
377
|
-
"lastCodeRun": "",
|
|
378
337
|
"name": "_",
|
|
379
338
|
"outline": null,
|
|
380
339
|
"output": null,
|
|
381
|
-
"staleInputs": false,
|
|
382
340
|
}
|
|
383
341
|
`;
|
|
384
342
|
|
|
@@ -393,13 +351,10 @@ exports[`cell reducer > can run a stale cell > queued message received 1`] = `
|
|
|
393
351
|
},
|
|
394
352
|
"consoleOutputs": [],
|
|
395
353
|
"debuggerActive": false,
|
|
396
|
-
"edited": false,
|
|
397
354
|
"id": "1",
|
|
398
|
-
"lastCodeRun": "mo.slider()",
|
|
399
355
|
"name": "_",
|
|
400
356
|
"outline": null,
|
|
401
357
|
"output": null,
|
|
402
|
-
"staleInputs": false,
|
|
403
358
|
}
|
|
404
359
|
`;
|
|
405
360
|
|
|
@@ -414,13 +369,10 @@ exports[`cell reducer > can run a stale cell > stale inputs received 1`] = `
|
|
|
414
369
|
},
|
|
415
370
|
"consoleOutputs": [],
|
|
416
371
|
"debuggerActive": false,
|
|
417
|
-
"edited": false,
|
|
418
372
|
"id": "1",
|
|
419
|
-
"lastCodeRun": "mo.slider()",
|
|
420
373
|
"name": "_",
|
|
421
374
|
"outline": null,
|
|
422
375
|
"output": null,
|
|
423
|
-
"staleInputs": true,
|
|
424
376
|
}
|
|
425
377
|
`;
|
|
426
378
|
|
|
@@ -435,9 +387,7 @@ exports[`cell reducer > can run a stopped cell > ancestor stopped 1`] = `
|
|
|
435
387
|
},
|
|
436
388
|
"consoleOutputs": [],
|
|
437
389
|
"debuggerActive": false,
|
|
438
|
-
"edited": false,
|
|
439
390
|
"id": "0",
|
|
440
|
-
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
|
|
441
391
|
"name": "_",
|
|
442
392
|
"outline": null,
|
|
443
393
|
"output": {
|
|
@@ -452,7 +402,6 @@ exports[`cell reducer > can run a stopped cell > ancestor stopped 1`] = `
|
|
|
452
402
|
"mimetype": "application/vnd.marimo+error",
|
|
453
403
|
"timestamp": 20,
|
|
454
404
|
},
|
|
455
|
-
"staleInputs": false,
|
|
456
405
|
}
|
|
457
406
|
`;
|
|
458
407
|
|
|
@@ -467,13 +416,10 @@ exports[`cell reducer > can run a stopped cell > idle message received 1`] = `
|
|
|
467
416
|
},
|
|
468
417
|
"consoleOutputs": [],
|
|
469
418
|
"debuggerActive": false,
|
|
470
|
-
"edited": false,
|
|
471
419
|
"id": "0",
|
|
472
|
-
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
|
|
473
420
|
"name": "_",
|
|
474
421
|
"outline": null,
|
|
475
422
|
"output": null,
|
|
476
|
-
"staleInputs": false,
|
|
477
423
|
}
|
|
478
424
|
`;
|
|
479
425
|
|
|
@@ -488,9 +434,7 @@ exports[`cell reducer > can run a stopped cell > queued after stop 1`] = `
|
|
|
488
434
|
},
|
|
489
435
|
"consoleOutputs": [],
|
|
490
436
|
"debuggerActive": false,
|
|
491
|
-
"edited": false,
|
|
492
437
|
"id": "0",
|
|
493
|
-
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
|
|
494
438
|
"name": "_",
|
|
495
439
|
"outline": null,
|
|
496
440
|
"output": {
|
|
@@ -505,7 +449,6 @@ exports[`cell reducer > can run a stopped cell > queued after stop 1`] = `
|
|
|
505
449
|
"mimetype": "application/vnd.marimo+error",
|
|
506
450
|
"timestamp": 20,
|
|
507
451
|
},
|
|
508
|
-
"staleInputs": false,
|
|
509
452
|
}
|
|
510
453
|
`;
|
|
511
454
|
|
|
@@ -520,13 +463,10 @@ exports[`cell reducer > can run a stopped cell > queued message received 1`] = `
|
|
|
520
463
|
},
|
|
521
464
|
"consoleOutputs": [],
|
|
522
465
|
"debuggerActive": false,
|
|
523
|
-
"edited": false,
|
|
524
466
|
"id": "0",
|
|
525
|
-
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
|
|
526
467
|
"name": "_",
|
|
527
468
|
"outline": null,
|
|
528
469
|
"output": null,
|
|
529
|
-
"staleInputs": false,
|
|
530
470
|
}
|
|
531
471
|
`;
|
|
532
472
|
|
|
@@ -541,13 +481,10 @@ exports[`cell reducer > can run a stopped cell > running after stop 1`] = `
|
|
|
541
481
|
},
|
|
542
482
|
"consoleOutputs": [],
|
|
543
483
|
"debuggerActive": false,
|
|
544
|
-
"edited": false,
|
|
545
484
|
"id": "0",
|
|
546
|
-
"lastCodeRun": "mo.md('This has an ancestor that was stopped')",
|
|
547
485
|
"name": "_",
|
|
548
486
|
"outline": null,
|
|
549
487
|
"output": null,
|
|
550
|
-
"staleInputs": false,
|
|
551
488
|
}
|
|
552
489
|
`;
|
|
553
490
|
|
|
@@ -570,9 +507,7 @@ import numpy",
|
|
|
570
507
|
},
|
|
571
508
|
],
|
|
572
509
|
"debuggerActive": false,
|
|
573
|
-
"edited": true,
|
|
574
510
|
"id": "0",
|
|
575
|
-
"lastCodeRun": "import marimo as mo",
|
|
576
511
|
"name": "_",
|
|
577
512
|
"outline": null,
|
|
578
513
|
"output": {
|
|
@@ -581,7 +516,6 @@ import numpy",
|
|
|
581
516
|
"mimetype": "text/plain",
|
|
582
517
|
"timestamp": 0,
|
|
583
518
|
},
|
|
584
|
-
"staleInputs": false,
|
|
585
519
|
}
|
|
586
520
|
`;
|
|
587
521
|
|
|
@@ -596,13 +530,10 @@ exports[`cell reducer > can run cell and receive cell messages > code edited 1`]
|
|
|
596
530
|
},
|
|
597
531
|
"consoleOutputs": [],
|
|
598
532
|
"debuggerActive": false,
|
|
599
|
-
"edited": true,
|
|
600
533
|
"id": "0",
|
|
601
|
-
"lastCodeRun": null,
|
|
602
534
|
"name": "_",
|
|
603
535
|
"outline": null,
|
|
604
536
|
"output": null,
|
|
605
|
-
"staleInputs": false,
|
|
606
537
|
}
|
|
607
538
|
`;
|
|
608
539
|
|
|
@@ -625,9 +556,7 @@ import numpy",
|
|
|
625
556
|
},
|
|
626
557
|
],
|
|
627
558
|
"debuggerActive": false,
|
|
628
|
-
"edited": true,
|
|
629
559
|
"id": "0",
|
|
630
|
-
"lastCodeRun": "import marimo as mo",
|
|
631
560
|
"name": "_",
|
|
632
561
|
"outline": null,
|
|
633
562
|
"output": {
|
|
@@ -636,7 +565,6 @@ import numpy",
|
|
|
636
565
|
"mimetype": "text/plain",
|
|
637
566
|
"timestamp": 0,
|
|
638
567
|
},
|
|
639
|
-
"staleInputs": false,
|
|
640
568
|
}
|
|
641
569
|
`;
|
|
642
570
|
|
|
@@ -658,9 +586,7 @@ exports[`cell reducer > can run cell and receive cell messages > code reverted 1
|
|
|
658
586
|
},
|
|
659
587
|
],
|
|
660
588
|
"debuggerActive": false,
|
|
661
|
-
"edited": false,
|
|
662
589
|
"id": "0",
|
|
663
|
-
"lastCodeRun": "import marimo as mo",
|
|
664
590
|
"name": "_",
|
|
665
591
|
"outline": null,
|
|
666
592
|
"output": {
|
|
@@ -669,7 +595,6 @@ exports[`cell reducer > can run cell and receive cell messages > code reverted 1
|
|
|
669
595
|
"mimetype": "text/plain",
|
|
670
596
|
"timestamp": 0,
|
|
671
597
|
},
|
|
672
|
-
"staleInputs": false,
|
|
673
598
|
}
|
|
674
599
|
`;
|
|
675
600
|
|
|
@@ -691,13 +616,10 @@ exports[`cell reducer > can run cell and receive cell messages > console message
|
|
|
691
616
|
},
|
|
692
617
|
],
|
|
693
618
|
"debuggerActive": false,
|
|
694
|
-
"edited": false,
|
|
695
619
|
"id": "0",
|
|
696
|
-
"lastCodeRun": "import marimo as mo",
|
|
697
620
|
"name": "_",
|
|
698
621
|
"outline": null,
|
|
699
622
|
"output": null,
|
|
700
|
-
"staleInputs": false,
|
|
701
623
|
}
|
|
702
624
|
`;
|
|
703
625
|
|
|
@@ -720,10 +642,7 @@ import numpy",
|
|
|
720
642
|
},
|
|
721
643
|
],
|
|
722
644
|
"debuggerActive": false,
|
|
723
|
-
"edited": false,
|
|
724
645
|
"id": "0",
|
|
725
|
-
"lastCodeRun": "import marimo as mo
|
|
726
|
-
import numpy",
|
|
727
646
|
"name": "_",
|
|
728
647
|
"outline": null,
|
|
729
648
|
"output": {
|
|
@@ -738,7 +657,6 @@ import numpy",
|
|
|
738
657
|
"mimetype": "application/vnd.marimo+error",
|
|
739
658
|
"timestamp": 0,
|
|
740
659
|
},
|
|
741
|
-
"staleInputs": false,
|
|
742
660
|
}
|
|
743
661
|
`;
|
|
744
662
|
|
|
@@ -753,13 +671,10 @@ exports[`cell reducer > can run cell and receive cell messages > initial state 1
|
|
|
753
671
|
},
|
|
754
672
|
"consoleOutputs": [],
|
|
755
673
|
"debuggerActive": false,
|
|
756
|
-
"edited": false,
|
|
757
674
|
"id": "0",
|
|
758
|
-
"lastCodeRun": null,
|
|
759
675
|
"name": "_",
|
|
760
676
|
"outline": null,
|
|
761
677
|
"output": null,
|
|
762
|
-
"staleInputs": false,
|
|
763
678
|
}
|
|
764
679
|
`;
|
|
765
680
|
|
|
@@ -782,10 +697,7 @@ import numpy",
|
|
|
782
697
|
},
|
|
783
698
|
],
|
|
784
699
|
"debuggerActive": false,
|
|
785
|
-
"edited": false,
|
|
786
700
|
"id": "0",
|
|
787
|
-
"lastCodeRun": "import marimo as mo
|
|
788
|
-
import numpy",
|
|
789
701
|
"name": "_",
|
|
790
702
|
"outline": null,
|
|
791
703
|
"output": {
|
|
@@ -798,7 +710,6 @@ import numpy",
|
|
|
798
710
|
"mimetype": "application/vnd.marimo+error",
|
|
799
711
|
"timestamp": 0,
|
|
800
712
|
},
|
|
801
|
-
"staleInputs": false,
|
|
802
713
|
}
|
|
803
714
|
`;
|
|
804
715
|
|
|
@@ -820,9 +731,7 @@ exports[`cell reducer > can run cell and receive cell messages > output received
|
|
|
820
731
|
},
|
|
821
732
|
],
|
|
822
733
|
"debuggerActive": false,
|
|
823
|
-
"edited": false,
|
|
824
734
|
"id": "0",
|
|
825
|
-
"lastCodeRun": "import marimo as mo",
|
|
826
735
|
"name": "_",
|
|
827
736
|
"outline": null,
|
|
828
737
|
"output": {
|
|
@@ -831,7 +740,6 @@ exports[`cell reducer > can run cell and receive cell messages > output received
|
|
|
831
740
|
"mimetype": "text/plain",
|
|
832
741
|
"timestamp": 0,
|
|
833
742
|
},
|
|
834
|
-
"staleInputs": false,
|
|
835
743
|
}
|
|
836
744
|
`;
|
|
837
745
|
|
|
@@ -846,13 +754,10 @@ exports[`cell reducer > can run cell and receive cell messages > prepared for ru
|
|
|
846
754
|
},
|
|
847
755
|
"consoleOutputs": [],
|
|
848
756
|
"debuggerActive": false,
|
|
849
|
-
"edited": false,
|
|
850
757
|
"id": "0",
|
|
851
|
-
"lastCodeRun": "import marimo as mo",
|
|
852
758
|
"name": "_",
|
|
853
759
|
"outline": null,
|
|
854
760
|
"output": null,
|
|
855
|
-
"staleInputs": false,
|
|
856
761
|
}
|
|
857
762
|
`;
|
|
858
763
|
|
|
@@ -867,13 +772,10 @@ exports[`cell reducer > can run cell and receive cell messages > queued message
|
|
|
867
772
|
},
|
|
868
773
|
"consoleOutputs": [],
|
|
869
774
|
"debuggerActive": false,
|
|
870
|
-
"edited": false,
|
|
871
775
|
"id": "0",
|
|
872
|
-
"lastCodeRun": "import marimo as mo",
|
|
873
776
|
"name": "_",
|
|
874
777
|
"outline": null,
|
|
875
778
|
"output": null,
|
|
876
|
-
"staleInputs": false,
|
|
877
779
|
}
|
|
878
780
|
`;
|
|
879
781
|
|
|
@@ -888,12 +790,9 @@ exports[`cell reducer > can run cell and receive cell messages > running message
|
|
|
888
790
|
},
|
|
889
791
|
"consoleOutputs": [],
|
|
890
792
|
"debuggerActive": false,
|
|
891
|
-
"edited": false,
|
|
892
793
|
"id": "0",
|
|
893
|
-
"lastCodeRun": "import marimo as mo",
|
|
894
794
|
"name": "_",
|
|
895
795
|
"outline": null,
|
|
896
796
|
"output": null,
|
|
897
|
-
"staleInputs": false,
|
|
898
797
|
}
|
|
899
798
|
`;
|
|
@@ -384,7 +384,6 @@ describe("undoDeleteCellAtom", () => {
|
|
|
384
384
|
expect(store.get(restoredEditorStatesAtom).get(c2)).toMatchObject({
|
|
385
385
|
doc: "y = 2",
|
|
386
386
|
});
|
|
387
|
-
expect(notebook().cellData[c2].edited).toBe(true);
|
|
388
387
|
expect(notebook().scrollKey).toBe(c2);
|
|
389
388
|
expect(notebook().history).toEqual([]);
|
|
390
389
|
});
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
CellExecutionView,
|
|
5
|
+
CellFreshness,
|
|
6
|
+
CellRunStatus,
|
|
7
|
+
} from "@/core/executions";
|
|
4
8
|
import type { CellMessage, OutputMessage } from "@/core/kernel/messages";
|
|
5
9
|
import type { Milliseconds, Seconds } from "@/utils/time";
|
|
6
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
consoleOutputIsStale,
|
|
12
|
+
outputIsLoading,
|
|
13
|
+
outputIsStale,
|
|
14
|
+
transitionCell,
|
|
15
|
+
} from "../cell";
|
|
7
16
|
import { createCellRuntimeState } from "../types";
|
|
8
17
|
|
|
9
18
|
const STATUSES: CellRunStatus[] = ["queued", "running", "idle"];
|
|
10
19
|
|
|
11
20
|
const NOW = Date.now() as Milliseconds;
|
|
12
21
|
|
|
22
|
+
const CURRENT: CellFreshness = { sourceChanged: false, inputsChanged: false };
|
|
23
|
+
const EDITED: CellFreshness = { sourceChanged: true, inputsChanged: false };
|
|
24
|
+
const REPLACED: CellFreshness = { sourceChanged: false, inputsChanged: true };
|
|
25
|
+
const BOTH: CellFreshness = { sourceChanged: true, inputsChanged: true };
|
|
26
|
+
|
|
13
27
|
type View = Pick<
|
|
14
28
|
CellExecutionView,
|
|
15
29
|
"status" | "outcome" | "startedAt" | "rendered"
|
|
@@ -43,54 +57,104 @@ describe("outputIsStale", () => {
|
|
|
43
57
|
it.each(STATUSES)(
|
|
44
58
|
"should return true if the cell is edited and status is %s",
|
|
45
59
|
(status) => {
|
|
46
|
-
expect(outputIsStale(view({ status }),
|
|
60
|
+
expect(outputIsStale(view({ status }), EDITED, true)).toBe(true);
|
|
47
61
|
},
|
|
48
62
|
);
|
|
49
63
|
|
|
50
64
|
it("should return true if the cell is loading", () => {
|
|
51
|
-
expect(outputIsStale(view({ status: "running" }),
|
|
65
|
+
expect(outputIsStale(view({ status: "running" }), CURRENT, false)).toBe(
|
|
66
|
+
true,
|
|
67
|
+
);
|
|
52
68
|
});
|
|
53
69
|
|
|
54
70
|
it("should return false if the cell is running and has shown output", () => {
|
|
55
71
|
const running = view({ status: "running", rendered: true });
|
|
56
|
-
expect(outputIsStale(running,
|
|
72
|
+
expect(outputIsStale(running, CURRENT, false)).toBe(false);
|
|
57
73
|
});
|
|
58
74
|
|
|
59
75
|
it("should return true if the cell has stale inputs", () => {
|
|
60
|
-
expect(outputIsStale(view({}),
|
|
76
|
+
expect(outputIsStale(view({}), REPLACED, false)).toBe(true);
|
|
61
77
|
});
|
|
62
78
|
|
|
63
79
|
it("should return false if the cell is interrupted", () => {
|
|
64
|
-
expect(
|
|
65
|
-
false,
|
|
66
|
-
);
|
|
80
|
+
expect(
|
|
81
|
+
outputIsStale(view({ outcome: "interrupted" }), CURRENT, false),
|
|
82
|
+
).toBe(false);
|
|
67
83
|
});
|
|
68
84
|
|
|
69
85
|
it("should return false if the cell is idle and not edited", () => {
|
|
70
|
-
expect(outputIsStale(view({}),
|
|
86
|
+
expect(outputIsStale(view({}), CURRENT, false)).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("should return true if the source changed while editing", () => {
|
|
90
|
+
expect(outputIsStale(view({}), EDITED, true)).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("should keep showing the last result of edited source in a read view", () => {
|
|
94
|
+
expect(outputIsStale(view({}), EDITED, false)).toBe(false);
|
|
71
95
|
});
|
|
72
96
|
|
|
73
97
|
it("should return true if the cell is queued", () => {
|
|
74
|
-
expect(outputIsStale(view({ status: "queued" }),
|
|
98
|
+
expect(outputIsStale(view({ status: "queued" }), CURRENT, false)).toBe(
|
|
99
|
+
true,
|
|
100
|
+
);
|
|
75
101
|
});
|
|
76
102
|
|
|
77
103
|
it("should return true if the cell is running but no output is received", () => {
|
|
78
104
|
const running = view({ status: "running", startedAt: NOW });
|
|
79
|
-
expect(outputIsStale(running,
|
|
105
|
+
expect(outputIsStale(running, CURRENT, false)).toBe(true);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("should return true if the cell is interrupted and edited since", () => {
|
|
109
|
+
expect(outputIsStale(view({ outcome: "interrupted" }), EDITED, true)).toBe(
|
|
110
|
+
true,
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("should not dim output the rerun of edited code has already shown", () => {
|
|
115
|
+
const running = view({ status: "running", rendered: true });
|
|
116
|
+
expect(outputIsStale(running, EDITED, true)).toBe(false);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("should dim while the rerun of edited code has shown nothing", () => {
|
|
120
|
+
expect(outputIsStale(view({ status: "running" }), EDITED, true)).toBe(true);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("should still dim for changed inputs in a read view when the source also changed", () => {
|
|
124
|
+
expect(outputIsStale(view({}), BOTH, false)).toBe(true);
|
|
80
125
|
});
|
|
126
|
+
});
|
|
81
127
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
expect(
|
|
128
|
+
describe("consoleOutputIsStale", () => {
|
|
129
|
+
it("is stale while queued, since the run clears the console", () => {
|
|
130
|
+
expect(consoleOutputIsStale(view({ status: "queued" }), CURRENT)).toBe(
|
|
131
|
+
true,
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("is not stale while the rerun of edited code is producing it", () => {
|
|
136
|
+
expect(consoleOutputIsStale(view({ status: "running" }), EDITED)).toBe(
|
|
85
137
|
false,
|
|
86
138
|
);
|
|
87
139
|
});
|
|
88
140
|
|
|
89
|
-
it("
|
|
90
|
-
expect(
|
|
141
|
+
it("is stale once the settled result is outdated", () => {
|
|
142
|
+
expect(consoleOutputIsStale(view({}), EDITED)).toBe(true);
|
|
143
|
+
expect(consoleOutputIsStale(view({}), REPLACED)).toBe(true);
|
|
144
|
+
expect(consoleOutputIsStale(view({}), CURRENT)).toBe(false);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it("is not stale after an interruption", () => {
|
|
148
|
+
expect(consoleOutputIsStale(view({ outcome: "interrupted" }), EDITED)).toBe(
|
|
91
149
|
false,
|
|
92
150
|
);
|
|
93
151
|
});
|
|
152
|
+
|
|
153
|
+
it("should return false if the cell is interrupted but has stale inputs", () => {
|
|
154
|
+
expect(
|
|
155
|
+
outputIsStale(view({ outcome: "interrupted" }), REPLACED, false),
|
|
156
|
+
).toBe(false);
|
|
157
|
+
});
|
|
94
158
|
});
|
|
95
159
|
|
|
96
160
|
describe("transitionCell serialization", () => {
|