@cueloop/client 0.1.0-alpha.13 → 0.1.0-alpha.14

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 CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@cueloop/client",
3
- "version": "0.1.0-alpha.13",
3
+ "version": "0.1.0-alpha.14",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./src/index.ts"
8
8
  },
9
9
  "dependencies": {
10
- "@cueloop/daemon": "0.1.0-alpha.13",
11
- "@cueloop/extension-api": "0.1.0-alpha.13",
12
- "@cueloop/integration-obsidian": "0.1.0-alpha.13",
13
- "@cueloop/schema": "0.1.0-alpha.13",
10
+ "@cueloop/daemon": "0.1.0-alpha.14",
11
+ "@cueloop/extension-api": "0.1.0-alpha.14",
12
+ "@cueloop/integration-obsidian": "0.1.0-alpha.14",
13
+ "@cueloop/schema": "0.1.0-alpha.14",
14
14
  "@opentui/core": "^0.5.1",
15
15
  "@opentui/keymap": "0.5.1",
16
16
  "@opentui/react": "^0.5.1",
@@ -7,7 +7,6 @@
7
7
  */
8
8
 
9
9
  import React from "react";
10
- import type { MouseEvent, SelectRenderable } from "@opentui/core";
11
10
  import type { VerdictKind } from "@cueloop/schema";
12
11
  import type { Theme } from "../theme";
13
12
  import { useComponentTheme } from "./theme-context";
@@ -36,17 +35,18 @@ export interface ConfirmCardProps {
36
35
  theme?: Theme;
37
36
  }
38
37
 
39
- /** Counts, spacer, 3-row verdict selector, spacer, summary input, spacer, buttons. */
40
- const CONFIRM_CONTENT_ROWS = 9;
38
+ /** Counts, spacer, 1-row verdict selector, spacer, summary input, spacer, buttons. */
39
+ const CONFIRM_CONTENT_ROWS = 7;
41
40
 
42
41
  export function verdictColor(verdict: VerdictKind, tokens: Theme): string {
43
42
  return verdict === "approve" ? tokens.green : verdict === "request_changes" ? tokens.red : tokens.blue;
44
43
  }
45
44
 
46
45
  /**
47
- * The verdict selector over the native select renderable. Selection stays
48
- * controlled by the grammar (←/→ cycle the verdict); clicks map through the
49
- * option row geometry. The selected verdict wears brackets and its color.
46
+ * The verdict selector: one row of pressable words, matching the reading
47
+ * direction of a choice between three peers. Selection stays controlled by
48
+ * the grammar (←/→ cycle the verdict); a click selects directly. The
49
+ * selected verdict wears brackets and its color.
50
50
  */
51
51
  function VerdictSelector({
52
52
  verdict,
@@ -58,36 +58,16 @@ function VerdictSelector({
58
58
  theme?: Theme;
59
59
  }): React.ReactNode {
60
60
  const tokens = useComponentTheme(theme);
61
- const selectedIndex = VERDICTS.indexOf(verdict);
62
- const selectorRef = React.useRef<SelectRenderable | null>(null);
63
- React.useEffect(() => {
64
- selectorRef.current?.setSelectedIndex(selectedIndex);
65
- }, [selectedIndex]);
66
- const onMouseUp = (event: MouseEvent): void => {
67
- const selector = selectorRef.current;
68
- if (!selector) return;
69
- const candidate = VERDICTS[event.y - selector.y];
70
- if (candidate) onSelectVerdict(candidate);
71
- };
72
61
  return (
73
- <select
74
- ref={selectorRef}
75
- options={VERDICTS.map((candidate) => ({
76
- name: candidate === verdict ? `[${VERDICT_LABEL[candidate]}]` : ` ${VERDICT_LABEL[candidate]} `,
77
- description: "",
78
- value: candidate,
79
- }))}
80
- selectedIndex={selectedIndex}
81
- showDescription={false}
82
- showSelectionIndicator={false}
83
- showScrollIndicator={false}
84
- textColor={tokens.textDim}
85
- selectedTextColor={verdictColor(verdict, tokens)}
86
- selectedBackgroundColor={tokens.elevated}
87
- backgroundColor={tokens.elevated}
88
- onMouseUp={onMouseUp}
89
- style={{ height: VERDICTS.length }}
90
- />
62
+ <box style={{ flexDirection: "row", height: 1 }}>
63
+ {VERDICTS.map((candidate) => (
64
+ <box key={candidate} style={{ paddingRight: 1 }} onMouseUp={() => onSelectVerdict(candidate)}>
65
+ <text fg={candidate === verdict ? verdictColor(candidate, tokens) : tokens.textDim}>
66
+ {candidate === verdict ? `[${VERDICT_LABEL[candidate]}]` : ` ${VERDICT_LABEL[candidate]} `}
67
+ </text>
68
+ </box>
69
+ ))}
70
+ </box>
91
71
  );
92
72
  }
93
73
 
@@ -368,9 +368,7 @@ exports[`stories catalog ConfirmCard/ApproveDefault renders, snapshots, and carr
368
368
  "╭─ submit review ─────────────────────╮
369
369
  │ 0 annotations · 0 blocking │
370
370
  │ │
371
- │ Comment │
372
- │ [Approve] │
373
- │ Changes │
371
+ │ Comment [Approve] Changes │
374
372
  │ │
375
373
  │ summary for the agent (optional) │
376
374
  │ │
@@ -379,6 +377,8 @@ exports[`stories catalog ConfirmCard/ApproveDefault renders, snapshots, and carr
379
377
 
380
378
 
381
379
 
380
+
381
+
382
382
  "
383
383
  `;
384
384
 
@@ -386,9 +386,7 @@ exports[`stories catalog ConfirmCard/RequestChanges renders, snapshots, and carr
386
386
  "╭─ submit review ─────────────────────╮
387
387
  │ 3 annotations · 1 blocking │
388
388
  │ │
389
- │ Comment │
390
- │ Approve │
391
- │ [Changes] │
389
+ │ Comment Approve [Changes] │
392
390
  │ │
393
391
  │ Tighten the steps. │
394
392
  │ │
@@ -397,6 +395,8 @@ exports[`stories catalog ConfirmCard/RequestChanges renders, snapshots, and carr
397
395
 
398
396
 
399
397
 
398
+
399
+
400
400
  "
401
401
  `;
402
402
 
@@ -722,12 +722,12 @@ exports[`stories catalog ReviewRail/SubmitConfirmOpen renders, snapshots, and ca
722
722
 
723
723
 
724
724
 
725
+
726
+
725
727
  ╭─ submit review ──────────────╮
726
728
  │ 2 annotations · 0 blocking │
727
729
  │ │
728
- │ Comment │
729
- │ Approve │
730
- │ [Changes] │
730
+ │ Comment Approve [Changes] │
731
731
  │ │
732
732
  │ summary for the agent (option│
733
733
  │ │