@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.
- package/package.json +5 -5
- package/src/App.autoclose.test.tsx +2 -2
- package/src/App.diff.test.tsx +8 -73
- package/src/App.export.test.tsx +2 -2
- package/src/App.plan-review.test.tsx +60 -412
- package/src/App.prototype.test.tsx +1 -8
- package/src/App.readonly.test.tsx +85 -62
- package/src/App.rendering.test.tsx +5 -6
- package/src/App.submit-confirm.test.tsx +32 -70
- package/src/App.test.tsx +136 -66
- package/src/App.toast.test.tsx +17 -8
- package/src/App.tsx +243 -284
- package/src/App.walk.test.tsx +1 -1
- package/src/app-screens.tsx +67 -52
- package/src/app-view-model.ts +6 -100
- package/src/components/AnnotationCard.stories.tsx +1 -1
- package/src/components/AnnotationCard.tsx +2 -2
- package/src/components/AppShell.stories.tsx +84 -0
- package/src/components/AppShell.tsx +127 -0
- package/src/components/Breadcrumb.stories.tsx +1 -1
- package/src/components/ChangesColumn.stories.tsx +39 -0
- package/src/components/ChangesColumn.tsx +147 -0
- package/src/components/CodeBlock.stories.tsx +1 -1
- package/src/components/CompletionOverlay.stories.tsx +1 -1
- package/src/components/ConfirmCard.stories.tsx +1 -1
- package/src/components/ConfirmCard.tsx +3 -4
- package/src/components/ConfirmDialog.stories.tsx +1 -1
- package/src/components/DiffSheet.stories.tsx +1 -1
- package/src/components/InboxList.stories.tsx +23 -8
- package/src/components/InboxList.tsx +45 -19
- package/src/components/KeybindsDialog.stories.tsx +1 -1
- package/src/components/KeybindsDialog.tsx +61 -17
- package/src/components/MarkerPopover.stories.tsx +1 -1
- package/src/components/MenuBar.stories.tsx +3 -12
- package/src/components/MenuBar.tsx +25 -56
- package/src/components/PromptDialog.stories.tsx +1 -1
- package/src/components/PrototypeSheet.stories.tsx +1 -1
- package/src/components/ReviewPanel.stories.tsx +15 -1
- package/src/components/ReviewRail.stories.tsx +15 -1
- package/src/components/ReviewRail.tsx +13 -6
- package/src/components/SettingsDialog.stories.tsx +7 -1
- package/src/components/SettingsDialog.tsx +112 -66
- package/src/components/SettingsRows.stories.tsx +1 -1
- package/src/components/ShellHeader.stories.tsx +50 -0
- package/src/components/ShellHeader.tsx +137 -0
- package/src/components/ThreadFooter.stories.tsx +30 -0
- package/src/components/ThreadFooter.tsx +49 -0
- package/src/components/ThreadView.selection.test.tsx +812 -0
- package/src/components/ThreadView.slash.test.tsx +113 -0
- package/src/components/ThreadView.stories.tsx +26 -0
- package/src/components/ThreadView.tsx +1708 -0
- package/src/components/ThreadsSidebar.stories.tsx +36 -0
- package/src/components/ThreadsSidebar.tsx +57 -0
- package/src/components/Toast.stories.tsx +1 -1
- package/src/components/TreePane.stories.tsx +106 -0
- package/src/components/TreePane.tsx +156 -0
- package/src/components/WalkWizard.stories.tsx +1 -1
- package/src/components/__snapshots__/stories.test.tsx.snap +463 -305
- package/src/components/agent-launcher.stories.tsx +1 -1
- package/src/components/file-tree.test.ts +45 -0
- package/src/components/file-tree.ts +57 -0
- package/src/components/pages/Workspace.stories.tsx +181 -0
- package/src/components/primitives/Button.stories.tsx +1 -1
- package/src/components/primitives/Card.stories.tsx +1 -1
- package/src/components/primitives/Dialog.stories.tsx +1 -1
- package/src/components/primitives/IconButton.stories.tsx +36 -0
- package/src/components/primitives/IconButton.tsx +43 -0
- package/src/components/primitives/StatusBar.stories.tsx +1 -1
- package/src/components/primitives/Tabs.stories.tsx +1 -1
- package/src/components/primitives/Toolbar.stories.tsx +1 -1
- package/src/components/primitives/Tree.stories.tsx +124 -0
- package/src/components/primitives/Tree.tsx +87 -0
- package/src/components/primitives/icons.ts +38 -0
- package/src/components/primitives/tree-model.test.ts +99 -0
- package/src/components/primitives/tree-model.ts +137 -0
- package/src/components/quick-actions-editor.stories.tsx +1 -1
- package/src/components/session-tree.test.ts +114 -0
- package/src/components/session-tree.ts +94 -0
- package/src/components/stories-app.tsx +142 -82
- package/src/components/story-tree.test.ts +100 -0
- package/src/components/story.ts +55 -0
- package/src/components/theme-context.stories.tsx +1 -1
- package/src/diff-hunk-curate.ts +4 -104
- package/src/index.ts +1 -0
- package/src/intent-dispatch.test.ts +136 -3
- package/src/intent-dispatch.ts +92 -24
- package/src/key-bindings.test.ts +1 -1
- package/src/keymap.test.ts +4 -4
- package/src/keymap.ts +14 -7
- package/src/session-controller.curate.test.ts +89 -2
- package/src/session-controller.share.test.ts +195 -55
- package/src/session-controller.tree.test.ts +228 -0
- package/src/session-controller.ts +331 -72
- package/src/share.ts +114 -16
- package/src/test-support.test.ts +193 -1
- package/src/test-support.ts +64 -0
- package/src/theme.ts +4 -4
- package/src/thread-chords.test.ts +154 -0
- package/src/thread-chords.ts +144 -0
- package/src/thread-selection.test.ts +210 -0
- package/src/thread-selection.ts +243 -0
- package/src/tree-view.test.ts +128 -0
- package/src/tree-view.ts +148 -0
- package/src/use-settings-dialog.tsx +9 -0
- package/src/view-plan.ts +29 -12
- package/src/App.review-panel.test.tsx +0 -143
- package/src/components/PlanSheet.stories.tsx +0 -113
- package/src/components/PlanSheet.tsx +0 -419
- 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
|
+
};
|