@marimo-team/frontend 0.23.6-dev1 → 0.23.6-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.
Files changed (72) hide show
  1. package/dist/assets/{CellStatus-DKMrz26-.js → CellStatus-BasmzQBh.js} +1 -1
  2. package/dist/assets/{JsonOutput-02ehjjSC.js → JsonOutput-BQaSLDBi.js} +1 -1
  3. package/dist/assets/{MarimoErrorOutput-Dbk0HqOA.js → MarimoErrorOutput-Dm4hVwDq.js} +1 -1
  4. package/dist/assets/{RenderHTML-8cI8zL5y.js → RenderHTML-CA4tujDX.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-DfniMbLM.js → add-cell-with-ai-5QPp1nPl.js} +1 -1
  6. package/dist/assets/{add-connection-dialog-8ChtH4mo.js → add-connection-dialog-C3IbqmBw.js} +1 -1
  7. package/dist/assets/{agent-panel-jsnbrvBR.js → agent-panel-Dbk-1jxq.js} +1 -1
  8. package/dist/assets/{ai-model-dropdown-BFTnsrTP.js → ai-model-dropdown-DRqlfqFb.js} +1 -1
  9. package/dist/assets/{app-config-button-c_2rVezv.js → app-config-button-DyNQc93A.js} +1 -1
  10. package/dist/assets/{cell-editor-WSoKgacR.js → cell-editor-V8ybPnUa.js} +1 -1
  11. package/dist/assets/{cell-link-BRdZl0OJ.js → cell-link-8o8mCUzE.js} +1 -1
  12. package/dist/assets/{cells-CcBfzJ1Z.js → cells-Jdt48eTG.js} +47 -47
  13. package/dist/assets/{chat-display-NiFkPnNN.js → chat-display-D4A5J3ON.js} +1 -1
  14. package/dist/assets/{chat-panel-C6V6gxrr.js → chat-panel--TAJZjAo.js} +1 -1
  15. package/dist/assets/{chat-ui-BLiRBYhk.js → chat-ui-Dlmd_U56.js} +1 -1
  16. package/dist/assets/{column-preview-rDM8Q-wn.js → column-preview-B1oiFlur.js} +1 -1
  17. package/dist/assets/{command-palette-CUYBVGPU.js → command-palette-DcTyjGF4.js} +1 -1
  18. package/dist/assets/{common-CHmdPmWi.js → common-C6ZHulDM.js} +1 -1
  19. package/dist/assets/{components-HCInimq-.js → components-BiZUhizd.js} +1 -1
  20. package/dist/assets/{components-DVKf_7RU.js → components-Du9BBcZY.js} +1 -1
  21. package/dist/assets/{datasource-Czm_KBfK.js → datasource-BGCJgHn8.js} +1 -1
  22. package/dist/assets/{dependency-graph-panel-DPKylrlr.js → dependency-graph-panel-BFoJRcHv.js} +1 -1
  23. package/dist/assets/{documentation-panel-DZkIKuPv.js → documentation-panel-Bi7B6BDD.js} +1 -1
  24. package/dist/assets/{download-YUQiaxS9.js → download-q17GDjRk.js} +1 -1
  25. package/dist/assets/{edit-page-BiwFohnL.js → edit-page-CKzJ_Zmc.js} +3 -3
  26. package/dist/assets/{error-panel-C4UQHEjp.js → error-panel-Elx5tZAZ.js} +1 -1
  27. package/dist/assets/{file-explorer-panel-DEJtGGUp.js → file-explorer-panel-omTFPhXg.js} +1 -1
  28. package/dist/assets/{file-icons-CMxkj_kV.js → file-icons-D1lzcliR.js} +1 -1
  29. package/dist/assets/{floating-outline-BtNnv2IX.js → floating-outline-DVqXePmL.js} +1 -1
  30. package/dist/assets/{focus-CXQpR65O.js → focus-Bz1PGBQ2.js} +1 -1
  31. package/dist/assets/{form-EgPmt17c.js → form-CpNkZ10P.js} +1 -1
  32. package/dist/assets/{home-page-CaIONOO0.js → home-page-B6hZQb34.js} +1 -1
  33. package/dist/assets/{hooks-CZcajTLZ.js → hooks-lEn1DZw2.js} +1 -1
  34. package/dist/assets/{html-to-image-BHdf1t5J.js → html-to-image-BJDxFKbb.js} +1 -1
  35. package/dist/assets/{index-CL4WR8q8.js → index-Dyru2McE.js} +4 -4
  36. package/dist/assets/{kiosk-mode-vHMq9vr1.js → kiosk-mode-DlJLa7MP.js} +1 -1
  37. package/dist/assets/layout-DBhZTvp5.js +9 -0
  38. package/dist/assets/{logs-panel-DL9WeQsv.js → logs-panel--5x174b0.js} +1 -1
  39. package/dist/assets/{markdown-renderer-DmnGXdCp.js → markdown-renderer-9gIJjISB.js} +1 -1
  40. package/dist/assets/{name-cell-input-CHuLB3H7.js → name-cell-input-DUUJ7fdG.js} +1 -1
  41. package/dist/assets/{outline-panel-JaSUHnmD.js → outline-panel-B6y7CdzK.js} +1 -1
  42. package/dist/assets/{packages-panel-BB5_Iu2c.js → packages-panel-bTONt5Lb.js} +1 -1
  43. package/dist/assets/{panels-D4g3bUpO.js → panels-DLL43K0s.js} +1 -1
  44. package/dist/assets/{process-output-hJso9ugZ.js → process-output-TR8koJYc.js} +1 -1
  45. package/dist/assets/{radio-group-6t7ozlnG.js → radio-group-B0jYgGRE.js} +1 -1
  46. package/dist/assets/{readonly-python-code-JBCsN3-9.js → readonly-python-code-BNCBnJYH.js} +1 -1
  47. package/dist/assets/{reveal-component-BKMB17JT.js → reveal-component-Cfvv_aP0.js} +1 -1
  48. package/dist/assets/{run-page-BPM6GfJo.js → run-page-CPxLAWm8.js} +1 -1
  49. package/dist/assets/{scratchpad-panel-Cabu2odx.js → scratchpad-panel-DUSXJer8.js} +1 -1
  50. package/dist/assets/{session-panel-BAiIHm0d.js → session-panel-BAAW6R7U.js} +1 -1
  51. package/dist/assets/{snippets-panel-CQKr-OMs.js → snippets-panel-roW3_D4d.js} +1 -1
  52. package/dist/assets/{state-DCT6JLba.js → state-Bhut5iLD.js} +1 -1
  53. package/dist/assets/{state-DGoUR-mM.js → state-D5aL5woK.js} +1 -1
  54. package/dist/assets/{textarea-BI_mXP9w.js → textarea-DapfQSws.js} +1 -1
  55. package/dist/assets/{tracing-BF-ca60a.js → tracing-D3nIh6vh.js} +1 -1
  56. package/dist/assets/{tracing-panel-D1j7Fbvr.js → tracing-panel-B23uvwYc.js} +2 -2
  57. package/dist/assets/{useCellActionButton-CcXV09GQ.js → useCellActionButton-DrzG-_Bd.js} +1 -1
  58. package/dist/assets/{useDeleteCell-BVX9aH-t.js → useDeleteCell-CcnkgOq-.js} +1 -1
  59. package/dist/assets/{useDependencyPanelTab-CewdyAAy.js → useDependencyPanelTab-Dv04JzMr.js} +1 -1
  60. package/dist/assets/useNotebookActions-D6c9Rjb9.js +1 -0
  61. package/dist/assets/{useRunCells-CgXnbA14.js → useRunCells-BeRcytF8.js} +1 -1
  62. package/dist/assets/{useSplitCell-_Q2wQXsQ.js → useSplitCell-DSLPh_8D.js} +1 -1
  63. package/dist/index.html +22 -22
  64. package/package.json +1 -1
  65. package/src/components/slides/slide-form.tsx +43 -0
  66. package/src/core/cells/__tests__/apply-transaction.test.ts +193 -27
  67. package/src/core/cells/__tests__/cells.test.ts +99 -0
  68. package/src/core/cells/__tests__/document-changes.test.ts +14 -0
  69. package/src/core/cells/cells.ts +14 -1
  70. package/src/core/cells/document-changes.ts +17 -14
  71. package/dist/assets/layout-DNOqvNbP.js +0 -9
  72. package/dist/assets/useNotebookActions-CWpi-dx_.js +0 -1
package/dist/index.html CHANGED
@@ -66,7 +66,7 @@
66
66
  <marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
67
67
  <!-- /TODO -->
68
68
  <title>{{ title }}</title>
69
- <script type="module" crossorigin src="./assets/index-CL4WR8q8.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-Dyru2McE.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-DItdS47A.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
@@ -133,7 +133,7 @@
133
133
  <link rel="modulepreload" crossorigin href="./assets/debounce-DhnxH9Rh.js">
134
134
  <link rel="modulepreload" crossorigin href="./assets/database-zap-kIkTfzTX.js">
135
135
  <link rel="modulepreload" crossorigin href="./assets/main-B0OX4z33.js">
136
- <link rel="modulepreload" crossorigin href="./assets/cells-CcBfzJ1Z.js">
136
+ <link rel="modulepreload" crossorigin href="./assets/cells-Jdt48eTG.js">
137
137
  <link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-DzYV_VeY.js">
138
138
  <link rel="modulepreload" crossorigin href="./assets/kbd-B3Breaz2.js">
139
139
  <link rel="modulepreload" crossorigin href="./assets/useInstallPackage-D0NLybAx.js">
@@ -147,33 +147,33 @@
147
147
  <link rel="modulepreload" crossorigin href="./assets/usePress-CfcdTqJM.js">
148
148
  <link rel="modulepreload" crossorigin href="./assets/input-BX98vgAu.js">
149
149
  <link rel="modulepreload" crossorigin href="./assets/ImperativeModal-D7lQ0Q7_.js">
150
- <link rel="modulepreload" crossorigin href="./assets/cell-link-BRdZl0OJ.js">
150
+ <link rel="modulepreload" crossorigin href="./assets/cell-link-8o8mCUzE.js">
151
151
  <link rel="modulepreload" crossorigin href="./assets/multi-map-rafH3cg3.js">
152
152
  <link rel="modulepreload" crossorigin href="./assets/alert-DvqcBMUv.js">
153
153
  <link rel="modulepreload" crossorigin href="./assets/chevron-right-CG5QYXYk.js">
154
154
  <link rel="modulepreload" crossorigin href="./assets/dropdown-menu-D1A3cFC8.js">
155
155
  <link rel="modulepreload" crossorigin href="./assets/links-Dpap8NI2.js">
156
- <link rel="modulepreload" crossorigin href="./assets/useRunCells-CgXnbA14.js">
156
+ <link rel="modulepreload" crossorigin href="./assets/useRunCells-BeRcytF8.js">
157
157
  <link rel="modulepreload" crossorigin href="./assets/copy-BCF-tANo.js">
158
158
  <link rel="modulepreload" crossorigin href="./assets/copy-BwrPA9zQ.js">
159
159
  <link rel="modulepreload" crossorigin href="./assets/copy-icon-BYNydU7b.js">
160
- <link rel="modulepreload" crossorigin href="./assets/RenderHTML-8cI8zL5y.js">
161
- <link rel="modulepreload" crossorigin href="./assets/datasource-Czm_KBfK.js">
162
- <link rel="modulepreload" crossorigin href="./assets/state-DCT6JLba.js">
160
+ <link rel="modulepreload" crossorigin href="./assets/RenderHTML-CA4tujDX.js">
161
+ <link rel="modulepreload" crossorigin href="./assets/datasource-BGCJgHn8.js">
162
+ <link rel="modulepreload" crossorigin href="./assets/state-Bhut5iLD.js">
163
163
  <link rel="modulepreload" crossorigin href="./assets/sparkles-CZ5WmLPA.js">
164
- <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-Dbk0HqOA.js">
164
+ <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-Dm4hVwDq.js">
165
165
  <link rel="modulepreload" crossorigin href="./assets/spinner-Bhir8k53.js">
166
- <link rel="modulepreload" crossorigin href="./assets/html-to-image-BHdf1t5J.js">
167
- <link rel="modulepreload" crossorigin href="./assets/focus-CXQpR65O.js">
166
+ <link rel="modulepreload" crossorigin href="./assets/html-to-image-BJDxFKbb.js">
167
+ <link rel="modulepreload" crossorigin href="./assets/focus-Bz1PGBQ2.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/useAsyncData-BFC6lWG9.js">
169
169
  <link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-BF3xpDgO.js">
170
170
  <link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-DzSMahmM.js">
171
171
  <link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-e_arGD4o.js">
172
- <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-DmnGXdCp.js">
172
+ <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-9gIJjISB.js">
173
173
  <link rel="modulepreload" crossorigin href="./assets/command-CBCkexpx.js">
174
174
  <link rel="modulepreload" crossorigin href="./assets/popover-UExmgBsf.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/errors-TZBmrJmc.js">
176
- <link rel="modulepreload" crossorigin href="./assets/download-YUQiaxS9.js">
176
+ <link rel="modulepreload" crossorigin href="./assets/download-q17GDjRk.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/table-DPyRV1LT.js">
178
178
  <link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-BvE4n6hj.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/error-banner-C6aBa98y.js">
@@ -191,27 +191,27 @@
191
191
  <link rel="modulepreload" crossorigin href="./assets/message-circle-CWm2KnSx.js">
192
192
  <link rel="modulepreload" crossorigin href="./assets/trash-2-CKlZA04n.js">
193
193
  <link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-BUNcfKXO.js">
194
- <link rel="modulepreload" crossorigin href="./assets/JsonOutput-02ehjjSC.js">
194
+ <link rel="modulepreload" crossorigin href="./assets/JsonOutput-BQaSLDBi.js">
195
195
  <link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-nqk474t8.js">
196
196
  <link rel="modulepreload" crossorigin href="./assets/square-function-D1dlJvD8.js">
197
197
  <link rel="modulepreload" crossorigin href="./assets/spec-Cq8FVoTf.js">
198
198
  <link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-CkwWkOQL.js">
199
199
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-DHwG4Mac.js">
200
200
  <link rel="modulepreload" crossorigin href="./assets/tree-actions-Ci3CV3hN.js">
201
- <link rel="modulepreload" crossorigin href="./assets/components-DVKf_7RU.js">
202
- <link rel="modulepreload" crossorigin href="./assets/column-preview-rDM8Q-wn.js">
201
+ <link rel="modulepreload" crossorigin href="./assets/components-Du9BBcZY.js">
202
+ <link rel="modulepreload" crossorigin href="./assets/column-preview-B1oiFlur.js">
203
203
  <link rel="modulepreload" crossorigin href="./assets/icons-D9TuFTJG.js">
204
- <link rel="modulepreload" crossorigin href="./assets/radio-group-6t7ozlnG.js">
205
- <link rel="modulepreload" crossorigin href="./assets/floating-outline-BtNnv2IX.js">
204
+ <link rel="modulepreload" crossorigin href="./assets/radio-group-B0jYgGRE.js">
205
+ <link rel="modulepreload" crossorigin href="./assets/floating-outline-DVqXePmL.js">
206
206
  <link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-DaPAPabU.js">
207
207
  <link rel="modulepreload" crossorigin href="./assets/esm-BmrwxxCo.js">
208
208
  <link rel="modulepreload" crossorigin href="./assets/eye-off-n1Li95bE.js">
209
209
  <link rel="modulepreload" crossorigin href="./assets/plus-BgB18UzY.js">
210
- <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-JBCsN3-9.js">
210
+ <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-BNCBnJYH.js">
211
211
  <link rel="modulepreload" crossorigin href="./assets/file-headphone-BrQspHac.js">
212
212
  <link rel="modulepreload" crossorigin href="./assets/file-BrdxGLRX.js">
213
213
  <link rel="modulepreload" crossorigin href="./assets/image-DQHXdEQn.js">
214
- <link rel="modulepreload" crossorigin href="./assets/file-icons-CMxkj_kV.js">
214
+ <link rel="modulepreload" crossorigin href="./assets/file-icons-D1lzcliR.js">
215
215
  <link rel="modulepreload" crossorigin href="./assets/switch-ecwOrzz3.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/events-BRAWQiYK.js">
217
217
  <link rel="modulepreload" crossorigin href="./assets/globals-B-ZMi0ZU.js">
@@ -220,11 +220,11 @@
220
220
  <link rel="modulepreload" crossorigin href="./assets/memoize-Tp7rARFe.js">
221
221
  <link rel="modulepreload" crossorigin href="./assets/get-C-qh_et5.js">
222
222
  <link rel="modulepreload" crossorigin href="./assets/_baseSet-CxV9N1bc.js">
223
- <link rel="modulepreload" crossorigin href="./assets/state-DGoUR-mM.js">
223
+ <link rel="modulepreload" crossorigin href="./assets/state-D5aL5woK.js">
224
224
  <link rel="modulepreload" crossorigin href="./assets/label-DTR8T0AE.js">
225
- <link rel="modulepreload" crossorigin href="./assets/textarea-BI_mXP9w.js">
225
+ <link rel="modulepreload" crossorigin href="./assets/textarea-DapfQSws.js">
226
226
  <link rel="modulepreload" crossorigin href="./assets/refresh-ccw-C-n2VFP5.js">
227
- <link rel="modulepreload" crossorigin href="./assets/form-EgPmt17c.js">
227
+ <link rel="modulepreload" crossorigin href="./assets/form-CpNkZ10P.js">
228
228
  <link rel="modulepreload" crossorigin href="./assets/renderShortcut-DZpkrZaP.js">
229
229
  <link rel="modulepreload" crossorigin href="./assets/field-BrLPDxsA.js">
230
230
  <link rel="modulepreload" crossorigin href="./assets/RSPContexts-CINae4Gg.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.23.6-dev1",
3
+ "version": "0.23.6-dev11",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -8,6 +8,7 @@ import {
8
8
  CookieIcon,
9
9
  PanelRightCloseIcon,
10
10
  PanelRightOpenIcon,
11
+ KeyboardIcon,
11
12
  } from "lucide-react";
12
13
  import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
13
14
  import {
@@ -28,6 +29,7 @@ import type {
28
29
  import { useState } from "react";
29
30
  import { Tooltip } from "../ui/tooltip";
30
31
  import { Button } from "../ui/button";
32
+ import { Kbd } from "../ui/kbd";
31
33
  import type { RuntimeCell } from "@/core/cells/types";
32
34
 
33
35
  export const DEFAULT_SLIDE_TYPE: SlideType = "slide";
@@ -132,10 +134,51 @@ const SlidesForm = ({
132
134
  <TabsContent value="deck" className="mt-0 flex-1">
133
135
  <DeckConfigForm layout={layout} setLayout={setLayout} />
134
136
  </TabsContent>
137
+ <hr />
138
+ <KeyboardTips />
135
139
  </Tabs>
136
140
  );
137
141
  };
138
142
 
143
+ const KEYBOARD_TIPS: { keys: string[]; description: string }[] = [
144
+ { keys: ["F"], description: "Enter fullscreen" },
145
+ { keys: ["C"], description: "Toggle code editor" },
146
+ ];
147
+
148
+ const KEYBOARD_SHORTCUTS_URL =
149
+ "https://vlaaad.github.io/reveal/keyboard-shortcuts";
150
+
151
+ const KeyboardTips = () => {
152
+ return (
153
+ <div className="flex flex-col gap-2 text-xs text-muted-foreground">
154
+ <div className="flex items-center gap-1.5 font-medium text-foreground/80">
155
+ <KeyboardIcon className="h-3.5 w-3.5" />
156
+ <span>Shortcuts</span>
157
+ </div>
158
+ <ul className="flex flex-col gap-1.5">
159
+ {KEYBOARD_TIPS.map(({ keys, description }) => (
160
+ <li key={description} className="flex items-center justify-between">
161
+ <span>{description}</span>
162
+ <span className="flex gap-1">
163
+ {keys.map((key) => (
164
+ <Kbd key={key}>{key}</Kbd>
165
+ ))}
166
+ </span>
167
+ </li>
168
+ ))}
169
+ </ul>
170
+ <a
171
+ href={KEYBOARD_SHORTCUTS_URL}
172
+ target="_blank"
173
+ rel="noopener noreferrer"
174
+ className="text-link hover:underline"
175
+ >
176
+ See all shortcuts
177
+ </a>
178
+ </div>
179
+ );
180
+ };
181
+
139
182
  const SlideConfigForm = ({
140
183
  layout,
141
184
  setLayout,
@@ -469,10 +469,34 @@ describe("applyTransactionChanges column rebuild", () => {
469
469
  const [a, b, c, d] = state.cellIds.inOrderIds;
470
470
  apply([
471
471
  { type: "reorder-cells", cellIds: [a, b, c, d] },
472
- { type: "set-config", cellId: a, column: 0 },
473
- { type: "set-config", cellId: b, column: 1 },
474
- { type: "set-config", cellId: c, column: 0 },
475
- { type: "set-config", cellId: d, column: 1 },
472
+ {
473
+ type: "set-config",
474
+ cellId: a,
475
+ column: 0,
476
+ disabled: false,
477
+ hideCode: false,
478
+ },
479
+ {
480
+ type: "set-config",
481
+ cellId: b,
482
+ column: 1,
483
+ disabled: false,
484
+ hideCode: false,
485
+ },
486
+ {
487
+ type: "set-config",
488
+ cellId: c,
489
+ column: 0,
490
+ disabled: false,
491
+ hideCode: false,
492
+ },
493
+ {
494
+ type: "set-config",
495
+ cellId: d,
496
+ column: 1,
497
+ disabled: false,
498
+ hideCode: false,
499
+ },
476
500
  ]);
477
501
  // a and c in col0; b and d in col1. Order within each column follows
478
502
  // the reorder-cells order.
@@ -487,7 +511,15 @@ describe("applyTransactionChanges column rebuild", () => {
487
511
  it("set-config without reorder-cells moves the cell to the new column", () => {
488
512
  setup("a", "b", "c");
489
513
  const [, b] = state.cellIds.inOrderIds;
490
- apply([{ type: "set-config", cellId: b, column: 1 }]);
514
+ apply([
515
+ {
516
+ type: "set-config",
517
+ cellId: b,
518
+ column: 1,
519
+ disabled: false,
520
+ hideCode: false,
521
+ },
522
+ ]);
491
523
  // Without reorder-cells, the flat order comes from the current tree.
492
524
  // b gets explicit col=1; a and c stay with default null → follow the
493
525
  // previous cell's column (a → col0 because prev=0; c → col1 because
@@ -503,7 +535,15 @@ describe("applyTransactionChanges column rebuild", () => {
503
535
  it("no column change: set-config only touching other fields does not repartition", () => {
504
536
  setup("a", "b", "c");
505
537
  const [, b] = state.cellIds.inOrderIds;
506
- apply([{ type: "set-config", cellId: b, hideCode: true }]);
538
+ apply([
539
+ {
540
+ type: "set-config",
541
+ cellId: b,
542
+ column: null,
543
+ disabled: false,
544
+ hideCode: true,
545
+ },
546
+ ]);
507
547
  // All three cells remain in a single column. No rebuild triggered.
508
548
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
509
549
  "
@@ -525,8 +565,20 @@ describe("applyTransactionChanges column rebuild", () => {
525
565
  const [a, b] = state.cellIds.inOrderIds;
526
566
  apply([
527
567
  { type: "reorder-cells", cellIds: [a, b] },
528
- { type: "set-config", cellId: a, column: 0 },
529
- { type: "set-config", cellId: b, column: 1 },
568
+ {
569
+ type: "set-config",
570
+ cellId: a,
571
+ column: 0,
572
+ disabled: false,
573
+ hideCode: false,
574
+ },
575
+ {
576
+ type: "set-config",
577
+ cellId: b,
578
+ column: 1,
579
+ disabled: false,
580
+ hideCode: false,
581
+ },
530
582
  ]);
531
583
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
532
584
  "
@@ -550,8 +602,20 @@ describe("applyTransactionChanges column rebuild", () => {
550
602
  const [a, b, c, d] = state.cellIds.inOrderIds;
551
603
  apply([
552
604
  { type: "reorder-cells", cellIds: [a, b, c, d] },
553
- { type: "set-config", cellId: a, column: 0 },
554
- { type: "set-config", cellId: c, column: 1 },
605
+ {
606
+ type: "set-config",
607
+ cellId: a,
608
+ column: 0,
609
+ disabled: false,
610
+ hideCode: false,
611
+ },
612
+ {
613
+ type: "set-config",
614
+ cellId: c,
615
+ column: 1,
616
+ disabled: false,
617
+ hideCode: false,
618
+ },
555
619
  ]);
556
620
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
557
621
  "
@@ -562,8 +626,20 @@ describe("applyTransactionChanges column rebuild", () => {
562
626
  // Now merge everything back to col 0.
563
627
  apply([
564
628
  { type: "reorder-cells", cellIds: [a, b, c, d] },
565
- { type: "set-config", cellId: c, column: 0 },
566
- { type: "set-config", cellId: d, column: 0 },
629
+ {
630
+ type: "set-config",
631
+ cellId: c,
632
+ column: 0,
633
+ disabled: false,
634
+ hideCode: false,
635
+ },
636
+ {
637
+ type: "set-config",
638
+ cellId: d,
639
+ column: 0,
640
+ disabled: false,
641
+ hideCode: false,
642
+ },
567
643
  ]);
568
644
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
569
645
  "
@@ -609,8 +685,20 @@ describe("applyTransactionChanges column rebuild", () => {
609
685
  { type: "reorder-cells", cellIds: [a, b, c] },
610
686
  { type: "set-code", cellId: a, code: "x = 1" },
611
687
  { type: "set-name", cellId: b, name: "middle" },
612
- { type: "set-config", cellId: a, column: 0 },
613
- { type: "set-config", cellId: b, column: 1 },
688
+ {
689
+ type: "set-config",
690
+ cellId: a,
691
+ column: 0,
692
+ disabled: false,
693
+ hideCode: false,
694
+ },
695
+ {
696
+ type: "set-config",
697
+ cellId: b,
698
+ column: 1,
699
+ disabled: false,
700
+ hideCode: false,
701
+ },
614
702
  ]);
615
703
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
616
704
  "
@@ -658,8 +746,20 @@ describe("applyTransactionChanges column rebuild", () => {
658
746
  // Split into two columns. Only a and c are anchors.
659
747
  apply([
660
748
  { type: "reorder-cells", cellIds: [a, b, c, d] },
661
- { type: "set-config", cellId: a, column: 0 },
662
- { type: "set-config", cellId: c, column: 1 },
749
+ {
750
+ type: "set-config",
751
+ cellId: a,
752
+ column: 0,
753
+ disabled: false,
754
+ hideCode: false,
755
+ },
756
+ {
757
+ type: "set-config",
758
+ cellId: c,
759
+ column: 1,
760
+ disabled: false,
761
+ hideCode: false,
762
+ },
663
763
  ]);
664
764
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
665
765
  "
@@ -670,7 +770,13 @@ describe("applyTransactionChanges column rebuild", () => {
670
770
  // Move the c anchor to col 0. d has no explicit column so it follows c.
671
771
  apply([
672
772
  { type: "reorder-cells", cellIds: [a, b, c, d] },
673
- { type: "set-config", cellId: c, column: 0 },
773
+ {
774
+ type: "set-config",
775
+ cellId: c,
776
+ column: 0,
777
+ disabled: false,
778
+ hideCode: false,
779
+ },
674
780
  ]);
675
781
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
676
782
  "
@@ -686,9 +792,27 @@ describe("applyTransactionChanges column rebuild", () => {
686
792
  const [a, b, c, d] = state.cellIds.inOrderIds;
687
793
  apply([
688
794
  { type: "reorder-cells", cellIds: [a, b, c, d] },
689
- { type: "set-config", cellId: a, column: 0 },
690
- { type: "set-config", cellId: c, column: 1 },
691
- { type: "set-config", cellId: d, column: 1 },
795
+ {
796
+ type: "set-config",
797
+ cellId: a,
798
+ column: 0,
799
+ disabled: false,
800
+ hideCode: false,
801
+ },
802
+ {
803
+ type: "set-config",
804
+ cellId: c,
805
+ column: 1,
806
+ disabled: false,
807
+ hideCode: false,
808
+ },
809
+ {
810
+ type: "set-config",
811
+ cellId: d,
812
+ column: 1,
813
+ disabled: false,
814
+ hideCode: false,
815
+ },
692
816
  ]);
693
817
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
694
818
  "
@@ -700,7 +824,13 @@ describe("applyTransactionChanges column rebuild", () => {
700
824
  // does NOT follow c.
701
825
  apply([
702
826
  { type: "reorder-cells", cellIds: [a, b, c, d] },
703
- { type: "set-config", cellId: c, column: 0 },
827
+ {
828
+ type: "set-config",
829
+ cellId: c,
830
+ column: 0,
831
+ disabled: false,
832
+ hideCode: false,
833
+ },
704
834
  ]);
705
835
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
706
836
  "
@@ -719,8 +849,20 @@ describe("applyTransactionChanges column rebuild", () => {
719
849
  const [a, b, c, d] = state.cellIds.inOrderIds;
720
850
  apply([
721
851
  // set-config appears FIRST in the transaction.
722
- { type: "set-config", cellId: a, column: 0 },
723
- { type: "set-config", cellId: c, column: 1 },
852
+ {
853
+ type: "set-config",
854
+ cellId: a,
855
+ column: 0,
856
+ disabled: false,
857
+ hideCode: false,
858
+ },
859
+ {
860
+ type: "set-config",
861
+ cellId: c,
862
+ column: 1,
863
+ disabled: false,
864
+ hideCode: false,
865
+ },
724
866
  // reorder-cells comes afterwards.
725
867
  { type: "reorder-cells", cellIds: [a, b, c, d] },
726
868
  ]);
@@ -741,9 +883,21 @@ describe("applyTransactionChanges column rebuild", () => {
741
883
  setup("a", "b", "c", "d");
742
884
  const [a, b, c, d] = state.cellIds.inOrderIds;
743
885
  apply([
744
- { type: "set-config", cellId: a, column: 0 },
886
+ {
887
+ type: "set-config",
888
+ cellId: a,
889
+ column: 0,
890
+ disabled: false,
891
+ hideCode: false,
892
+ },
745
893
  { type: "set-code", cellId: a, code: "x = 1" },
746
- { type: "set-config", cellId: c, column: 1 },
894
+ {
895
+ type: "set-config",
896
+ cellId: c,
897
+ column: 1,
898
+ disabled: false,
899
+ hideCode: false,
900
+ },
747
901
  { type: "reorder-cells", cellIds: [a, b, c, d] },
748
902
  { type: "set-name", cellId: d, name: "last" },
749
903
  ]);
@@ -769,8 +923,20 @@ describe("applyTransactionChanges column rebuild", () => {
769
923
  const [a, b, c, d] = state.cellIds.inOrderIds;
770
924
  apply([
771
925
  { type: "reorder-cells", cellIds: [a, b, c, d] },
772
- { type: "set-config", cellId: a, column: 0 },
773
- { type: "set-config", cellId: c, column: 1 },
926
+ {
927
+ type: "set-config",
928
+ cellId: a,
929
+ column: 0,
930
+ disabled: false,
931
+ hideCode: false,
932
+ },
933
+ {
934
+ type: "set-config",
935
+ cellId: c,
936
+ column: 1,
937
+ disabled: false,
938
+ hideCode: false,
939
+ },
774
940
  ]);
775
941
  expect(prettyColumns(state)).toMatchInlineSnapshot(`
776
942
  "
@@ -46,6 +46,9 @@ vi.mock("@/core/codemirror/editing/commands", () => ({
46
46
  foldAllBulk: vi.fn(),
47
47
  unfoldAllBulk: vi.fn(),
48
48
  }));
49
+ vi.mock("@/core/wasm/utils", () => ({
50
+ isWasm: vi.fn(() => false),
51
+ }));
49
52
  vi.mock("../scrollCellIntoView", async (importOriginal) => {
50
53
  const actual = await importOriginal();
51
54
  return {
@@ -3428,3 +3431,99 @@ describe("createTracebackInfoAtom", () => {
3428
3431
  expect(traceback).toBeUndefined();
3429
3432
  });
3430
3433
  });
3434
+
3435
+ describe("setCells snapshot preservation", () => {
3436
+ const CELL_A = cellId("A");
3437
+ const CELL_B = cellId("B");
3438
+ const newCells: CellData[] = [
3439
+ {
3440
+ id: CELL_A,
3441
+ name: "a",
3442
+ code: "1",
3443
+ edited: false,
3444
+ lastCodeRun: null,
3445
+ lastExecutionTime: null,
3446
+ config: { hide_code: false, disabled: false, column: null },
3447
+ serializedEditorState: null,
3448
+ },
3449
+ {
3450
+ id: CELL_B,
3451
+ name: "b",
3452
+ code: "2",
3453
+ edited: false,
3454
+ lastCodeRun: null,
3455
+ lastExecutionTime: null,
3456
+ config: { hide_code: false, disabled: false, column: null },
3457
+ serializedEditorState: null,
3458
+ },
3459
+ ];
3460
+
3461
+ const hydratedState = () =>
3462
+ MockNotebook.notebookState({
3463
+ cellData: {
3464
+ [CELL_A]: { id: CELL_A, code: "1" },
3465
+ [CELL_B]: { id: CELL_B, code: "2" },
3466
+ },
3467
+ cellRuntime: {
3468
+ [CELL_A]: {
3469
+ output: {
3470
+ channel: "output",
3471
+ mimetype: "text/plain",
3472
+ data: "hydrated-A",
3473
+ timestamp: 0,
3474
+ },
3475
+ },
3476
+ [CELL_B]: {
3477
+ consoleOutputs: [
3478
+ {
3479
+ channel: "stdout",
3480
+ mimetype: "text/plain",
3481
+ data: "hydrated-B-stdout",
3482
+ timestamp: 0,
3483
+ },
3484
+ ],
3485
+ },
3486
+ },
3487
+ });
3488
+
3489
+ beforeEach(async () => {
3490
+ const { isWasm } = await import("@/core/wasm/utils");
3491
+ vi.mocked(isWasm).mockReturnValue(true);
3492
+ });
3493
+
3494
+ it("preserves hydrated output in WASM", () => {
3495
+ const next = exportedForTesting.reducer(hydratedState(), {
3496
+ type: "setCells",
3497
+ payload: newCells,
3498
+ });
3499
+
3500
+ expect(next.cellRuntime[CELL_A].output).toMatchObject({
3501
+ data: "hydrated-A",
3502
+ });
3503
+ });
3504
+
3505
+ it("preserves console-only hydration in WASM", () => {
3506
+ const next = exportedForTesting.reducer(hydratedState(), {
3507
+ type: "setCells",
3508
+ payload: newCells,
3509
+ });
3510
+
3511
+ expect(next.cellRuntime[CELL_B].consoleOutputs).toHaveLength(1);
3512
+ expect(next.cellRuntime[CELL_B].consoleOutputs[0]).toMatchObject({
3513
+ data: "hydrated-B-stdout",
3514
+ });
3515
+ });
3516
+
3517
+ it("resets cells with no prior runtime even in WASM", () => {
3518
+ const empty = MockNotebook.notebookState({ cellData: {} });
3519
+ const next = exportedForTesting.reducer(empty, {
3520
+ type: "setCells",
3521
+ payload: newCells,
3522
+ });
3523
+
3524
+ expect(next.cellRuntime[CELL_A].output).toBeNull();
3525
+ expect(next.cellRuntime[CELL_A].consoleOutputs).toEqual([]);
3526
+ expect(next.cellRuntime[CELL_B].output).toBeNull();
3527
+ expect(next.cellRuntime[CELL_B].consoleOutputs).toEqual([]);
3528
+ });
3529
+ });
@@ -203,6 +203,8 @@ describe("toDocumentChanges", () => {
203
203
  [
204
204
  {
205
205
  "cellId": "0",
206
+ "column": null,
207
+ "disabled": false,
206
208
  "hideCode": true,
207
209
  "type": "set-config",
208
210
  },
@@ -246,6 +248,8 @@ describe("toDocumentChanges", () => {
246
248
  {
247
249
  "cellId": "1",
248
250
  "column": 1,
251
+ "disabled": false,
252
+ "hideCode": false,
249
253
  "type": "set-config",
250
254
  },
251
255
  {
@@ -273,11 +277,15 @@ describe("toDocumentChanges", () => {
273
277
  {
274
278
  "cellId": "1",
275
279
  "column": 1,
280
+ "disabled": false,
281
+ "hideCode": false,
276
282
  "type": "set-config",
277
283
  },
278
284
  {
279
285
  "cellId": "2",
280
286
  "column": 1,
287
+ "disabled": false,
288
+ "hideCode": false,
281
289
  "type": "set-config",
282
290
  },
283
291
  {
@@ -310,11 +318,15 @@ describe("toDocumentChanges", () => {
310
318
  {
311
319
  "cellId": "1",
312
320
  "column": 0,
321
+ "disabled": false,
322
+ "hideCode": false,
313
323
  "type": "set-config",
314
324
  },
315
325
  {
316
326
  "cellId": "2",
317
327
  "column": 0,
328
+ "disabled": false,
329
+ "hideCode": false,
318
330
  "type": "set-config",
319
331
  },
320
332
  {
@@ -358,6 +370,8 @@ describe("toDocumentChanges", () => {
358
370
  {
359
371
  "cellId": "1",
360
372
  "column": 1,
373
+ "disabled": false,
374
+ "hideCode": false,
361
375
  "type": "set-config",
362
376
  },
363
377
  {