@cueloop/client 0.1.0-alpha.64 → 0.1.0-alpha.66

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 (109) hide show
  1. package/package.json +5 -5
  2. package/src/App.autoclose.test.tsx +2 -2
  3. package/src/App.diff.test.tsx +8 -73
  4. package/src/App.export.test.tsx +2 -2
  5. package/src/App.plan-review.test.tsx +60 -412
  6. package/src/App.prototype.test.tsx +1 -8
  7. package/src/App.readonly.test.tsx +85 -62
  8. package/src/App.rendering.test.tsx +5 -6
  9. package/src/App.submit-confirm.test.tsx +32 -70
  10. package/src/App.test.tsx +136 -66
  11. package/src/App.toast.test.tsx +17 -8
  12. package/src/App.tsx +243 -284
  13. package/src/App.walk.test.tsx +1 -1
  14. package/src/app-screens.tsx +67 -52
  15. package/src/app-view-model.ts +6 -100
  16. package/src/components/AnnotationCard.stories.tsx +1 -1
  17. package/src/components/AnnotationCard.tsx +2 -2
  18. package/src/components/AppShell.stories.tsx +84 -0
  19. package/src/components/AppShell.tsx +127 -0
  20. package/src/components/Breadcrumb.stories.tsx +1 -1
  21. package/src/components/ChangesColumn.stories.tsx +39 -0
  22. package/src/components/ChangesColumn.tsx +147 -0
  23. package/src/components/CodeBlock.stories.tsx +1 -1
  24. package/src/components/CompletionOverlay.stories.tsx +1 -1
  25. package/src/components/ConfirmCard.stories.tsx +1 -1
  26. package/src/components/ConfirmCard.tsx +3 -4
  27. package/src/components/ConfirmDialog.stories.tsx +1 -1
  28. package/src/components/DiffSheet.stories.tsx +1 -1
  29. package/src/components/InboxList.stories.tsx +23 -8
  30. package/src/components/InboxList.tsx +45 -19
  31. package/src/components/KeybindsDialog.stories.tsx +1 -1
  32. package/src/components/KeybindsDialog.tsx +61 -17
  33. package/src/components/MarkerPopover.stories.tsx +1 -1
  34. package/src/components/MenuBar.stories.tsx +3 -12
  35. package/src/components/MenuBar.tsx +25 -56
  36. package/src/components/PromptDialog.stories.tsx +1 -1
  37. package/src/components/PrototypeSheet.stories.tsx +1 -1
  38. package/src/components/ReviewPanel.stories.tsx +15 -1
  39. package/src/components/ReviewRail.stories.tsx +15 -1
  40. package/src/components/ReviewRail.tsx +13 -6
  41. package/src/components/SettingsDialog.stories.tsx +7 -1
  42. package/src/components/SettingsDialog.tsx +112 -66
  43. package/src/components/SettingsRows.stories.tsx +1 -1
  44. package/src/components/ShellHeader.stories.tsx +50 -0
  45. package/src/components/ShellHeader.tsx +137 -0
  46. package/src/components/ThreadFooter.stories.tsx +30 -0
  47. package/src/components/ThreadFooter.tsx +49 -0
  48. package/src/components/ThreadView.selection.test.tsx +812 -0
  49. package/src/components/ThreadView.slash.test.tsx +113 -0
  50. package/src/components/ThreadView.stories.tsx +26 -0
  51. package/src/components/ThreadView.tsx +1708 -0
  52. package/src/components/ThreadsSidebar.stories.tsx +36 -0
  53. package/src/components/ThreadsSidebar.tsx +57 -0
  54. package/src/components/Toast.stories.tsx +1 -1
  55. package/src/components/TreePane.stories.tsx +106 -0
  56. package/src/components/TreePane.tsx +156 -0
  57. package/src/components/WalkWizard.stories.tsx +1 -1
  58. package/src/components/__snapshots__/stories.test.tsx.snap +463 -305
  59. package/src/components/agent-launcher.stories.tsx +1 -1
  60. package/src/components/file-tree.test.ts +45 -0
  61. package/src/components/file-tree.ts +57 -0
  62. package/src/components/pages/Workspace.stories.tsx +181 -0
  63. package/src/components/primitives/Button.stories.tsx +1 -1
  64. package/src/components/primitives/Card.stories.tsx +1 -1
  65. package/src/components/primitives/Dialog.stories.tsx +1 -1
  66. package/src/components/primitives/IconButton.stories.tsx +36 -0
  67. package/src/components/primitives/IconButton.tsx +43 -0
  68. package/src/components/primitives/StatusBar.stories.tsx +1 -1
  69. package/src/components/primitives/Tabs.stories.tsx +1 -1
  70. package/src/components/primitives/Toolbar.stories.tsx +1 -1
  71. package/src/components/primitives/Tree.stories.tsx +124 -0
  72. package/src/components/primitives/Tree.tsx +87 -0
  73. package/src/components/primitives/icons.ts +38 -0
  74. package/src/components/primitives/tree-model.test.ts +99 -0
  75. package/src/components/primitives/tree-model.ts +137 -0
  76. package/src/components/quick-actions-editor.stories.tsx +1 -1
  77. package/src/components/session-tree.test.ts +114 -0
  78. package/src/components/session-tree.ts +94 -0
  79. package/src/components/stories-app.tsx +142 -82
  80. package/src/components/story-tree.test.ts +100 -0
  81. package/src/components/story.ts +55 -0
  82. package/src/components/theme-context.stories.tsx +1 -1
  83. package/src/diff-hunk-curate.ts +4 -104
  84. package/src/index.ts +1 -0
  85. package/src/intent-dispatch.test.ts +136 -3
  86. package/src/intent-dispatch.ts +92 -24
  87. package/src/key-bindings.test.ts +1 -1
  88. package/src/keymap.test.ts +4 -4
  89. package/src/keymap.ts +14 -7
  90. package/src/session-controller.curate.test.ts +89 -2
  91. package/src/session-controller.share.test.ts +195 -55
  92. package/src/session-controller.tree.test.ts +228 -0
  93. package/src/session-controller.ts +331 -72
  94. package/src/share.ts +114 -16
  95. package/src/test-support.test.ts +193 -1
  96. package/src/test-support.ts +64 -0
  97. package/src/theme.ts +4 -4
  98. package/src/thread-chords.test.ts +154 -0
  99. package/src/thread-chords.ts +144 -0
  100. package/src/thread-selection.test.ts +210 -0
  101. package/src/thread-selection.ts +243 -0
  102. package/src/tree-view.test.ts +128 -0
  103. package/src/tree-view.ts +148 -0
  104. package/src/use-settings-dialog.tsx +9 -0
  105. package/src/view-plan.ts +29 -12
  106. package/src/App.review-panel.test.tsx +0 -143
  107. package/src/components/PlanSheet.stories.tsx +0 -113
  108. package/src/components/PlanSheet.tsx +0 -419
  109. package/src/components/plan-sheet-run-style.ts +0 -88
@@ -0,0 +1,113 @@
1
+ /** Inline skill completion in the composer (#25): the trailing "/word" token and its match. */
2
+
3
+ import { describe, expect, test } from "bun:test";
4
+ import React from "react";
5
+ import { testRender } from "@opentui/react/test-utils";
6
+ import type { QuickAction } from "../config";
7
+ import { settle, typeText } from "../test-support";
8
+ import { buildDisplay, marksByDisplay } from "../view-plan";
9
+ import { fixturePlanSession } from "./story-fixtures";
10
+ import { inlineSlashToken, resolveInlineSuggestion, ThreadView } from "./ThreadView";
11
+
12
+ const SKILLS: QuickAction[] = [
13
+ { prompt: "typescript magician" },
14
+ { prompt: "implement" },
15
+ { prompt: "write discoverable code" },
16
+ ];
17
+
18
+ const PLAN = "# Plan\n\nRefine the store before the rewrite lands.\n";
19
+
20
+ async function mountComposer() {
21
+ const display = buildDisplay(PLAN, undefined);
22
+ const setup = await testRender(
23
+ <ThreadView
24
+ session={fixturePlanSession({
25
+ artifact: { type: "plan", content: PLAN, meta: { title: "Plan" } },
26
+ })}
27
+ display={display}
28
+ marks={marksByDisplay([], display)}
29
+ quickActions={SKILLS}
30
+ observer={false}
31
+ onAnnotate={() => {}}
32
+ onReply={() => {}}
33
+ onUpdateAnnotation={() => {}}
34
+ onExit={() => {}}
35
+ />,
36
+ { width: 72, height: 20 },
37
+ );
38
+
39
+ await settle(setup);
40
+ await settle(setup);
41
+
42
+ return setup;
43
+ }
44
+
45
+ describe("inlineSlashToken", () => {
46
+ test("finds the trailing slash token when text precedes it", () => {
47
+ expect(inlineSlashToken("please run /type")).toBe("/type");
48
+ });
49
+
50
+ test("ignores a draft that is itself a leading slash (that is the palette)", () => {
51
+ expect(inlineSlashToken("/type")).toBeNull();
52
+ });
53
+
54
+ test("is newline-safe: a token at the start of a later line still resolves", () => {
55
+ expect(inlineSlashToken("first line\n/impl")).toBe("/impl");
56
+ });
57
+
58
+ test("returns null when the trailing word is not a slash token", () => {
59
+ expect(inlineSlashToken("just some prose")).toBeNull();
60
+ });
61
+
62
+ test("a bare slash mid-sentence is a valid, empty-query token", () => {
63
+ expect(inlineSlashToken("run /")).toBe("/");
64
+ });
65
+ });
66
+
67
+ describe("resolveInlineSuggestion", () => {
68
+ test("offers the fuzzy closest skill for the trailing token", () => {
69
+ const inline = resolveInlineSuggestion(false, "run /type", SKILLS);
70
+
71
+ expect(inline?.token).toBe("/type");
72
+ expect(inline?.suggestion.name).toBe("typescript-magician");
73
+ });
74
+
75
+ test("prefers a prefix match over a subsequence match", () => {
76
+ const inline = resolveInlineSuggestion(false, "run /impl", SKILLS);
77
+
78
+ expect(inline?.suggestion.name).toBe("implement");
79
+ });
80
+
81
+ test("stays silent while the palette owns a leading slash", () => {
82
+ expect(resolveInlineSuggestion(true, "/type", SKILLS)).toBeNull();
83
+ });
84
+
85
+ test("returns null when nothing matches the token", () => {
86
+ expect(resolveInlineSuggestion(false, "run /zzzz", SKILLS)).toBeNull();
87
+ });
88
+ });
89
+
90
+ describe("inline completion in the composer", () => {
91
+ test("typing an inline slash shows the tab-hint, and tab completes to the full name", async () => {
92
+ // Arrange - open a composer and type text with a trailing slash token
93
+ const setup = await mountComposer();
94
+
95
+ await typeText(setup, "run /type");
96
+
97
+ // Assert - the hint offers the closest skill, marked with the tab glyph
98
+ const withHint = setup.captureCharFrame();
99
+
100
+ expect(withHint).toContain("⇥");
101
+ expect(withHint).toContain("/typescript-magician");
102
+
103
+ // Act - tab completes the token
104
+ setup.mockInput.pressKey("TAB");
105
+ await settle(setup);
106
+
107
+ // Assert - the hint is gone and the composer now carries the full skill name
108
+ const completed = setup.captureCharFrame();
109
+
110
+ expect(completed).not.toContain("⇥");
111
+ expect(completed).toContain("typescript-magician");
112
+ });
113
+ });
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { DEFAULT_QUICK_ACTIONS } from "../config";
3
+ import { DARK } from "../theme";
4
+ import type { Story, StoryMeta } from "./story";
5
+ import { fixtureDisplay, fixtureMarks, fixturePlanSession } from "./story-fixtures";
6
+ import { ThreadView } from "./ThreadView";
7
+
8
+ export const meta: StoryMeta = { title: "Surfaces/ThreadView" };
9
+
10
+ export const InlineThreads: Story = {
11
+ render: () => (
12
+ <ThreadView
13
+ session={fixturePlanSession()}
14
+ display={fixtureDisplay()}
15
+ marks={fixtureMarks()}
16
+ quickActions={DEFAULT_QUICK_ACTIONS}
17
+ observer={false}
18
+ onAnnotate={() => {}}
19
+ onReply={() => {}}
20
+ onUpdateAnnotation={() => {}}
21
+ onExit={() => {}}
22
+ />
23
+ ),
24
+ expectedColors: [DARK.text],
25
+ size: { width: 100, height: 34 },
26
+ };