@cueloop/client 0.1.0-alpha.11 → 0.1.0-alpha.111
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/native/build-pty.sh +51 -0
- package/native/build.sh +82 -0
- package/native/darwin-arm64/libcuelooppty.dylib +0 -0
- package/native/darwin-arm64/libcueloopvt.dylib +0 -0
- package/native/src/pty.zig +193 -0
- package/native/src/shim.zig +114 -0
- package/package.json +42 -34
- package/src/annotations/annotation-palette.ts +63 -0
- package/src/annotations/components/AnnotationCards.stories.tsx +86 -0
- package/src/annotations/components/AnnotationCards.test.tsx +42 -0
- package/src/annotations/components/AnnotationCards.tsx +383 -0
- package/src/annotations/components/DiscussionMarkerRail.stories.tsx +54 -0
- package/src/annotations/components/DiscussionMarkerRail.tsx +189 -0
- package/src/annotations/discussions.ts +78 -0
- package/src/annotations/thread-selection.test.ts +210 -0
- package/src/annotations/thread-selection.ts +248 -0
- package/src/annotations/use-annotation-surface.tsx +1378 -0
- package/src/app/App.appearance.test.tsx +53 -0
- package/src/{App.autoclose.test.tsx → app/App.autoclose.test.tsx} +77 -51
- package/src/app/App.deleted-scroll.test.tsx +190 -0
- package/src/app/App.diff.test.tsx +313 -0
- package/src/app/App.export.test.tsx +105 -0
- package/src/app/App.focus.test.ts +89 -0
- package/src/app/App.harness-settings.test.tsx +77 -0
- package/src/app/App.identity.test.tsx +84 -0
- package/src/app/App.plan-render.test.tsx +211 -0
- package/src/app/App.plan-review.test.tsx +429 -0
- package/src/app/App.prototype-markdown.test.tsx +129 -0
- package/src/app/App.prototype.test.tsx +176 -0
- package/src/app/App.readonly.test.tsx +274 -0
- package/src/app/App.regression.test.tsx +99 -0
- package/src/app/App.rendering.test.tsx +134 -0
- package/src/app/App.share-dialog.test.tsx +177 -0
- package/src/app/App.submit-confirm.test.tsx +267 -0
- package/src/app/App.test.tsx +497 -0
- package/src/app/App.thread-agent.test.ts +20 -0
- package/src/app/App.toast.test.tsx +124 -0
- package/src/app/App.tsx +1758 -0
- package/src/app/App.visual.test.tsx +60 -0
- package/src/app/App.walk.test.tsx +300 -0
- package/src/app/App.workbench.test.tsx +1153 -0
- package/src/app/app-key-state.ts +61 -0
- package/src/app/app-screens.tsx +607 -0
- package/src/app/app-view-model.ts +178 -0
- package/src/app/components/AppHeader.stories.tsx +50 -0
- package/src/app/components/AppHeader.tsx +81 -0
- package/src/app/components/AppShell.brand.test.tsx +58 -0
- package/src/app/components/AppShell.extensions.test.tsx +191 -0
- package/src/app/components/AppShell.stories.tsx +89 -0
- package/src/app/components/AppShell.tsx +358 -0
- package/src/app/components/AppShell.zoom.test.tsx +149 -0
- package/src/app/components/Breadcrumb.stories.tsx +19 -0
- package/src/app/components/Breadcrumb.tsx +45 -0
- package/src/app/components/MenuBar.stories.tsx +28 -0
- package/src/app/components/MenuBar.tsx +44 -0
- package/src/app/components/PaneGrid.stories.tsx +84 -0
- package/src/app/components/PaneGrid.tsx +128 -0
- package/src/app/components/PanelColumn.stories.tsx +25 -0
- package/src/app/components/PanelColumn.tsx +93 -0
- package/src/app/components/ShellHeader.stories.tsx +50 -0
- package/src/app/components/ShellHeader.tsx +137 -0
- package/src/app/components/WorkspacePanels.stories.tsx +36 -0
- package/src/app/components/WorkspacePanels.tsx +121 -0
- package/src/app/components/pages/Workspace.stories.tsx +181 -0
- package/src/app/intent-dispatch.test.ts +729 -0
- package/src/app/intent-dispatch.ts +713 -0
- package/src/app/launch-layout.test.ts +78 -0
- package/src/app/launch-layout.ts +57 -0
- package/src/app/ready-signal.test.ts +85 -0
- package/src/app/ready-signal.ts +54 -0
- package/src/app/run.ts +111 -0
- package/src/{serve.test.ts → app/serve.test.ts} +28 -12
- package/src/app/serve.ts +111 -0
- package/src/app/version.ts +5 -0
- package/src/appearance/components/theme-context.stories.tsx +46 -0
- package/src/appearance/components/theme-context.tsx +37 -0
- package/src/appearance/theme-presets.test.ts +51 -0
- package/src/appearance/theme-presets.ts +219 -0
- package/src/appearance/theme.ts +112 -0
- package/src/appearance/visual/contrast.test.ts +35 -0
- package/src/appearance/visual/contrast.ts +33 -0
- package/src/diff/components/AnnotatableFileView.stories.tsx +42 -0
- package/src/diff/components/AnnotatableFileView.test.tsx +160 -0
- package/src/diff/components/AnnotatableFileView.tsx +142 -0
- package/src/diff/components/BareWorkbenchFileView.stories.tsx +27 -0
- package/src/diff/components/BareWorkbenchFileView.tsx +63 -0
- package/src/diff/components/DiffContentView.scroll.test.tsx +443 -0
- package/src/diff/components/DiffContentView.split.test.tsx +140 -0
- package/src/diff/components/DiffContentView.stories.tsx +80 -0
- package/src/diff/components/DiffContentView.syntax.test.tsx +85 -0
- package/src/diff/components/DiffContentView.tsx +1080 -0
- package/src/diff/components/WalkWizard.stories.tsx +100 -0
- package/src/diff/components/WalkWizard.tsx +146 -0
- package/src/diff/components/diff-content-view-layout.test.ts +198 -0
- package/src/diff/components/diff-content-view-layout.ts +87 -0
- package/src/diff/diff-fold.test.ts +78 -0
- package/src/diff/diff-fold.ts +130 -0
- package/src/diff/diff-hunk-curate.test.ts +315 -0
- package/src/diff/diff-hunk-curate.ts +155 -0
- package/src/diff/diff-intraline.test.ts +239 -0
- package/src/diff/diff-intraline.ts +244 -0
- package/src/diff/diff-syntax.test.ts +125 -0
- package/src/diff/diff-syntax.ts +194 -0
- package/src/diff/split-diff.test.ts +110 -0
- package/src/diff/split-diff.ts +150 -0
- package/src/diff/view-diff.test.ts +325 -0
- package/src/diff/view-diff.ts +540 -0
- package/src/diff/walk.test.ts +121 -0
- package/src/diff/walk.ts +76 -0
- package/src/index.ts +32 -2
- package/src/integrations/attribution.test.ts +31 -0
- package/src/integrations/attribution.ts +44 -0
- package/src/integrations/client-extension-registry.test.tsx +61 -0
- package/src/integrations/client-extension-registry.ts +163 -0
- package/src/integrations/clipboard.test.ts +23 -0
- package/src/integrations/clipboard.ts +34 -0
- package/src/integrations/components/ExtensionZone.stories.tsx +28 -0
- package/src/integrations/components/ExtensionZone.tsx +145 -0
- package/src/integrations/components/ShareDialog.agent.test.tsx +52 -0
- package/src/integrations/components/ShareDialog.stories.tsx +121 -0
- package/src/integrations/components/ShareDialog.tsx +602 -0
- package/src/integrations/components/share-dialog-store.ts +59 -0
- package/src/integrations/editor.test.ts +149 -0
- package/src/integrations/editor.ts +163 -0
- package/src/integrations/github-identity.test.ts +59 -0
- package/src/integrations/github-identity.ts +42 -0
- package/src/integrations/herdr.test.ts +43 -0
- package/src/integrations/herdr.ts +40 -0
- package/src/integrations/integrations.test.ts +41 -0
- package/src/integrations/integrations.ts +32 -0
- package/src/integrations/pasted-image.test.ts +67 -0
- package/src/integrations/pasted-image.ts +62 -0
- package/src/integrations/share.ts +283 -0
- package/src/keyboard/components/CompletionOverlay.stories.tsx +37 -0
- package/src/keyboard/components/CompletionOverlay.tsx +75 -0
- package/src/keyboard/components/HandleChipsInput.stories.tsx +24 -0
- package/src/keyboard/components/HandleChipsInput.test.tsx +35 -0
- package/src/keyboard/components/HandleChipsInput.tsx +147 -0
- package/src/keyboard/components/KeybindsDialog.stories.tsx +31 -0
- package/src/keyboard/components/KeybindsDialog.tsx +103 -0
- package/src/keyboard/components/NavModeHint.stories.tsx +40 -0
- package/src/keyboard/components/NavModeHint.tsx +31 -0
- package/src/keyboard/components/SlashComposer.stories.tsx +37 -0
- package/src/keyboard/components/SlashComposer.tsx +90 -0
- package/src/keyboard/key-bindings.test.ts +156 -0
- package/src/keyboard/key-bindings.ts +462 -0
- package/src/keyboard/keymap.test.ts +611 -0
- package/src/keyboard/keymap.ts +446 -0
- package/src/keyboard/skills.test.ts +74 -0
- package/src/keyboard/skills.ts +77 -0
- package/src/keyboard/slash-palette.test.ts +103 -0
- package/src/keyboard/slash-palette.ts +137 -0
- package/src/keyboard/thread-chords.test.ts +79 -0
- package/src/keyboard/thread-chords.ts +168 -0
- package/src/keyboard/use-shared-keyboard.ts +56 -0
- package/src/markdown/__snapshots__/view-plan.regression.test.ts.snap +100 -0
- package/src/markdown/components/MarkdownGridBlock.stories.tsx +33 -0
- package/src/markdown/components/MarkdownGridBlock.tsx +72 -0
- package/src/markdown/components/MarkdownThreadEditor.stories.tsx +15 -0
- package/src/markdown/components/MarkdownThreadEditor.test.tsx +98 -0
- package/src/markdown/components/MarkdownThreadEditor.tsx +165 -0
- package/src/markdown/components/ThreadView.selection.test.tsx +954 -0
- package/src/markdown/components/ThreadView.slash.test.tsx +146 -0
- package/src/markdown/components/ThreadView.stories.tsx +26 -0
- package/src/markdown/components/ThreadView.tsx +577 -0
- package/src/markdown/mark-runs.ts +125 -0
- package/src/markdown/markdown-editor-syntax-style.ts +66 -0
- package/src/markdown/markdown-grid.test.ts +101 -0
- package/src/markdown/markdown-grid.ts +209 -0
- package/src/markdown/markdown-highlight.test.ts +61 -0
- package/src/markdown/markdown-highlight.ts +125 -0
- package/src/markdown/thread-code-syntax.ts +48 -0
- package/src/markdown/use-thread-body-editing.tsx +54 -0
- package/src/markdown/view-plan.regression.test.ts +60 -0
- package/src/markdown/view-plan.test.ts +545 -0
- package/src/markdown/view-plan.ts +1061 -0
- package/src/performance/otlp-trace.test.ts +119 -0
- package/src/performance/otlp-trace.ts +134 -0
- package/src/performance/perf-report.ts +19 -0
- package/src/performance/perf-timings.test.ts +18 -0
- package/src/performance/perf-timings.ts +40 -0
- package/src/prototype/components/PrototypeContentView.stories.tsx +19 -0
- package/src/prototype/components/PrototypeContentView.tsx +459 -0
- package/src/prototype/prototype-browser.test.ts +81 -0
- package/src/prototype/prototype-browser.ts +332 -0
- package/src/prototype/prototype-pixels.tsx +35 -0
- package/src/settings/components/SettingsDialog.stories.tsx +117 -0
- package/src/settings/components/SettingsDialog.tsx +186 -0
- package/src/settings/components/SettingsRows.stories.tsx +18 -0
- package/src/settings/components/SettingsRows.tsx +112 -0
- package/src/settings/components/quick-actions-editor.stories.tsx +58 -0
- package/src/settings/components/quick-actions-editor.test.tsx +120 -0
- package/src/settings/components/quick-actions-editor.tsx +222 -0
- package/src/settings/config-identity.test.ts +78 -0
- package/src/settings/config.test.ts +771 -0
- package/src/settings/config.ts +722 -0
- package/src/settings/use-settings-dialog.test.tsx +172 -0
- package/src/settings/use-settings-dialog.tsx +465 -0
- package/src/settings/use-thread-harness-setting.test.tsx +87 -0
- package/src/settings/use-thread-harness-setting.ts +86 -0
- package/src/stories/__snapshots__/stories.test.tsx.snap +2358 -0
- package/src/stories/stories-app.tsx +196 -0
- package/src/stories/stories.test.tsx +78 -0
- package/src/stories/story-fixtures.ts +102 -0
- package/src/stories/story-tree.test.ts +108 -0
- package/src/stories/story.ts +160 -0
- package/src/terminal/ansi-screen.test.ts +28 -0
- package/src/terminal/ansi-screen.ts +77 -0
- package/src/terminal/components/AnsiScreen.stories.tsx +12 -0
- package/src/terminal/components/AnsiScreen.tsx +28 -0
- package/src/terminal/components/terminal-pane.test.tsx +40 -0
- package/src/terminal/components/terminal-pane.ts +208 -0
- package/src/terminal/ghostty-terminal.test.ts +85 -0
- package/src/terminal/ghostty-terminal.ts +207 -0
- package/src/terminal/kitty-image.test.ts +66 -0
- package/src/terminal/kitty-image.ts +140 -0
- package/src/terminal/pty.test.ts +81 -0
- package/src/terminal/pty.ts +255 -0
- package/src/testing/test-support.test.ts +266 -0
- package/src/testing/test-support.ts +449 -0
- package/src/thread/agent-continuation.test.ts +34 -0
- package/src/thread/agent-continuation.ts +13 -0
- package/src/thread/agent-transcript.test.ts +161 -0
- package/src/thread/agent-transcript.ts +344 -0
- package/src/thread/components/AgentConfigControls.stories.tsx +39 -0
- package/src/thread/components/AgentConfigControls.test.tsx +153 -0
- package/src/thread/components/AgentConfigControls.tsx +121 -0
- package/src/thread/components/AgentThreadPane.stories.tsx +105 -0
- package/src/thread/components/AgentThreadPane.test.tsx +1248 -0
- package/src/thread/components/AgentThreadPane.tsx +458 -0
- package/src/thread/components/ThreadFooter.stories.tsx +30 -0
- package/src/thread/components/ThreadFooter.test.tsx +49 -0
- package/src/thread/components/ThreadFooter.tsx +77 -0
- package/src/thread/components/ThreadTree.stories.tsx +46 -0
- package/src/thread/components/ThreadTree.test.tsx +41 -0
- package/src/thread/components/ThreadTree.tsx +268 -0
- package/src/thread/components/thread-tree.test.ts +138 -0
- package/src/thread/components/thread-tree.ts +112 -0
- package/src/thread/thread-controller.curate.test.ts +504 -0
- package/src/thread/thread-controller.derivation.test.ts +62 -0
- package/src/thread/thread-controller.live-diff.test.ts +357 -0
- package/src/thread/thread-controller.optimistic.test.ts +69 -0
- package/src/thread/thread-controller.share.test.ts +618 -0
- package/src/thread/thread-controller.switch-cache.test.ts +174 -0
- package/src/thread/thread-controller.tree.test.ts +263 -0
- package/src/thread/thread-controller.ts +2151 -0
- package/src/thread/tree-view.test.ts +128 -0
- package/src/thread/tree-view.ts +150 -0
- package/src/thread/use-thread-agent.test.tsx +209 -0
- package/src/thread/use-thread-agent.ts +122 -0
- package/src/ui/components/CodeBlock.stories.tsx +42 -0
- package/src/ui/components/CodeBlock.tsx +82 -0
- package/src/ui/components/ConfirmCard.stories.tsx +37 -0
- package/src/ui/components/ConfirmCard.tsx +151 -0
- package/src/ui/components/ConfirmDialog.stories.tsx +21 -0
- package/src/ui/components/ConfirmDialog.tsx +72 -0
- package/src/ui/components/OverlayScrollbar.stories.tsx +33 -0
- package/src/ui/components/OverlayScrollbar.test.tsx +142 -0
- package/src/ui/components/OverlayScrollbar.tsx +134 -0
- package/src/ui/components/PromptDialog.stories.tsx +36 -0
- package/src/ui/components/PromptDialog.test.tsx +65 -0
- package/src/ui/components/PromptDialog.tsx +101 -0
- package/src/ui/components/RootOverlay.stories.tsx +45 -0
- package/src/ui/components/RootOverlay.tsx +50 -0
- package/src/ui/components/ScrollArea.stories.tsx +20 -0
- package/src/ui/components/ScrollArea.tsx +63 -0
- package/src/ui/components/Toast.stories.tsx +19 -0
- package/src/ui/components/Toast.tsx +54 -0
- package/src/ui/components/Tooltip.stories.tsx +26 -0
- package/src/ui/components/Tooltip.tsx +93 -0
- package/src/ui/components/menu-control.stories.tsx +35 -0
- package/src/ui/components/menu-control.tsx +43 -0
- package/src/ui/components/primitives/Button.stories.tsx +32 -0
- package/src/ui/components/primitives/Button.tsx +58 -0
- package/src/ui/components/primitives/Card.stories.tsx +25 -0
- package/src/ui/components/primitives/Card.tsx +62 -0
- package/src/ui/components/primitives/Dialog.stories.tsx +24 -0
- package/src/ui/components/primitives/Dialog.test.tsx +38 -0
- package/src/ui/components/primitives/Dialog.tsx +69 -0
- package/src/ui/components/primitives/DialogActions.stories.tsx +20 -0
- package/src/ui/components/primitives/DialogActions.tsx +39 -0
- package/src/ui/components/primitives/IconButton.stories.tsx +36 -0
- package/src/ui/components/primitives/IconButton.tsx +58 -0
- package/src/ui/components/primitives/StatusBar.stories.tsx +11 -0
- package/src/ui/components/primitives/StatusBar.tsx +23 -0
- package/src/ui/components/primitives/Switch.stories.tsx +17 -0
- package/src/ui/components/primitives/Switch.tsx +32 -0
- package/src/ui/components/primitives/Tabs.stories.tsx +29 -0
- package/src/ui/components/primitives/Tabs.tsx +102 -0
- package/src/ui/components/primitives/Toolbar.stories.tsx +17 -0
- package/src/ui/components/primitives/Toolbar.tsx +14 -0
- package/src/ui/components/primitives/Tree.stories.tsx +124 -0
- package/src/ui/components/primitives/Tree.tsx +137 -0
- package/src/ui/components/primitives/frame.test.ts +12 -0
- package/src/ui/components/primitives/frame.ts +17 -0
- package/src/ui/components/primitives/icons.ts +61 -0
- package/src/ui/components/primitives/tree-model.test.ts +99 -0
- package/src/ui/components/primitives/tree-model.ts +144 -0
- package/src/ui/components/syntax-highlight.ts +154 -0
- package/src/ui/components/truncate-text.ts +7 -0
- package/src/ui/components/truncate-title.test.ts +31 -0
- package/src/ui/components/truncate-title.ts +16 -0
- package/src/ui/use-frame-measure.ts +88 -0
- package/src/ui/use-terminal-virtualizer.ts +286 -0
- package/src/workbench/components/ChangesColumn.stories.tsx +44 -0
- package/src/workbench/components/ChangesColumn.tsx +210 -0
- package/src/workbench/components/ChangesFileTree.test.tsx +184 -0
- package/src/workbench/components/EditorGrid.split.test.tsx +119 -0
- package/src/workbench/components/EditorGrid.stories.tsx +86 -0
- package/src/workbench/components/EditorGrid.tabs.test.tsx +118 -0
- package/src/workbench/components/EditorGrid.tsx +552 -0
- package/src/workbench/components/EditorGrid.zoom.test.tsx +132 -0
- package/src/workbench/components/FileContentsView.stories.tsx +16 -0
- package/src/workbench/components/FileContentsView.test.tsx +29 -0
- package/src/workbench/components/FileContentsView.tsx +104 -0
- package/src/workbench/components/GridTabContent.actions.test.tsx +151 -0
- package/src/workbench/components/GridTabContent.stories.tsx +59 -0
- package/src/workbench/components/GridTabContent.tsx +195 -0
- package/src/workbench/components/ProjectTreeView.stories.tsx +25 -0
- package/src/workbench/components/ProjectTreeView.test.tsx +239 -0
- package/src/workbench/components/ProjectTreeView.tsx +159 -0
- package/src/workbench/components/TreePane.stories.tsx +106 -0
- package/src/workbench/components/TreePane.tsx +157 -0
- package/src/workbench/components/WelcomePlayground.stories.tsx +12 -0
- package/src/workbench/components/WelcomePlayground.test.tsx +83 -0
- package/src/workbench/components/WelcomePlayground.tsx +138 -0
- package/src/workbench/components/editor-grid.test.ts +184 -0
- package/src/workbench/components/editor-grid.ts +284 -0
- package/src/workbench/components/file-tree.test.ts +60 -0
- package/src/workbench/components/file-tree.ts +114 -0
- package/src/workbench/use-changes-workbench.ts +210 -0
- package/src/workbench/use-remember-layout.ts +33 -0
- package/src/workbench/use-repo-changes.ts +93 -0
- package/src/workbench/workbench-snapshot.test.ts +99 -0
- package/src/workbench/workbench-snapshot.ts +59 -0
- package/src/App.diff.test.tsx +0 -99
- package/src/App.export.test.tsx +0 -88
- package/src/App.plan-review.test.tsx +0 -259
- package/src/App.readonly.test.tsx +0 -148
- package/src/App.rendering.test.tsx +0 -108
- package/src/App.submit-confirm.test.tsx +0 -183
- package/src/App.test.tsx +0 -218
- package/src/App.tsx +0 -1249
- package/src/config.test.ts +0 -116
- package/src/config.ts +0 -150
- package/src/editor.ts +0 -34
- package/src/herdr.test.ts +0 -68
- package/src/herdr.ts +0 -34
- package/src/keymap.test.ts +0 -270
- package/src/keymap.ts +0 -173
- package/src/run.ts +0 -30
- package/src/serve.ts +0 -75
- package/src/session-controller.ts +0 -398
- package/src/syntax.test.ts +0 -41
- package/src/syntax.ts +0 -88
- package/src/theme.ts +0 -46
- package/src/view-diff.test.ts +0 -55
- package/src/view-diff.ts +0 -86
- package/src/view.test.ts +0 -157
- package/src/view.ts +0 -364
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { testRender } from "@opentui/react/test-utils";
|
|
4
|
+
import { DARK } from "../../appearance/theme";
|
|
5
|
+
import { press, waitForText } from "../../testing/test-support";
|
|
6
|
+
import { ShareDialog } from "./ShareDialog";
|
|
7
|
+
import { newWizardDraft, shareDialogStore } from "./share-dialog-store";
|
|
8
|
+
import type { NewShareLink } from "../../thread/thread-controller";
|
|
9
|
+
|
|
10
|
+
for (const enabled of [false, true])
|
|
11
|
+
test(`share agent toggle is ${enabled ? "opt-in" : "hidden"}`, async () => {
|
|
12
|
+
const created: NewShareLink[] = [];
|
|
13
|
+
|
|
14
|
+
shareDialogStore.getState().reset();
|
|
15
|
+
shareDialogStore.getState().openWizard(newWizardDraft("Review"));
|
|
16
|
+
const setup = await testRender(
|
|
17
|
+
<ShareDialog
|
|
18
|
+
isOpen
|
|
19
|
+
isOwner
|
|
20
|
+
agentAvailable={enabled}
|
|
21
|
+
links={[]}
|
|
22
|
+
threadName="Review"
|
|
23
|
+
theme={DARK}
|
|
24
|
+
onCreateLink={(input) => created.push(input)}
|
|
25
|
+
onUpdateLink={() => {}}
|
|
26
|
+
onDeleteLink={() => {}}
|
|
27
|
+
onCopyLink={() => {}}
|
|
28
|
+
onClose={() => {}}
|
|
29
|
+
/>,
|
|
30
|
+
{ width: 100, height: 26 },
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
await waitForText(setup, "link name");
|
|
35
|
+
expect(shareDialogStore.getState().wizard?.agentEnabled ?? false).toBe(false);
|
|
36
|
+
expect(setup.captureCharFrame().includes("Allow agent messages")).toBe(enabled);
|
|
37
|
+
await press(setup, "down");
|
|
38
|
+
await press(setup, "down");
|
|
39
|
+
|
|
40
|
+
if (enabled) {
|
|
41
|
+
await press(setup, " ");
|
|
42
|
+
await press(setup, "down");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
await press(setup, "enter");
|
|
46
|
+
expect(created).toHaveLength(1);
|
|
47
|
+
expect(created[0]?.agentEnabled).toBe(enabled ? true : undefined);
|
|
48
|
+
} finally {
|
|
49
|
+
setup.renderer.destroy();
|
|
50
|
+
shareDialogStore.getState().reset();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ShareLink } from "@cueloop/schema";
|
|
3
|
+
import { DARK } from "../../appearance/theme";
|
|
4
|
+
import type { Story, StoryMeta } from "../../stories/story";
|
|
5
|
+
import { ShareDialog } from "./ShareDialog";
|
|
6
|
+
import { newWizardDraft, shareDialogStore } from "./share-dialog-store";
|
|
7
|
+
|
|
8
|
+
export const meta: StoryMeta = { title: "Dialogs/Share" };
|
|
9
|
+
|
|
10
|
+
const LINKS: ShareLink[] = [
|
|
11
|
+
{ id: "p_ab12cd", name: "reviewers", requireAuth: true, allowlist: ["octocat"] },
|
|
12
|
+
{ id: "p_ef34gh", requireAuth: false, allowlist: [] },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const NOOP = {
|
|
16
|
+
onCreateLink: () => {},
|
|
17
|
+
onUpdateLink: () => {},
|
|
18
|
+
onDeleteLink: () => {},
|
|
19
|
+
onCopyLink: () => {},
|
|
20
|
+
onClose: () => {},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const SIZE = { width: 80, height: 24 };
|
|
24
|
+
|
|
25
|
+
export const EmptyList: Story = {
|
|
26
|
+
render: () => {
|
|
27
|
+
shareDialogStore.getState().reset();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<ShareDialog
|
|
31
|
+
isOpen
|
|
32
|
+
threadName="Improve retry logic"
|
|
33
|
+
links={[]}
|
|
34
|
+
isOwner
|
|
35
|
+
{...NOOP}
|
|
36
|
+
theme={DARK}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
size: SIZE,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const WithLinks: Story = {
|
|
44
|
+
render: () => {
|
|
45
|
+
shareDialogStore.getState().reset();
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ShareDialog
|
|
49
|
+
isOpen
|
|
50
|
+
threadName="Improve retry logic"
|
|
51
|
+
links={LINKS}
|
|
52
|
+
isOwner
|
|
53
|
+
{...NOOP}
|
|
54
|
+
theme={DARK}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
size: SIZE,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const ExportComingSoon: Story = {
|
|
62
|
+
render: () => {
|
|
63
|
+
shareDialogStore.getState().reset();
|
|
64
|
+
shareDialogStore.getState().setCategory("export");
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<ShareDialog
|
|
68
|
+
isOpen
|
|
69
|
+
threadName="Improve retry logic"
|
|
70
|
+
links={LINKS}
|
|
71
|
+
isOwner
|
|
72
|
+
{...NOOP}
|
|
73
|
+
theme={DARK}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
size: SIZE,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const NewLinkWizard: Story = {
|
|
81
|
+
render: () => {
|
|
82
|
+
shareDialogStore.getState().reset();
|
|
83
|
+
shareDialogStore.getState().openWizard(newWizardDraft("Improve retry logic"));
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<ShareDialog
|
|
87
|
+
isOpen
|
|
88
|
+
threadName="Improve retry logic"
|
|
89
|
+
links={[]}
|
|
90
|
+
isOwner
|
|
91
|
+
{...NOOP}
|
|
92
|
+
theme={DARK}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
size: SIZE,
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const AuthWizard: Story = {
|
|
100
|
+
render: () => {
|
|
101
|
+
shareDialogStore.getState().reset();
|
|
102
|
+
shareDialogStore.getState().openWizard({
|
|
103
|
+
editingId: null,
|
|
104
|
+
name: "reviewers",
|
|
105
|
+
requireAuth: true,
|
|
106
|
+
allowlist: ["octocat", "hubot"],
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<ShareDialog
|
|
111
|
+
isOpen
|
|
112
|
+
threadName="Improve retry logic"
|
|
113
|
+
links={[]}
|
|
114
|
+
isOwner
|
|
115
|
+
{...NOOP}
|
|
116
|
+
theme={DARK}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
size: SIZE,
|
|
121
|
+
};
|