@cueloop/client 0.1.0-alpha.32 → 0.1.0-alpha.34
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 +27 -26
- package/src/App.autoclose.test.tsx +7 -4
- package/src/App.diff.test.tsx +131 -5
- package/src/App.export.test.tsx +23 -5
- package/src/App.plan-review.test.tsx +133 -32
- package/src/App.readonly.test.tsx +35 -13
- package/src/App.rendering.test.tsx +14 -4
- package/src/App.review-panel.test.tsx +27 -15
- package/src/App.submit-confirm.test.tsx +14 -13
- package/src/App.test.tsx +50 -13
- package/src/App.toast.test.tsx +75 -0
- package/src/App.tsx +505 -101
- package/src/App.walk.test.tsx +31 -11
- package/src/attribution.ts +8 -2
- package/src/clipboard.ts +5 -1
- package/src/components/AnnotationCard.stories.tsx +29 -10
- package/src/components/AnnotationCard.tsx +57 -37
- package/src/components/Breadcrumb.tsx +7 -1
- package/src/components/CodeBlock.stories.tsx +19 -2
- package/src/components/CodeBlock.tsx +24 -9
- package/src/components/CompletionOverlay.tsx +13 -3
- package/src/components/ConfirmCard.stories.tsx +22 -3
- package/src/components/ConfirmCard.tsx +23 -5
- package/src/components/ConfirmDialog.tsx +10 -2
- package/src/components/DiffSheet.scroll.test.tsx +123 -0
- package/src/components/DiffSheet.stories.tsx +35 -1
- package/src/components/DiffSheet.syntax.test.tsx +62 -0
- package/src/components/DiffSheet.tsx +213 -101
- package/src/components/InboxList.stories.tsx +16 -3
- package/src/components/InboxList.tsx +17 -10
- package/src/components/KeybindsDialog.stories.tsx +31 -0
- package/src/components/KeybindsDialog.tsx +58 -0
- package/src/components/MarkerPopover.stories.tsx +58 -0
- package/src/components/MarkerPopover.tsx +102 -0
- package/src/components/MenuBar.stories.tsx +37 -0
- package/src/components/MenuBar.tsx +74 -0
- package/src/components/PlanSheet.stories.tsx +35 -3
- package/src/components/PlanSheet.tsx +160 -100
- package/src/components/PromptDialog.tsx +19 -3
- package/src/components/ReviewPanel.stories.tsx +17 -19
- package/src/components/ReviewPanel.tsx +17 -32
- package/src/components/ReviewRail.stories.tsx +159 -47
- package/src/components/ReviewRail.tsx +206 -62
- package/src/components/SettingsDialog.stories.tsx +51 -3
- package/src/components/SettingsDialog.tsx +11 -5
- package/src/components/SettingsRows.stories.tsx +1 -1
- package/src/components/SettingsRows.tsx +19 -3
- package/src/components/Toast.stories.tsx +12 -0
- package/src/components/Toast.tsx +44 -0
- package/src/components/WalkWizard.stories.tsx +13 -2
- package/src/components/WalkWizard.tsx +9 -3
- package/src/components/__snapshots__/stories.test.tsx.snap +853 -623
- package/src/components/diff-sheet-layout.test.ts +127 -0
- package/src/components/diff-sheet-layout.ts +167 -0
- package/src/components/primitives/Button.stories.tsx +2 -2
- package/src/components/primitives/Button.tsx +5 -1
- package/src/components/primitives/Dialog.tsx +12 -1
- package/src/components/primitives/Tabs.tsx +40 -39
- package/src/components/stories-app.tsx +34 -6
- package/src/components/story-fixtures.ts +11 -3
- package/src/components/story.ts +3 -1
- package/src/components/syntax-highlight.ts +47 -12
- package/src/components/theme-context.stories.tsx +6 -1
- package/src/components/theme-context.tsx +7 -1
- package/src/config.test.ts +178 -2
- package/src/config.ts +121 -23
- package/src/diff-hunk-curate.test.ts +315 -0
- package/src/diff-hunk-curate.ts +233 -0
- package/src/diff-intraline.test.ts +164 -0
- package/src/diff-intraline.ts +132 -0
- package/src/diff-syntax.test.ts +96 -0
- package/src/diff-syntax.ts +154 -0
- package/src/editor.test.ts +13 -4
- package/src/editor.ts +31 -5
- package/src/herdr.ts +8 -2
- package/src/index.ts +9 -1
- package/src/integrations.ts +3 -1
- package/src/intent-dispatch.test.ts +193 -9
- package/src/intent-dispatch.ts +151 -18
- package/src/key-bindings.test.ts +19 -9
- package/src/key-bindings.ts +77 -16
- package/src/keymap.test.ts +171 -26
- package/src/keymap.ts +83 -16
- package/src/review-panel.test.ts +3 -1
- package/src/review-panel.ts +9 -2
- package/src/serve.test.ts +13 -5
- package/src/session-controller.curate.test.ts +253 -0
- package/src/session-controller.share.test.ts +77 -16
- package/src/session-controller.ts +319 -26
- package/src/share.ts +41 -8
- package/src/test-support.ts +97 -23
- package/src/theme-presets.ts +168 -0
- package/src/theme.ts +1 -3
- package/src/version.ts +5 -0
- package/src/view-diff.ts +15 -4
- package/src/view-plan.test.ts +40 -6
- package/src/view-plan.ts +71 -28
- package/src/walk.test.ts +7 -2
- package/src/walk.ts +7 -2
- package/src/components/ComposeBar.stories.tsx +0 -18
- package/src/components/ComposeBar.tsx +0 -54
|
@@ -49,7 +49,8 @@ export function SettingsDialog({
|
|
|
49
49
|
const tokens = useComponentTheme(theme);
|
|
50
50
|
const { width: terminalWidth, height: terminalHeight } = useTerminalDimensions();
|
|
51
51
|
if (!isOpen) return null;
|
|
52
|
-
const category =
|
|
52
|
+
const category =
|
|
53
|
+
categories.find((candidate) => candidate.id === activeCategoryId) ?? categories[0];
|
|
53
54
|
if (!category) return null;
|
|
54
55
|
return (
|
|
55
56
|
<Dialog
|
|
@@ -57,6 +58,7 @@ export function SettingsDialog({
|
|
|
57
58
|
title=" Settings "
|
|
58
59
|
width={Math.min(76, terminalWidth - 6)}
|
|
59
60
|
height={Math.min(22, terminalHeight - 4)}
|
|
61
|
+
background={tokens.elevated}
|
|
60
62
|
theme={theme}
|
|
61
63
|
>
|
|
62
64
|
<box style={{ flexDirection: "row", flexGrow: 1 }}>
|
|
@@ -67,10 +69,14 @@ export function SettingsDialog({
|
|
|
67
69
|
return (
|
|
68
70
|
<box
|
|
69
71
|
key={candidate.id}
|
|
70
|
-
style={{
|
|
72
|
+
style={{
|
|
73
|
+
backgroundColor: isActive && activeZone === "nav" ? tokens.border : undefined,
|
|
74
|
+
}}
|
|
71
75
|
onMouseUp={() => onCategorySelect(candidate.id)}
|
|
72
76
|
>
|
|
73
|
-
<text
|
|
77
|
+
<text
|
|
78
|
+
fg={isActive ? tokens.accent : tokens.textMuted}
|
|
79
|
+
>{`${isActive ? "› " : " "}${candidate.name}`}</text>
|
|
74
80
|
</box>
|
|
75
81
|
);
|
|
76
82
|
})}
|
|
@@ -120,10 +126,10 @@ export function SettingsDialog({
|
|
|
120
126
|
})}
|
|
121
127
|
</box>
|
|
122
128
|
</box>
|
|
123
|
-
<box style={{ flexDirection: "row", height: 1,
|
|
129
|
+
<box style={{ flexDirection: "row", height: 1, paddingLeft: 1 }}>
|
|
124
130
|
<text fg={tokens.textDim}>
|
|
125
131
|
{activeZone === "nav"
|
|
126
|
-
? "j/k category · l
|
|
132
|
+
? "j/k category · l/enter into settings · esc close"
|
|
127
133
|
: "j/k row · l/space change · h back · esc close"}
|
|
128
134
|
</text>
|
|
129
135
|
</box>
|
|
@@ -14,5 +14,5 @@ export const AllKinds: Story = {
|
|
|
14
14
|
<TextRow label="Vault path" value="~/vaults/notes" isActive={false} onPress={() => {}} />
|
|
15
15
|
</box>
|
|
16
16
|
),
|
|
17
|
-
expectedColors: [DARK.green, DARK.accent, DARK.
|
|
17
|
+
expectedColors: [DARK.green, DARK.accent, DARK.border],
|
|
18
18
|
};
|
|
@@ -29,7 +29,11 @@ function RowShell({ label, isActive, onPress, theme, children }: RowShellProps):
|
|
|
29
29
|
const tokens = useComponentTheme(theme);
|
|
30
30
|
return (
|
|
31
31
|
<box
|
|
32
|
-
style={{
|
|
32
|
+
style={{
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
height: 1,
|
|
35
|
+
backgroundColor: isActive ? tokens.border : undefined,
|
|
36
|
+
}}
|
|
33
37
|
onMouseUp={onPress}
|
|
34
38
|
>
|
|
35
39
|
<box style={{ width: 26, paddingLeft: 1 }}>
|
|
@@ -48,7 +52,13 @@ export interface ToggleRowProps {
|
|
|
48
52
|
theme?: Theme;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
export function ToggleRow({
|
|
55
|
+
export function ToggleRow({
|
|
56
|
+
label,
|
|
57
|
+
value,
|
|
58
|
+
isActive,
|
|
59
|
+
onPress,
|
|
60
|
+
theme,
|
|
61
|
+
}: ToggleRowProps): React.ReactNode {
|
|
52
62
|
const tokens = useComponentTheme(theme);
|
|
53
63
|
return (
|
|
54
64
|
<RowShell label={label} isActive={isActive} onPress={onPress} theme={theme}>
|
|
@@ -65,7 +75,13 @@ export interface CycleRowProps {
|
|
|
65
75
|
theme?: Theme;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
|
-
export function CycleRow({
|
|
78
|
+
export function CycleRow({
|
|
79
|
+
label,
|
|
80
|
+
value,
|
|
81
|
+
isActive,
|
|
82
|
+
onPress,
|
|
83
|
+
theme,
|
|
84
|
+
}: CycleRowProps): React.ReactNode {
|
|
69
85
|
const tokens = useComponentTheme(theme);
|
|
70
86
|
return (
|
|
71
87
|
<RowShell label={label} isActive={isActive} onPress={onPress} theme={theme}>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DARK } from "../theme";
|
|
3
|
+
import type { Story, StoryMeta } from "./story";
|
|
4
|
+
import { Toast } from "./Toast";
|
|
5
|
+
|
|
6
|
+
export const meta: StoryMeta = { title: "Toast" };
|
|
7
|
+
|
|
8
|
+
export const ShareLink: Story = {
|
|
9
|
+
render: () => <Toast title="share link copied" body="ssh review-4f2a@cueloop.dev" />,
|
|
10
|
+
expectedColors: [DARK.accent],
|
|
11
|
+
size: { width: 60, height: 12 },
|
|
12
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useTerminalDimensions } from "@opentui/react";
|
|
3
|
+
import type { Theme } from "../theme";
|
|
4
|
+
import { useComponentTheme } from "./theme-context";
|
|
5
|
+
import { Dialog } from "./primitives/Dialog";
|
|
6
|
+
|
|
7
|
+
export interface ToastProps {
|
|
8
|
+
title?: string;
|
|
9
|
+
body: string;
|
|
10
|
+
theme?: Theme;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function Toast({ title, body, theme }: ToastProps): React.ReactNode {
|
|
14
|
+
const tokens = useComponentTheme(theme);
|
|
15
|
+
const { width: terminalWidth } = useTerminalDimensions();
|
|
16
|
+
const width = Math.min(terminalWidth - 6, Math.max(28, body.length + 4));
|
|
17
|
+
return (
|
|
18
|
+
<Dialog
|
|
19
|
+
isOpen
|
|
20
|
+
title={title ? ` ${title} ` : undefined}
|
|
21
|
+
width={width}
|
|
22
|
+
height={6}
|
|
23
|
+
background={tokens.elevated}
|
|
24
|
+
theme={theme}
|
|
25
|
+
>
|
|
26
|
+
<box
|
|
27
|
+
style={{
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
flexGrow: 1,
|
|
30
|
+
paddingLeft: 1,
|
|
31
|
+
paddingRight: 1,
|
|
32
|
+
paddingTop: 1,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<text fg={tokens.text}>{body}</text>
|
|
36
|
+
<box style={{ flexGrow: 1 }} />
|
|
37
|
+
<box style={{ flexDirection: "row" }}>
|
|
38
|
+
<box style={{ flexGrow: 1 }} />
|
|
39
|
+
<text fg={tokens.textDim}>[esc]</text>
|
|
40
|
+
</box>
|
|
41
|
+
</box>
|
|
42
|
+
</Dialog>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -23,7 +23,12 @@ const FILES: WalkFile[] = [
|
|
|
23
23
|
removed: 0,
|
|
24
24
|
preview: [{ sign: "+", text: "export function firstUnviewedIndex(files, viewed) {" }],
|
|
25
25
|
},
|
|
26
|
-
{
|
|
26
|
+
{
|
|
27
|
+
path: "packages/schema/src/types.ts",
|
|
28
|
+
added: 3,
|
|
29
|
+
removed: 0,
|
|
30
|
+
preview: [{ sign: "+", text: "viewedPaths?: string[];" }],
|
|
31
|
+
},
|
|
27
32
|
];
|
|
28
33
|
|
|
29
34
|
const noop = (): void => {};
|
|
@@ -40,7 +45,13 @@ export const FirstFile: Story = {
|
|
|
40
45
|
/>
|
|
41
46
|
),
|
|
42
47
|
// the main card wears the accent border; stats carry the +/- colors
|
|
43
|
-
expectedColors: [
|
|
48
|
+
expectedColors: [
|
|
49
|
+
DARK.accent,
|
|
50
|
+
DARK.green,
|
|
51
|
+
DARK.red,
|
|
52
|
+
DARK.insertedForeground,
|
|
53
|
+
DARK.deletedForeground,
|
|
54
|
+
],
|
|
44
55
|
};
|
|
45
56
|
|
|
46
57
|
export const WithAgentNote: Story = {
|
|
@@ -106,9 +106,11 @@ export function WalkWizard({
|
|
|
106
106
|
<text fg={tokens.text}>{currentFile.path}</text>
|
|
107
107
|
<text>
|
|
108
108
|
<span fg={tokens.green}>{`+${currentFile.added}`}</span>
|
|
109
|
-
<span fg={tokens.textDim}>
|
|
109
|
+
<span fg={tokens.textDim}> </span>
|
|
110
110
|
<span fg={tokens.red}>{`-${currentFile.removed}`}</span>
|
|
111
|
-
<span fg={tokens.textDim}>
|
|
111
|
+
<span fg={tokens.textDim}>
|
|
112
|
+
{viewedPaths.has(currentFile.path) ? " · viewed" : ""}
|
|
113
|
+
</span>
|
|
112
114
|
</text>
|
|
113
115
|
<box style={{ height: 1 }} />
|
|
114
116
|
{currentFile.preview.length === 0 ? (
|
|
@@ -118,7 +120,11 @@ export function WalkWizard({
|
|
|
118
120
|
<text
|
|
119
121
|
key={previewIndex}
|
|
120
122
|
style={{ wrapMode: "none" }}
|
|
121
|
-
fg={
|
|
123
|
+
fg={
|
|
124
|
+
previewLine.sign === "+"
|
|
125
|
+
? tokens.insertedForeground
|
|
126
|
+
: tokens.deletedForeground
|
|
127
|
+
}
|
|
122
128
|
>
|
|
123
129
|
{previewLine.sign + previewLine.text}
|
|
124
130
|
</text>
|