@cueloop/client 0.1.0-alpha.77 → 0.1.0-alpha.79
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 +14 -13
- package/src/App.autoclose.test.tsx +3 -3
- package/src/App.diff.test.tsx +22 -5
- package/src/App.export.test.tsx +1 -2
- package/src/App.focus.test.ts +1 -59
- package/src/App.identity.test.tsx +3 -3
- package/src/App.plan-render.test.tsx +209 -0
- package/src/App.plan-review.test.tsx +91 -26
- package/src/App.readonly.test.tsx +6 -5
- package/src/App.share-dialog.test.tsx +172 -0
- package/src/App.submit-confirm.test.tsx +39 -8
- package/src/App.test.tsx +33 -30
- package/src/App.toast.test.tsx +11 -4
- package/src/App.tsx +263 -274
- package/src/App.walk.test.tsx +11 -10
- package/src/App.workbench.test.tsx +86 -0
- package/src/__snapshots__/view-plan.regression.test.ts.snap +1 -1
- package/src/annotation-palette.ts +1 -0
- package/src/ansi-screen.test.ts +28 -0
- package/src/ansi-screen.ts +72 -0
- package/src/app-screens.tsx +19 -9
- package/src/app-view-model.ts +3 -1
- package/src/components/AnnotatableFileView.tsx +1 -1
- package/src/components/AnnotationCards.tsx +18 -2
- package/src/components/AnsiScreen.stories.tsx +12 -0
- package/src/components/AnsiScreen.tsx +28 -0
- package/src/components/CompletionOverlay.stories.tsx +15 -1
- package/src/components/CompletionOverlay.tsx +22 -5
- package/src/components/ConfirmCard.stories.tsx +2 -0
- package/src/components/ConfirmCard.tsx +45 -18
- package/src/components/ConfirmDialog.stories.tsx +3 -3
- package/src/components/ConfirmDialog.tsx +11 -12
- package/src/components/DiffContentView.tsx +18 -11
- package/src/components/DiscussionMarkerRail.tsx +9 -4
- package/src/components/FileContentsView.tsx +1 -1
- package/src/components/GridTabContent.tsx +8 -2
- package/src/components/HandleChipsInput.stories.tsx +24 -0
- package/src/components/HandleChipsInput.test.tsx +35 -0
- package/src/components/HandleChipsInput.tsx +145 -0
- package/src/components/MarkdownGridBlock.stories.tsx +33 -0
- package/src/components/MarkdownGridBlock.tsx +72 -0
- package/src/components/MarkdownThreadEditor.stories.tsx +15 -0
- package/src/components/MarkdownThreadEditor.test.tsx +98 -0
- package/src/components/MarkdownThreadEditor.tsx +162 -0
- package/src/components/NavModeHint.stories.tsx +40 -0
- package/src/components/NavModeHint.tsx +31 -0
- package/src/components/PromptDialog.test.tsx +2 -2
- package/src/components/PromptDialog.tsx +9 -10
- package/src/components/SettingsDialog.tsx +1 -0
- package/src/components/ShareDialog.stories.tsx +121 -0
- package/src/components/ShareDialog.tsx +552 -0
- package/src/components/SlashComposer.stories.tsx +37 -0
- package/src/components/SlashComposer.tsx +87 -0
- package/src/components/ThreadFooter.tsx +4 -1
- package/src/components/ThreadTree.tsx +12 -7
- package/src/components/ThreadView.selection.test.tsx +88 -1
- package/src/components/ThreadView.slash.test.tsx +0 -36
- package/src/components/ThreadView.tsx +200 -67
- package/src/components/Toast.stories.tsx +7 -0
- package/src/components/Toast.tsx +15 -8
- package/src/components/WalkWizard.stories.tsx +2 -2
- package/src/components/WalkWizard.tsx +10 -12
- package/src/components/__snapshots__/stories.test.tsx.snap +436 -182
- package/src/components/primitives/Button.tsx +6 -2
- package/src/components/primitives/Card.tsx +5 -2
- package/src/components/primitives/Dialog.tsx +2 -2
- package/src/components/primitives/DialogActions.stories.tsx +20 -0
- package/src/components/primitives/DialogActions.tsx +39 -0
- package/src/components/primitives/Switch.stories.tsx +17 -0
- package/src/components/primitives/Switch.tsx +32 -0
- package/src/components/primitives/Tree.tsx +5 -1
- package/src/components/primitives/frame.ts +5 -0
- package/src/components/session-tree.ts +7 -6
- package/src/components/share-dialog-store.ts +58 -0
- package/src/components/stories-app.tsx +13 -4
- package/src/components/stories.test.tsx +12 -4
- package/src/components/story-tree.test.ts +32 -24
- package/src/components/story.ts +32 -15
- package/src/config.test.ts +18 -0
- package/src/config.ts +8 -1
- package/src/diff-fold.ts +1 -1
- package/src/diff-intraline.test.ts +75 -2
- package/src/diff-intraline.ts +95 -26
- package/src/intent-dispatch.test.ts +12 -3
- package/src/intent-dispatch.ts +10 -25
- package/src/key-bindings.ts +0 -6
- package/src/keymap.test.ts +2 -2
- package/src/keymap.ts +0 -2
- package/src/markdown-editor-syntax-style.ts +50 -0
- package/src/markdown-grid.test.ts +101 -0
- package/src/markdown-grid.ts +203 -0
- package/src/markdown-highlight.test.ts +61 -0
- package/src/markdown-highlight.ts +122 -0
- package/src/pasted-image.test.ts +67 -0
- package/src/pasted-image.ts +60 -0
- package/src/prototype-browser.test.ts +9 -1
- package/src/prototype-browser.ts +22 -0
- package/src/run.ts +39 -25
- package/src/serve.ts +1 -1
- package/src/share.ts +16 -2
- package/src/slash-palette.test.ts +17 -0
- package/src/slash-palette.ts +11 -0
- package/src/test-support.ts +14 -0
- package/src/thread-chords.test.ts +55 -178
- package/src/thread-chords.ts +78 -169
- package/src/thread-controller.curate.test.ts +1 -0
- package/src/thread-controller.derivation.test.ts +62 -0
- package/src/thread-controller.live-diff.test.ts +3 -0
- package/src/thread-controller.optimistic.test.ts +69 -0
- package/src/thread-controller.share.test.ts +60 -5
- package/src/thread-controller.switch-cache.test.ts +176 -0
- package/src/thread-controller.tree.test.ts +6 -1
- package/src/thread-controller.ts +386 -78
- package/src/use-annotation-surface.tsx +88 -63
- package/src/use-settings-dialog.tsx +14 -3
- package/src/use-thread-body-editing.tsx +58 -0
- package/src/view-plan.test.ts +56 -6
- package/src/view-plan.ts +154 -5
- package/src/App.share-choice.test.tsx +0 -105
- package/src/components/ManageAccessDialog.stories.tsx +0 -36
- package/src/components/ManageAccessDialog.test.tsx +0 -94
- package/src/components/ManageAccessDialog.tsx +0 -120
- package/src/components/ShareChoiceDialog.stories.tsx +0 -34
- package/src/components/ShareChoiceDialog.test.tsx +0 -103
- package/src/components/ShareChoiceDialog.tsx +0 -82
- package/src/components/ThreadsSidebar.stories.tsx +0 -36
- package/src/components/ThreadsSidebar.tsx +0 -71
- package/src/components/agent-launcher.stories.tsx +0 -26
- package/src/components/agent-launcher.test.tsx +0 -50
- package/src/components/agent-launcher.tsx +0 -149
package/src/components/Toast.tsx
CHANGED
|
@@ -10,17 +10,29 @@ export interface ToastProps {
|
|
|
10
10
|
theme?: Theme;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/** A toast never spans the screen: a long message wraps inside this, like the settings dialog. */
|
|
14
|
+
const TOAST_MAX_WIDTH = 64;
|
|
15
|
+
|
|
13
16
|
export function Toast({ title, body, theme }: ToastProps): React.ReactNode {
|
|
14
17
|
const tokens = useComponentTheme(theme);
|
|
15
|
-
const { width: terminalWidth } = useTerminalDimensions();
|
|
16
|
-
const width = Math.min(
|
|
18
|
+
const { width: terminalWidth, height: terminalHeight } = useTerminalDimensions();
|
|
19
|
+
const width = Math.min(
|
|
20
|
+
terminalWidth - 6,
|
|
21
|
+
Math.max(28, Math.min(TOAST_MAX_WIDTH, body.length + 4)),
|
|
22
|
+
);
|
|
23
|
+
// the message wraps at the content width, so grow the box to fit the wrapped lines
|
|
24
|
+
const contentWidth = Math.max(1, width - 4);
|
|
25
|
+
const lines = body
|
|
26
|
+
.split("\n")
|
|
27
|
+
.reduce((total, line) => total + Math.max(1, Math.ceil(line.length / contentWidth)), 0);
|
|
28
|
+
const height = Math.min(terminalHeight - 4, Math.max(6, lines + 4));
|
|
17
29
|
|
|
18
30
|
return (
|
|
19
31
|
<Dialog
|
|
20
32
|
isOpen
|
|
21
33
|
title={title ? ` ${title} ` : undefined}
|
|
22
34
|
width={width}
|
|
23
|
-
height={
|
|
35
|
+
height={height}
|
|
24
36
|
background={tokens.elevated}
|
|
25
37
|
theme={theme}
|
|
26
38
|
>
|
|
@@ -34,11 +46,6 @@ export function Toast({ title, body, theme }: ToastProps): React.ReactNode {
|
|
|
34
46
|
}}
|
|
35
47
|
>
|
|
36
48
|
<text fg={tokens.text}>{body}</text>
|
|
37
|
-
<box style={{ flexGrow: 1 }} />
|
|
38
|
-
<box style={{ flexDirection: "row" }}>
|
|
39
|
-
<box style={{ flexGrow: 1 }} />
|
|
40
|
-
<text fg={tokens.textDim}>[esc]</text>
|
|
41
|
-
</box>
|
|
42
49
|
</box>
|
|
43
50
|
</Dialog>
|
|
44
51
|
);
|
|
@@ -81,7 +81,7 @@ export const EndCard: Story = {
|
|
|
81
81
|
onBack={noop}
|
|
82
82
|
/>
|
|
83
83
|
),
|
|
84
|
-
//
|
|
84
|
+
// accent border and solid submit; the all-viewed line turns green
|
|
85
85
|
expectedColors: [DARK.green, DARK.accent, DARK.accentInk],
|
|
86
86
|
};
|
|
87
87
|
|
|
@@ -96,5 +96,5 @@ export const EndCardPartialPass: Story = {
|
|
|
96
96
|
onBack={noop}
|
|
97
97
|
/>
|
|
98
98
|
),
|
|
99
|
-
expectedColors: [DARK.
|
|
99
|
+
expectedColors: [DARK.accent, DARK.accentInk],
|
|
100
100
|
};
|
|
@@ -13,8 +13,7 @@ import { useComponentTheme } from "./theme-context";
|
|
|
13
13
|
import type { WalkFile } from "../walk";
|
|
14
14
|
import { viewedCount } from "../walk";
|
|
15
15
|
import { Card } from "./primitives/Card";
|
|
16
|
-
import {
|
|
17
|
-
import { Toolbar } from "./primitives/Toolbar";
|
|
16
|
+
import { DialogActions } from "./primitives/DialogActions";
|
|
18
17
|
|
|
19
18
|
export interface WalkWizardProps {
|
|
20
19
|
files: WalkFile[];
|
|
@@ -75,24 +74,23 @@ export function WalkWizard({
|
|
|
75
74
|
<Card
|
|
76
75
|
title=" walk complete "
|
|
77
76
|
contentRows={3}
|
|
78
|
-
borderColor={tokens.
|
|
77
|
+
borderColor={tokens.accent}
|
|
79
78
|
backgroundColor={tokens.elevated}
|
|
80
79
|
theme={theme}
|
|
81
80
|
>
|
|
82
|
-
<text fg={tokens.text}>
|
|
81
|
+
<text fg={viewed === files.length ? tokens.green : tokens.text}>
|
|
83
82
|
{viewed === files.length
|
|
84
83
|
? `every file viewed (${viewed}/${files.length})`
|
|
85
84
|
: `${viewed} of ${files.length} files viewed`}
|
|
86
85
|
</text>
|
|
87
86
|
<box style={{ height: 1 }} />
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
</Toolbar>
|
|
87
|
+
<DialogActions
|
|
88
|
+
confirmLabel="submit"
|
|
89
|
+
cancelLabel="back"
|
|
90
|
+
onConfirm={onSubmitRequest}
|
|
91
|
+
onCancel={onBack}
|
|
92
|
+
theme={theme}
|
|
93
|
+
/>
|
|
96
94
|
</Card>
|
|
97
95
|
) : (
|
|
98
96
|
<>
|