@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
package/src/walk.ts CHANGED
@@ -35,7 +35,10 @@ export function walkFiles(rows: DiffRow[]): WalkFile[] {
35
35
  if (row.kind === "add") file.added += 1;
36
36
  else file.removed += 1;
37
37
  if (file.preview.length < WALK_PREVIEW_ROWS) {
38
- file.preview.push({ sign: row.kind === "add" ? "+" : "-", text: row.text.replace(/\n$/, "") });
38
+ file.preview.push({
39
+ sign: row.kind === "add" ? "+" : "-",
40
+ text: row.text.replace(/\n$/, ""),
41
+ });
39
42
  }
40
43
  }
41
44
  return files;
@@ -61,5 +64,7 @@ export function viewedCount(files: WalkFile[], viewedPaths: ReadonlySet<string>)
61
64
  * quote is the file path (the note contract in the shared review core).
62
65
  */
63
66
  export function noteForFile(annotations: Annotation[], path: string): string | undefined {
64
- return annotations.find((annotation) => annotation.kind === "note" && annotation.anchor.quote === path)?.body;
67
+ return annotations.find(
68
+ (annotation) => annotation.kind === "note" && annotation.anchor.quote === path,
69
+ )?.body;
65
70
  }
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import { DARK } from "../theme";
3
- import type { Story, StoryMeta } from "./story";
4
- import { ComposeBar } from "./ComposeBar";
5
-
6
- export const meta: StoryMeta = { title: "ComposeBar" };
7
-
8
- export const CommentOnLine: Story = {
9
- render: () => (
10
- <ComposeBar kind="comment" quote=" private items = new Map();" text="Map needs an eviction story." onInput={() => {}} />
11
- ),
12
- expectedColors: [DARK.accent, DARK.elevated],
13
- };
14
-
15
- export const SuggestionOnLine: Story = {
16
- render: () => <ComposeBar kind="suggestion" quote="export class Store {" text="" onInput={() => {}} />,
17
- expectedColors: [DARK.green],
18
- };
@@ -1,54 +0,0 @@
1
- /**
2
- * Bottom compose bar - the diff view composes annotation bodies here. The
3
- * editor is the same multiline textarea contract as the inline composer:
4
- * ⏎ saves through the grammar, shift+⏎ adds a line.
5
- */
6
-
7
- import React, { useRef } from "react";
8
- import type { KeyBinding, TextareaRenderable } from "@opentui/core";
9
- import type { Theme } from "../theme";
10
- import { useComponentTheme } from "./theme-context";
11
- import { truncateToSingleLine } from "./truncate-text";
12
-
13
- export interface ComposeBarProps {
14
- kind: "comment" | "suggestion";
15
- quote: string;
16
- text: string;
17
- onInput: (text: string) => void;
18
- theme?: Theme;
19
- }
20
-
21
- const COMPOSE_KEY_BINDINGS: KeyBinding[] = [
22
- { name: "return", action: "submit" },
23
- { name: "return", shift: true, action: "newline" },
24
- ];
25
-
26
- export function ComposeBar({ kind, quote, text, onInput, theme }: ComposeBarProps): React.ReactNode {
27
- const tokens = useComponentTheme(theme);
28
- const editorRef = useRef<TextareaRenderable | null>(null);
29
- const editorRows = Math.min(4, Math.max(1, text.split("\n").length));
30
- return (
31
- <box style={{ height: 1 + editorRows, backgroundColor: tokens.elevated, flexDirection: "column", paddingLeft: 1 }}>
32
- <text fg={kind === "suggestion" ? tokens.green : tokens.accent}>
33
- {kind === "suggestion" ? "SUGGEST REPLACEMENT FOR" : "COMMENT ON"} “{truncateToSingleLine(quote, 60)}” · ⏎ save · esc cancel
34
- </text>
35
- <textarea
36
- ref={editorRef}
37
- focused
38
- initialValue=""
39
- keyBindings={COMPOSE_KEY_BINDINGS}
40
- onContentChange={() => {
41
- const editor = editorRef.current;
42
- if (editor) onInput(editor.plainText);
43
- }}
44
- style={{
45
- height: editorRows,
46
- backgroundColor: tokens.elevated,
47
- focusedBackgroundColor: tokens.elevated,
48
- textColor: tokens.text,
49
- focusedTextColor: tokens.text,
50
- }}
51
- />
52
- </box>
53
- );
54
- }