@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.
Files changed (130) hide show
  1. package/package.json +14 -13
  2. package/src/App.autoclose.test.tsx +3 -3
  3. package/src/App.diff.test.tsx +22 -5
  4. package/src/App.export.test.tsx +1 -2
  5. package/src/App.focus.test.ts +1 -59
  6. package/src/App.identity.test.tsx +3 -3
  7. package/src/App.plan-render.test.tsx +209 -0
  8. package/src/App.plan-review.test.tsx +91 -26
  9. package/src/App.readonly.test.tsx +6 -5
  10. package/src/App.share-dialog.test.tsx +172 -0
  11. package/src/App.submit-confirm.test.tsx +39 -8
  12. package/src/App.test.tsx +33 -30
  13. package/src/App.toast.test.tsx +11 -4
  14. package/src/App.tsx +263 -274
  15. package/src/App.walk.test.tsx +11 -10
  16. package/src/App.workbench.test.tsx +86 -0
  17. package/src/__snapshots__/view-plan.regression.test.ts.snap +1 -1
  18. package/src/annotation-palette.ts +1 -0
  19. package/src/ansi-screen.test.ts +28 -0
  20. package/src/ansi-screen.ts +72 -0
  21. package/src/app-screens.tsx +19 -9
  22. package/src/app-view-model.ts +3 -1
  23. package/src/components/AnnotatableFileView.tsx +1 -1
  24. package/src/components/AnnotationCards.tsx +18 -2
  25. package/src/components/AnsiScreen.stories.tsx +12 -0
  26. package/src/components/AnsiScreen.tsx +28 -0
  27. package/src/components/CompletionOverlay.stories.tsx +15 -1
  28. package/src/components/CompletionOverlay.tsx +22 -5
  29. package/src/components/ConfirmCard.stories.tsx +2 -0
  30. package/src/components/ConfirmCard.tsx +45 -18
  31. package/src/components/ConfirmDialog.stories.tsx +3 -3
  32. package/src/components/ConfirmDialog.tsx +11 -12
  33. package/src/components/DiffContentView.tsx +18 -11
  34. package/src/components/DiscussionMarkerRail.tsx +9 -4
  35. package/src/components/FileContentsView.tsx +1 -1
  36. package/src/components/GridTabContent.tsx +8 -2
  37. package/src/components/HandleChipsInput.stories.tsx +24 -0
  38. package/src/components/HandleChipsInput.test.tsx +35 -0
  39. package/src/components/HandleChipsInput.tsx +145 -0
  40. package/src/components/MarkdownGridBlock.stories.tsx +33 -0
  41. package/src/components/MarkdownGridBlock.tsx +72 -0
  42. package/src/components/MarkdownThreadEditor.stories.tsx +15 -0
  43. package/src/components/MarkdownThreadEditor.test.tsx +98 -0
  44. package/src/components/MarkdownThreadEditor.tsx +162 -0
  45. package/src/components/NavModeHint.stories.tsx +40 -0
  46. package/src/components/NavModeHint.tsx +31 -0
  47. package/src/components/PromptDialog.test.tsx +2 -2
  48. package/src/components/PromptDialog.tsx +9 -10
  49. package/src/components/SettingsDialog.tsx +1 -0
  50. package/src/components/ShareDialog.stories.tsx +121 -0
  51. package/src/components/ShareDialog.tsx +552 -0
  52. package/src/components/SlashComposer.stories.tsx +37 -0
  53. package/src/components/SlashComposer.tsx +87 -0
  54. package/src/components/ThreadFooter.tsx +4 -1
  55. package/src/components/ThreadTree.tsx +12 -7
  56. package/src/components/ThreadView.selection.test.tsx +88 -1
  57. package/src/components/ThreadView.slash.test.tsx +0 -36
  58. package/src/components/ThreadView.tsx +200 -67
  59. package/src/components/Toast.stories.tsx +7 -0
  60. package/src/components/Toast.tsx +15 -8
  61. package/src/components/WalkWizard.stories.tsx +2 -2
  62. package/src/components/WalkWizard.tsx +10 -12
  63. package/src/components/__snapshots__/stories.test.tsx.snap +436 -182
  64. package/src/components/primitives/Button.tsx +6 -2
  65. package/src/components/primitives/Card.tsx +5 -2
  66. package/src/components/primitives/Dialog.tsx +2 -2
  67. package/src/components/primitives/DialogActions.stories.tsx +20 -0
  68. package/src/components/primitives/DialogActions.tsx +39 -0
  69. package/src/components/primitives/Switch.stories.tsx +17 -0
  70. package/src/components/primitives/Switch.tsx +32 -0
  71. package/src/components/primitives/Tree.tsx +5 -1
  72. package/src/components/primitives/frame.ts +5 -0
  73. package/src/components/session-tree.ts +7 -6
  74. package/src/components/share-dialog-store.ts +58 -0
  75. package/src/components/stories-app.tsx +13 -4
  76. package/src/components/stories.test.tsx +12 -4
  77. package/src/components/story-tree.test.ts +32 -24
  78. package/src/components/story.ts +32 -15
  79. package/src/config.test.ts +18 -0
  80. package/src/config.ts +8 -1
  81. package/src/diff-fold.ts +1 -1
  82. package/src/diff-intraline.test.ts +75 -2
  83. package/src/diff-intraline.ts +95 -26
  84. package/src/intent-dispatch.test.ts +12 -3
  85. package/src/intent-dispatch.ts +10 -25
  86. package/src/key-bindings.ts +0 -6
  87. package/src/keymap.test.ts +2 -2
  88. package/src/keymap.ts +0 -2
  89. package/src/markdown-editor-syntax-style.ts +50 -0
  90. package/src/markdown-grid.test.ts +101 -0
  91. package/src/markdown-grid.ts +203 -0
  92. package/src/markdown-highlight.test.ts +61 -0
  93. package/src/markdown-highlight.ts +122 -0
  94. package/src/pasted-image.test.ts +67 -0
  95. package/src/pasted-image.ts +60 -0
  96. package/src/prototype-browser.test.ts +9 -1
  97. package/src/prototype-browser.ts +22 -0
  98. package/src/run.ts +39 -25
  99. package/src/serve.ts +1 -1
  100. package/src/share.ts +16 -2
  101. package/src/slash-palette.test.ts +17 -0
  102. package/src/slash-palette.ts +11 -0
  103. package/src/test-support.ts +14 -0
  104. package/src/thread-chords.test.ts +55 -178
  105. package/src/thread-chords.ts +78 -169
  106. package/src/thread-controller.curate.test.ts +1 -0
  107. package/src/thread-controller.derivation.test.ts +62 -0
  108. package/src/thread-controller.live-diff.test.ts +3 -0
  109. package/src/thread-controller.optimistic.test.ts +69 -0
  110. package/src/thread-controller.share.test.ts +60 -5
  111. package/src/thread-controller.switch-cache.test.ts +176 -0
  112. package/src/thread-controller.tree.test.ts +6 -1
  113. package/src/thread-controller.ts +386 -78
  114. package/src/use-annotation-surface.tsx +88 -63
  115. package/src/use-settings-dialog.tsx +14 -3
  116. package/src/use-thread-body-editing.tsx +58 -0
  117. package/src/view-plan.test.ts +56 -6
  118. package/src/view-plan.ts +154 -5
  119. package/src/App.share-choice.test.tsx +0 -105
  120. package/src/components/ManageAccessDialog.stories.tsx +0 -36
  121. package/src/components/ManageAccessDialog.test.tsx +0 -94
  122. package/src/components/ManageAccessDialog.tsx +0 -120
  123. package/src/components/ShareChoiceDialog.stories.tsx +0 -34
  124. package/src/components/ShareChoiceDialog.test.tsx +0 -103
  125. package/src/components/ShareChoiceDialog.tsx +0 -82
  126. package/src/components/ThreadsSidebar.stories.tsx +0 -36
  127. package/src/components/ThreadsSidebar.tsx +0 -71
  128. package/src/components/agent-launcher.stories.tsx +0 -26
  129. package/src/components/agent-launcher.test.tsx +0 -50
  130. package/src/components/agent-launcher.tsx +0 -149
@@ -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(terminalWidth - 6, Math.max(28, body.length + 4));
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={6}
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
- // the end card wears the green border and the solid submit button
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.green],
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 { Button } from "./primitives/Button";
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.green}
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
- <Toolbar>
89
- <Button variant="solid" marginRight={2} onPress={onSubmitRequest} theme={theme}>
90
- {" Submit review "}
91
- </Button>
92
- <Button onPress={onBack} theme={theme}>
93
- {" [ back "}
94
- </Button>
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
  <>