@opencode-cockpit/shell 0.2.2 → 0.3.1

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.
@@ -5,25 +5,45 @@ import { setProp as _$setProp } from "@opentui/solid";
5
5
  import { createElement as _$createElement } from "@opentui/solid";
6
6
  /** @jsxImportSource @opentui/solid */
7
7
 
8
- import { badgeText, kindColor, kindOf } from "../lib/view.js";
8
+ import { BADGE_RULE, badgeText, kindColor, kindOf } from "../lib/view.js";
9
9
 
10
- /** Status pill: label on a coloured background, readable in any font and colour scheme. */
10
+ /**
11
+ * Status mark: a coloured rule and its label.
12
+ *
13
+ * Not a filled pill. A block of colour has to be as wide as the word inside it, and a list of
14
+ * them reads as a wall of colour rather than as a list of shells; the rule carries the same
15
+ * meaning in one column.
16
+ */
11
17
  export function Badge(props) {
12
18
  const theme = () => props.api.theme.current;
13
19
  const kind = () => kindOf(props.shell);
20
+ const colour = () => kindColor(theme(), kind());
14
21
  return (() => {
15
22
  var _el$ = _$createElement("text"),
16
23
  _el$2 = _$createElement("span"),
17
- _el$3 = _$createElement("b");
24
+ _el$3 = _$createElement("span"),
25
+ _el$4 = _$createElement("b");
18
26
  _$insertNode(_el$, _el$2);
27
+ _$insertNode(_el$, _el$3);
19
28
  _$setProp(_el$, "flexShrink", 0);
20
29
  _$setProp(_el$, "wrapMode", "none");
21
- _$insertNode(_el$2, _el$3);
22
- _$insert(_el$3, () => badgeText(kind(), props.frame));
23
- _$effect(_$p => _$setProp(_el$2, "style", {
24
- fg: theme().background,
25
- bg: kindColor(theme(), kind())
26
- }, _$p));
30
+ _$insert(_el$2, BADGE_RULE);
31
+ _$insertNode(_el$3, _el$4);
32
+ _$insert(_el$4, () => badgeText(kind(), props.frame).slice(BADGE_RULE.length));
33
+ _$effect(_p$ => {
34
+ var _v$ = {
35
+ fg: colour()
36
+ },
37
+ _v$2 = {
38
+ fg: colour()
39
+ };
40
+ _v$ !== _p$.e && (_p$.e = _$setProp(_el$2, "style", _v$, _p$.e));
41
+ _v$2 !== _p$.t && (_p$.t = _$setProp(_el$3, "style", _v$2, _p$.t));
42
+ return _p$;
43
+ }, {
44
+ e: undefined,
45
+ t: undefined
46
+ });
27
47
  return _el$;
28
48
  })();
29
49
  }
@@ -39,6 +39,7 @@ export function SidebarShells(props) {
39
39
  _$insertNode(_el$2, _el$3);
40
40
  _$insertNode(_el$2, _el$5);
41
41
  _$setProp(_el$2, "wrapMode", "none");
42
+ _$setProp(_el$2, "marginBottom", 1);
42
43
  _$insertNode(_el$3, _$createTextNode(`Shells`));
43
44
  _$insertNode(_el$5, _el$6);
44
45
  _$insert(_el$5, counts, null);
@@ -30,11 +30,20 @@ export function kindColor(theme, kind) {
30
30
  }
31
31
  }
32
32
 
33
- /** Fixed 7-column pill so lists line up: " ⠹ RUN ", " FAIL ". */
33
+ /**
34
+ * The status mark: a coloured rule and its label, in a fixed 7 columns so lists line up.
35
+ *
36
+ * It used to be a filled pill. Filled blocks have to be as wide as their text, so a column of
37
+ * them stacks into a wall of colour that competes with the shell names beside it; a rule carries
38
+ * the same colour in one column and lets the list breathe.
39
+ */
34
40
  export function badgeText(kind, frame = 0) {
35
- if (kind === "run") return ` ${SPINNER[frame % SPINNER.length]} RUN `;
36
- return ` ${BADGE_LABEL[kind].padEnd(4)} `;
41
+ if (kind === "run") return `▌ ${SPINNER[frame % SPINNER.length]} RUN`;
42
+ return `▌ ${BADGE_LABEL[kind].padEnd(5)}`;
37
43
  }
44
+
45
+ /** The rule itself, so it can be coloured apart from the label it marks. */
46
+ export const BADGE_RULE = "▌";
38
47
  const RANK = {
39
48
  run: 0,
40
49
  fail: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode-cockpit/shell",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "Background shells for OpenCode: the agent starts, waits on and drives PTYs; you watch them in a docked TUI panel",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,9 +51,9 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@opencode-cockpit/client": "0.2.2",
55
- "@opencode-cockpit/daemon": "0.2.2",
56
- "@opencode-cockpit/protocol": "0.2.2",
54
+ "@opencode-cockpit/client": "0.3.1",
55
+ "@opencode-cockpit/daemon": "0.3.1",
56
+ "@opencode-cockpit/protocol": "0.3.1",
57
57
  "@opencode-ai/plugin": "1.18.31"
58
58
  },
59
59
  "devDependencies": {
@@ -1,7 +1,13 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
2
  import type { TuiPluginApi } from "@opencode-ai/plugin/tui";
3
3
  import type { ShellInfo } from "@opencode-cockpit/protocol/shell";
4
- /** Status pill: label on a coloured background, readable in any font and colour scheme. */
4
+ /**
5
+ * Status mark: a coloured rule and its label.
6
+ *
7
+ * Not a filled pill. A block of colour has to be as wide as the word inside it, and a list of
8
+ * them reads as a wall of colour rather than as a list of shells; the rule carries the same
9
+ * meaning in one column.
10
+ */
5
11
  export declare function Badge(props: {
6
12
  api: TuiPluginApi;
7
13
  shell: ShellInfo;
@@ -7,8 +7,16 @@ export declare const BADGE_LABEL: Record<Kind, string>;
7
7
  /** Braille spinner: single-width in every terminal font. */
8
8
  export declare const SPINNER: string[];
9
9
  export declare function kindColor(theme: TuiThemeCurrent, kind: Kind): import("@opentui/core").RGBA;
10
- /** Fixed 7-column pill so lists line up: " ⠹ RUN ", " FAIL ". */
10
+ /**
11
+ * The status mark: a coloured rule and its label, in a fixed 7 columns so lists line up.
12
+ *
13
+ * It used to be a filled pill. Filled blocks have to be as wide as their text, so a column of
14
+ * them stacks into a wall of colour that competes with the shell names beside it; a rule carries
15
+ * the same colour in one column and lets the list breathe.
16
+ */
11
17
  export declare function badgeText(kind: Kind, frame?: number): string;
18
+ /** The rule itself, so it can be coloured apart from the label it marks. */
19
+ export declare const BADGE_RULE = "\u258C";
12
20
  /** Running first (oldest first, stable tabs), then failures, stopped, done (most recent first). */
13
21
  export declare function order(list: readonly ShellInfo[]): ShellInfo[];
14
22
  export interface PartitionOptions {