@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.
Files changed (101) hide show
  1. package/package.json +27 -26
  2. package/src/App.autoclose.test.tsx +7 -4
  3. package/src/App.diff.test.tsx +131 -5
  4. package/src/App.export.test.tsx +23 -5
  5. package/src/App.plan-review.test.tsx +133 -32
  6. package/src/App.readonly.test.tsx +35 -13
  7. package/src/App.rendering.test.tsx +14 -4
  8. package/src/App.review-panel.test.tsx +27 -15
  9. package/src/App.submit-confirm.test.tsx +14 -13
  10. package/src/App.test.tsx +50 -13
  11. package/src/App.toast.test.tsx +75 -0
  12. package/src/App.tsx +505 -101
  13. package/src/App.walk.test.tsx +31 -11
  14. package/src/attribution.ts +8 -2
  15. package/src/clipboard.ts +5 -1
  16. package/src/components/AnnotationCard.stories.tsx +29 -10
  17. package/src/components/AnnotationCard.tsx +57 -37
  18. package/src/components/Breadcrumb.tsx +7 -1
  19. package/src/components/CodeBlock.stories.tsx +19 -2
  20. package/src/components/CodeBlock.tsx +24 -9
  21. package/src/components/CompletionOverlay.tsx +13 -3
  22. package/src/components/ConfirmCard.stories.tsx +22 -3
  23. package/src/components/ConfirmCard.tsx +23 -5
  24. package/src/components/ConfirmDialog.tsx +10 -2
  25. package/src/components/DiffSheet.scroll.test.tsx +123 -0
  26. package/src/components/DiffSheet.stories.tsx +35 -1
  27. package/src/components/DiffSheet.syntax.test.tsx +62 -0
  28. package/src/components/DiffSheet.tsx +213 -101
  29. package/src/components/InboxList.stories.tsx +16 -3
  30. package/src/components/InboxList.tsx +17 -10
  31. package/src/components/KeybindsDialog.stories.tsx +31 -0
  32. package/src/components/KeybindsDialog.tsx +58 -0
  33. package/src/components/MarkerPopover.stories.tsx +58 -0
  34. package/src/components/MarkerPopover.tsx +102 -0
  35. package/src/components/MenuBar.stories.tsx +37 -0
  36. package/src/components/MenuBar.tsx +74 -0
  37. package/src/components/PlanSheet.stories.tsx +35 -3
  38. package/src/components/PlanSheet.tsx +160 -100
  39. package/src/components/PromptDialog.tsx +19 -3
  40. package/src/components/ReviewPanel.stories.tsx +17 -19
  41. package/src/components/ReviewPanel.tsx +17 -32
  42. package/src/components/ReviewRail.stories.tsx +159 -47
  43. package/src/components/ReviewRail.tsx +206 -62
  44. package/src/components/SettingsDialog.stories.tsx +51 -3
  45. package/src/components/SettingsDialog.tsx +11 -5
  46. package/src/components/SettingsRows.stories.tsx +1 -1
  47. package/src/components/SettingsRows.tsx +19 -3
  48. package/src/components/Toast.stories.tsx +12 -0
  49. package/src/components/Toast.tsx +44 -0
  50. package/src/components/WalkWizard.stories.tsx +13 -2
  51. package/src/components/WalkWizard.tsx +9 -3
  52. package/src/components/__snapshots__/stories.test.tsx.snap +853 -623
  53. package/src/components/diff-sheet-layout.test.ts +127 -0
  54. package/src/components/diff-sheet-layout.ts +167 -0
  55. package/src/components/primitives/Button.stories.tsx +2 -2
  56. package/src/components/primitives/Button.tsx +5 -1
  57. package/src/components/primitives/Dialog.tsx +12 -1
  58. package/src/components/primitives/Tabs.tsx +40 -39
  59. package/src/components/stories-app.tsx +34 -6
  60. package/src/components/story-fixtures.ts +11 -3
  61. package/src/components/story.ts +3 -1
  62. package/src/components/syntax-highlight.ts +47 -12
  63. package/src/components/theme-context.stories.tsx +6 -1
  64. package/src/components/theme-context.tsx +7 -1
  65. package/src/config.test.ts +178 -2
  66. package/src/config.ts +121 -23
  67. package/src/diff-hunk-curate.test.ts +315 -0
  68. package/src/diff-hunk-curate.ts +233 -0
  69. package/src/diff-intraline.test.ts +164 -0
  70. package/src/diff-intraline.ts +132 -0
  71. package/src/diff-syntax.test.ts +96 -0
  72. package/src/diff-syntax.ts +154 -0
  73. package/src/editor.test.ts +13 -4
  74. package/src/editor.ts +31 -5
  75. package/src/herdr.ts +8 -2
  76. package/src/index.ts +9 -1
  77. package/src/integrations.ts +3 -1
  78. package/src/intent-dispatch.test.ts +193 -9
  79. package/src/intent-dispatch.ts +151 -18
  80. package/src/key-bindings.test.ts +19 -9
  81. package/src/key-bindings.ts +77 -16
  82. package/src/keymap.test.ts +171 -26
  83. package/src/keymap.ts +83 -16
  84. package/src/review-panel.test.ts +3 -1
  85. package/src/review-panel.ts +9 -2
  86. package/src/serve.test.ts +13 -5
  87. package/src/session-controller.curate.test.ts +253 -0
  88. package/src/session-controller.share.test.ts +77 -16
  89. package/src/session-controller.ts +319 -26
  90. package/src/share.ts +41 -8
  91. package/src/test-support.ts +97 -23
  92. package/src/theme-presets.ts +168 -0
  93. package/src/theme.ts +1 -3
  94. package/src/version.ts +5 -0
  95. package/src/view-diff.ts +15 -4
  96. package/src/view-plan.test.ts +40 -6
  97. package/src/view-plan.ts +71 -28
  98. package/src/walk.test.ts +7 -2
  99. package/src/walk.ts +7 -2
  100. package/src/components/ComposeBar.stories.tsx +0 -18
  101. 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 = categories.find((candidate) => candidate.id === activeCategoryId) ?? categories[0];
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={{ backgroundColor: isActive && activeZone === "nav" ? tokens.elevated : undefined }}
72
+ style={{
73
+ backgroundColor: isActive && activeZone === "nav" ? tokens.border : undefined,
74
+ }}
71
75
  onMouseUp={() => onCategorySelect(candidate.id)}
72
76
  >
73
- <text fg={isActive ? tokens.accent : tokens.textMuted}>{`${isActive ? "› " : " "}${candidate.name}`}</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, backgroundColor: tokens.elevated, paddingLeft: 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/⏎ into settings · esc close"
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.elevated],
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={{ flexDirection: "row", height: 1, backgroundColor: isActive ? tokens.elevated : undefined }}
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({ label, value, isActive, onPress, theme }: ToggleRowProps): React.ReactNode {
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({ label, value, isActive, onPress, theme }: CycleRowProps): React.ReactNode {
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
- { path: "packages/schema/src/types.ts", added: 3, removed: 0, preview: [{ sign: "+", text: "viewedPaths?: string[];" }] },
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: [DARK.accent, DARK.green, DARK.red, DARK.insertedForeground, DARK.deletedForeground],
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}>{" "}</span>
109
+ <span fg={tokens.textDim}> </span>
110
110
  <span fg={tokens.red}>{`-${currentFile.removed}`}</span>
111
- <span fg={tokens.textDim}>{viewedPaths.has(currentFile.path) ? " · viewed" : ""}</span>
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={previewLine.sign === "+" ? tokens.insertedForeground : tokens.deletedForeground}
123
+ fg={
124
+ previewLine.sign === "+"
125
+ ? tokens.insertedForeground
126
+ : tokens.deletedForeground
127
+ }
122
128
  >
123
129
  {previewLine.sign + previewLine.text}
124
130
  </text>