@marimo-team/islands 0.26.1-dev108 → 0.26.1-dev118

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 (65) hide show
  1. package/dist/{ErrorBoundary-BW4TciqU.js → ErrorBoundary-Gr2Kt5kj.js} +1 -1
  2. package/dist/{chat-ui-Be9X-W22.js → chat-ui-CMKYvKUz.js} +3 -3
  3. package/dist/{code-visibility-BKmktPMd.js → code-visibility-BFFe0rT7.js} +2 -2
  4. package/dist/{common-CSJAjJGa.js → common-7eNIhSN-.js} +4766 -4747
  5. package/dist/{data-grid-overlay-editor-DTibdR4H.js → data-grid-overlay-editor-B37-1-8n.js} +1 -1
  6. package/dist/{error-entries-23Z_1oDM.js → error-entries-B4LgfizR.js} +772 -751
  7. package/dist/{feedback-button-CPu5SV3b.js → feedback-button-CpQcgVuz.js} +3 -3
  8. package/dist/{formats-Y52bg800.js → formats-CeuXJ_1f.js} +32 -25
  9. package/dist/{glide-data-editor-CC9_NDNi.js → glide-data-editor-BxTlDHV5.js} +3 -3
  10. package/dist/{globals-BFlYTNoR.js → globals-ljOLdTJr.js} +1 -1
  11. package/dist/{html-to-image-Cw7o1IbE.js → html-to-image-CIkwg7mv.js} +1 -1
  12. package/dist/main.js +69 -66
  13. package/dist/{number-overlay-editor-qDcRKPE0.js → number-overlay-editor-DGKTstav.js} +1 -1
  14. package/dist/{process-output-DdBM0lmd.js → process-output-PS9YSLNu.js} +2 -2
  15. package/dist/{reveal-component-BE1xhtNc.js → reveal-component-BLJMkx2N.js} +2 -2
  16. package/dist/{useDeepCompareMemoize-Dn-ZJVTd.js → semaphore-8KhQouXt.js} +5 -15
  17. package/dist/style.css +1 -1
  18. package/dist/{vega-component-BIq0qzhQ.js → vega-component-CoJiBCaS.js} +11 -11
  19. package/package.json +1 -1
  20. package/src/__mocks__/executions.ts +1 -1
  21. package/src/__mocks__/intersection-observer.ts +5 -5
  22. package/src/components/editor/Output.tsx +3 -21
  23. package/src/components/editor/__tests__/cell-renders.test.tsx +327 -1
  24. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +27 -0
  25. package/src/components/editor/actions/pair-with-agent-modal.tsx +8 -1
  26. package/src/components/editor/ai/__tests__/completion-utils.test.ts +12 -20
  27. package/src/components/editor/ai/ai-completion-editor.tsx +391 -289
  28. package/src/components/editor/ai/completion-utils.ts +9 -7
  29. package/src/components/editor/cell/CellDeleteShoulder.tsx +82 -0
  30. package/src/components/editor/cell/DeleteButton.tsx +11 -2
  31. package/src/components/editor/cell/__tests__/CellDeleteShoulder.test.tsx +181 -0
  32. package/src/components/editor/cell/code/cell-editor.tsx +15 -25
  33. package/src/components/editor/chrome/panels/__tests__/logs-panel.test.tsx +26 -2
  34. package/src/components/editor/chrome/panels/logs-panel.tsx +27 -11
  35. package/src/components/editor/notebook-cell.tsx +20 -40
  36. package/src/components/editor/output/VegaOutput.tsx +35 -0
  37. package/src/components/find-replace/find-replace.tsx +1 -7
  38. package/src/core/ai/state.ts +6 -0
  39. package/src/core/cells/__tests__/cell-errors.test.tsx +179 -0
  40. package/src/core/cells/__tests__/cells.test.ts +34 -20
  41. package/src/core/cells/cell-log-chunks.ts +31 -0
  42. package/src/core/cells/cells.ts +34 -33
  43. package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +18 -15
  44. package/src/core/codemirror/find-replace/__tests__/search-highlight.test.ts +90 -2
  45. package/src/core/codemirror/find-replace/__tests__/unmounted-cells.test.ts +44 -10
  46. package/src/core/codemirror/find-replace/navigate.ts +4 -1
  47. package/src/core/codemirror/find-replace/search-highlight.ts +54 -58
  48. package/src/core/codemirror/lsp/__tests__/log-messages.test.ts +1 -1
  49. package/src/core/codemirror/lsp/__tests__/transports.test.ts +1 -1
  50. package/src/core/executions/__tests__/atoms.test.ts +0 -2
  51. package/src/core/executions/__tests__/output-lifecycle.test.ts +16 -0
  52. package/src/core/executions/atoms.ts +33 -36
  53. package/src/core/export/__tests__/output-snapshot.test.tsx +240 -0
  54. package/src/core/export/__tests__/output-subscription.test.tsx +79 -0
  55. package/src/core/export/hooks.ts +29 -13
  56. package/src/core/islands/__tests__/bridge.test.ts +2 -5
  57. package/src/core/notebook/replica/frame.ts +8 -2
  58. package/src/core/notebook/replica/index.ts +5 -1
  59. package/src/core/notebook/replica/once-per-frame.ts +4 -3
  60. package/src/core/notebook/replica/resources/executions.ts +16 -1
  61. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +10 -1
  62. package/src/css/common.css +11 -0
  63. package/src/hooks/useFinePointer.ts +30 -0
  64. package/src/stories/log-viewer.stories.tsx +48 -44
  65. package/src/utils/shared-intersection-observer.ts +2 -1
@@ -1,18 +1,9 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
  import type { Variable } from "@marimo-team/client/protocol";
3
3
  import type { FileUIPart, UIMessage } from "ai";
4
- import {
5
- afterEach,
6
- beforeEach,
7
- describe,
8
- expect,
9
- it,
10
- type Mock,
11
- vi,
12
- } from "vitest";
4
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
13
5
  import { MockExecutions } from "@/__mocks__/executions";
14
6
  import * as aiContext from "@/core/ai/context/context";
15
- import { getCodes } from "@/core/codemirror/copilot/getCodes";
16
7
  import { dataSourceConnectionsAtom } from "@/core/datasets/data-source-connections";
17
8
  import { DUCKDB_ENGINE } from "@/core/datasets/engines";
18
9
  import { datasetsAtom } from "@/core/datasets/state";
@@ -43,6 +34,8 @@ function setBindings(bindings: Pick<Variable, "name" | "type" | "preview">[]) {
43
34
  }
44
35
 
45
36
  describe("getAICompletionBody", () => {
37
+ const includeOtherCode = "// Some other code";
38
+
46
39
  beforeEach(() => {
47
40
  // Reset the Jotai store before each test
48
41
  store.set(datasetsAtom, {
@@ -53,7 +46,6 @@ describe("getAICompletionBody", () => {
53
46
  connectionsMap: new Map(),
54
47
  });
55
48
  store.set(activeNotebookReplicaAtom, null);
56
- (getCodes as Mock).mockReturnValue("// Some other code");
57
49
  });
58
50
 
59
51
  it("should return the correct completion body with mentioned datasets", () => {
@@ -77,7 +69,7 @@ describe("getAICompletionBody", () => {
77
69
  store.set(datasetsAtom, { tables: testDatasets } as DatasetsState);
78
70
 
79
71
  const input = "Use @data://dataset1 and @data://dataset2 for analysis";
80
- const result = getAICompletionBody({ input });
72
+ const result = getAICompletionBody({ input, includeOtherCode });
81
73
 
82
74
  expect(result).toMatchInlineSnapshot(`
83
75
  {
@@ -99,7 +91,7 @@ describe("getAICompletionBody", () => {
99
91
 
100
92
  it("should handle input with no mentioned datasets", () => {
101
93
  const input = "Perform some analysis without mentioning @data://datasets";
102
- const result = getAICompletionBody({ input });
94
+ const result = getAICompletionBody({ input, includeOtherCode });
103
95
 
104
96
  expect(result).toMatchInlineSnapshot(`
105
97
  {
@@ -128,7 +120,7 @@ describe("getAICompletionBody", () => {
128
120
 
129
121
  const input =
130
122
  "Use @data://existingDataset and @data://nonExistentDataset for analysis";
131
- const result = getAICompletionBody({ input });
123
+ const result = getAICompletionBody({ input, includeOtherCode });
132
124
 
133
125
  expect(result).toMatchInlineSnapshot(`
134
126
  {
@@ -163,7 +155,7 @@ describe("getAICompletionBody", () => {
163
155
 
164
156
  const input =
165
157
  "Use @data://dataset.with.dots and @data://regular_dataset for analysis";
166
- const result = getAICompletionBody({ input });
158
+ const result = getAICompletionBody({ input, includeOtherCode });
167
159
 
168
160
  expect(result).toMatchInlineSnapshot(`
169
161
  {
@@ -215,7 +207,7 @@ describe("getAICompletionBody", () => {
215
207
  });
216
208
 
217
209
  const input = "Use @data://table1 for analysis";
218
- const result = getAICompletionBody({ input });
210
+ const result = getAICompletionBody({ input, includeOtherCode });
219
211
 
220
212
  expect(result).toMatchInlineSnapshot(`
221
213
  {
@@ -238,7 +230,7 @@ describe("getAICompletionBody", () => {
238
230
  ]);
239
231
 
240
232
  const input = "Use @variable://var1 and @variable://var2 for analysis";
241
- const result = getAICompletionBody({ input });
233
+ const result = getAICompletionBody({ input, includeOtherCode });
242
234
 
243
235
  expect(result).toMatchInlineSnapshot(`
244
236
  {
@@ -270,7 +262,7 @@ describe("getAICompletionBody", () => {
270
262
  setBindings([{ name: "var1", type: "string", preview: "string value" }]);
271
263
 
272
264
  const input = "Use @data://dataset1 and @variable://var1 for analysis";
273
- const result = getAICompletionBody({ input });
265
+ const result = getAICompletionBody({ input, includeOtherCode });
274
266
 
275
267
  expect(result).toMatchInlineSnapshot(`
276
268
  {
@@ -296,7 +288,7 @@ describe("getAICompletionBody", () => {
296
288
 
297
289
  const input =
298
290
  "Use @variable://existingVar and @variable://nonExistentVar for analysis";
299
- const result = getAICompletionBody({ input });
291
+ const result = getAICompletionBody({ input, includeOtherCode });
300
292
 
301
293
  expect(result).toMatchInlineSnapshot(`
302
294
  {
@@ -325,7 +317,7 @@ describe("getAICompletionBody", () => {
325
317
  ]);
326
318
 
327
319
  const input = "Use @data://conflict for analysis";
328
- const result = getAICompletionBody({ input });
320
+ const result = getAICompletionBody({ input, includeOtherCode });
329
321
 
330
322
  expect(result).toMatchInlineSnapshot(`
331
323
  {