@cueloop/client 0.1.0-alpha.15 → 0.1.0-alpha.17

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 (44) hide show
  1. package/package.json +5 -5
  2. package/src/App.plan-review.test.tsx +1 -1
  3. package/src/App.readonly.test.tsx +3 -3
  4. package/src/App.rendering.test.tsx +16 -16
  5. package/src/App.test.tsx +1 -1
  6. package/src/App.tsx +193 -139
  7. package/src/App.walk.test.tsx +208 -0
  8. package/src/components/AnnotationCard.tsx +4 -4
  9. package/src/components/ComposeBar.tsx +2 -2
  10. package/src/components/ConfirmCard.stories.tsx +15 -0
  11. package/src/components/ConfirmCard.tsx +8 -1
  12. package/src/components/DiffSheet.tsx +8 -8
  13. package/src/components/PlanSheet.stories.tsx +3 -3
  14. package/src/components/PlanSheet.tsx +31 -31
  15. package/src/components/WalkWizard.stories.tsx +89 -0
  16. package/src/components/WalkWizard.tsx +146 -0
  17. package/src/components/__snapshots__/stories.test.tsx.snap +130 -0
  18. package/src/components/stories.test.tsx +1 -1
  19. package/src/components/story-fixtures.ts +1 -1
  20. package/src/components/story.ts +1 -1
  21. package/src/components/syntax-highlight.ts +1 -1
  22. package/src/components/theme-context.tsx +1 -1
  23. package/src/components/truncate-text.ts +6 -0
  24. package/src/config.test.ts +29 -29
  25. package/src/config.ts +13 -12
  26. package/src/editor.ts +1 -1
  27. package/src/herdr.ts +1 -1
  28. package/src/key-bindings.test.ts +18 -1
  29. package/src/key-bindings.ts +23 -2
  30. package/src/keymap.test.ts +138 -101
  31. package/src/keymap.ts +81 -56
  32. package/src/run.ts +3 -3
  33. package/src/serve.test.ts +6 -6
  34. package/src/serve.ts +7 -7
  35. package/src/session-controller.ts +140 -66
  36. package/src/theme.ts +20 -1
  37. package/src/view-diff.test.ts +8 -8
  38. package/src/view-diff.ts +22 -22
  39. package/src/{view.test.ts → view-plan.test.ts} +48 -48
  40. package/src/view-plan.ts +362 -0
  41. package/src/walk.test.ts +110 -0
  42. package/src/walk.ts +65 -0
  43. package/src/components/format.ts +0 -6
  44. package/src/view.ts +0 -341
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@cueloop/client",
3
- "version": "0.1.0-alpha.15",
3
+ "version": "0.1.0-alpha.17",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./src/index.ts"
8
8
  },
9
9
  "dependencies": {
10
- "@cueloop/daemon": "0.1.0-alpha.15",
11
- "@cueloop/extension-api": "0.1.0-alpha.15",
12
- "@cueloop/integration-obsidian": "0.1.0-alpha.15",
13
- "@cueloop/schema": "0.1.0-alpha.15",
10
+ "@cueloop/daemon": "0.1.0-alpha.17",
11
+ "@cueloop/extension-api": "0.1.0-alpha.17",
12
+ "@cueloop/integration-obsidian": "0.1.0-alpha.17",
13
+ "@cueloop/schema": "0.1.0-alpha.17",
14
14
  "@opentui/core": "^0.5.1",
15
15
  "@opentui/keymap": "0.5.1",
16
16
  "@opentui/react": "^0.5.1",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The plan review surface v2 (#71): native selection feeds the annotation
2
+ * The plan review surface v2: native selection feeds the annotation
3
3
  * quote, the inline compose box keeps its anchor painted, the rail edits what
4
4
  * the document selects, and edit-exit reconciliation orphans annotations
5
5
  * whose passage was removed. Char-frame + styled-span assertions over the
@@ -56,8 +56,8 @@ async function renderObserver() {
56
56
 
57
57
  /** Session state that any mutating verb would change. */
58
58
  function snapshot() {
59
- const s = server.core.sessionGet(session.id);
60
- return { annotations: s.annotations.length, workingCopy: s.workingCopy, status: s.status };
59
+ const stored = server.core.sessionGet(session.id);
60
+ return { annotations: stored.annotations.length, workingCopy: stored.workingCopy, status: stored.status };
61
61
  }
62
62
 
63
63
  describe("observer rendering", () => {
@@ -114,7 +114,7 @@ describe("observer navigation still works", () => {
114
114
  await press(setup, "j");
115
115
  await setup.renderOnce();
116
116
  const lines = setup.captureCharFrame().split("\n");
117
- const cursorLine = lines.find((l) => l.includes("▎"))!;
117
+ const cursorLine = lines.find((line) => line.includes("▎"))!;
118
118
  expect(cursorLine).toContain("persists sessions");
119
119
  });
120
120
 
@@ -1,4 +1,4 @@
1
- /** Plan rendering (#67): code blocks verbatim + contained, spacing never collapses. */
1
+ /** Plan rendering: code blocks verbatim + contained, spacing never collapses. */
2
2
 
3
3
  import { afterEach, beforeEach, describe, expect, test } from "bun:test";
4
4
  import { mkdtempSync, rmSync } from "node:fs";
@@ -57,30 +57,30 @@ async function frame(): Promise<string> {
57
57
 
58
58
  describe("code blocks", () => {
59
59
  test("lines render verbatim: indentation preserved, no word-wrap", async () => {
60
- const f = await frame();
61
- expect(f).toContain(" const blocked = full < 0.6;");
62
- expect(f).toContain(' return <text>{blocked ? "blocked" : "clear"}</text>;');
60
+ const rendered = await frame();
61
+ expect(rendered).toContain(" const blocked = full < 0.6;");
62
+ expect(rendered).toContain(' return <text>{blocked ? "blocked" : "clear"}</text>;');
63
63
  });
64
64
 
65
65
  test("the block carries its language tag", async () => {
66
- const f = await frame();
67
- expect(f).toContain("tsx");
66
+ const rendered = await frame();
67
+ expect(rendered).toContain("tsx");
68
68
  });
69
69
  });
70
70
 
71
71
  describe("block spacing", () => {
72
72
  test("a code block never glues to the list item above it", async () => {
73
- const lines = (await frame()).split("\n").map((l) => l.trimEnd());
74
- const li = lines.findIndex((l) => l.includes("wire the duck over MQTT"));
75
- const codeHeader = lines.findIndex((l) => l.trim().startsWith("tsx"));
76
- expect(li).toBeGreaterThan(-1);
77
- expect(codeHeader).toBeGreaterThan(li);
78
- expect(lines.slice(li + 1, codeHeader).some((l) => l === "")).toBe(true);
73
+ const lines = (await frame()).split("\n").map((line) => line.trimEnd());
74
+ const listItemLineIndex = lines.findIndex((line) => line.includes("wire the duck over MQTT"));
75
+ const codeHeader = lines.findIndex((line) => line.trim().startsWith("tsx"));
76
+ expect(listItemLineIndex).toBeGreaterThan(-1);
77
+ expect(codeHeader).toBeGreaterThan(listItemLineIndex);
78
+ expect(lines.slice(listItemLineIndex + 1, codeHeader).some((line) => line === "")).toBe(true);
79
79
  });
80
80
 
81
81
  test("a heading never sits directly on the previous block", async () => {
82
- const lines = (await frame()).split("\n").map((l) => l.trimEnd());
83
- const gate = lines.findIndex((l) => l.trim() === "Gate");
82
+ const lines = (await frame()).split("\n").map((line) => line.trimEnd());
83
+ const gate = lines.findIndex((line) => line.trim() === "Gate");
84
84
  expect(gate).toBeGreaterThan(0);
85
85
  expect(lines[gate - 1]).toBe("");
86
86
  });
@@ -93,8 +93,8 @@ describe("block spacing", () => {
93
93
  });
94
94
  const setup = await testRender(<App home={home} sessionId={s2.id} />, { width: 120, height: 30 });
95
95
  await waitForText(setup, "one");
96
- const lines = setup.captureCharFrame().split("\n").map((l) => l.trimEnd());
97
- const one = lines.findIndex((l) => l.includes("- one"));
96
+ const lines = setup.captureCharFrame().split("\n").map((line) => line.trimEnd());
97
+ const one = lines.findIndex((line) => line.includes("- one"));
98
98
  expect(lines[one + 1]).toContain("- two");
99
99
  });
100
100
  });
package/src/App.test.tsx CHANGED
@@ -75,7 +75,7 @@ describe("keyboard grammar", () => {
75
75
  await press(setup, "j");
76
76
  await setup.renderOnce();
77
77
  const lines = setup.captureCharFrame().split("\n");
78
- const cursorLine = lines.find((l) => l.includes("▎"))!;
78
+ const cursorLine = lines.find((line) => line.includes("▎"))!;
79
79
  expect(cursorLine).toContain("persists sessions");
80
80
  });
81
81