pi-odd-worktree 3.7.0 → 3.7.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.
package/lib/jobs-card.js CHANGED
@@ -43,14 +43,17 @@ const { cardText } = require('./codegraph-card-preview.js');
43
43
  /** The four tools this card owns, in the order the bridge's `Card tags` line declares them. */
44
44
  const JOB_TOOLS = Object.freeze(['bash_background', 'monitor', 'job_stop', 'job_list']);
45
45
 
46
- // Each tool's mark, its label and the theme role the heading wears. The two job tools share one
47
- // mark and one role, so a `monitor` and a `bash_background` read as the same family the report
48
- // card states, while their words say which TOOL ran what the report is about.
46
+ // Each tool's mark, its label, the theme role the heading wears and the role the call's own text
47
+ // wears. The two job tools share one mark and one role, so a `monitor` and a `bash_background` read
48
+ // as the same family the report card states, while their words say which TOOL ran what the report is
49
+ // about. `subtitleRole` is the INPUT the call carries — its label, its command, its job id — which is
50
+ // muted on the two bash tools so the role colour stays on the frame and the name, and stays `accent`
51
+ // on the two the human did not ask to change.
49
52
  const IDENTITY = Object.freeze({
50
- bash_background: { glyph: '⧗', title: 'bash background', titleRole: 'bashMode' },
51
- monitor: { glyph: '⧗', title: 'bash monitor', titleRole: 'bashMode' },
52
- job_stop: { glyph: '■', title: 'stop', titleRole: 'warning' },
53
- job_list: { glyph: '≡', title: 'jobs', titleRole: 'syntaxFunction' },
53
+ bash_background: { glyph: '⧗', title: 'bash background', titleRole: 'bashMode', subtitleRole: 'muted' },
54
+ monitor: { glyph: '⧗', title: 'bash monitor', titleRole: 'bashMode', subtitleRole: 'muted' },
55
+ job_stop: { glyph: '■', title: 'stop', titleRole: 'warning', subtitleRole: 'accent' },
56
+ job_list: { glyph: '≡', title: 'jobs', titleRole: 'syntaxFunction', subtitleRole: 'accent' },
54
57
  });
55
58
 
56
59
  const SUBTITLE_ROLE = 'accent';
@@ -97,7 +100,7 @@ function jobCardHeading(tool, args) {
97
100
  subtitle,
98
101
  collapsed: subtitle,
99
102
  labelBold: true,
100
- subtitleSegments: [{ text: subtitle, role: SUBTITLE_ROLE }],
103
+ subtitleSegments: [{ text: subtitle, role: identity.subtitleRole ?? SUBTITLE_ROLE }],
101
104
  };
102
105
  }
103
106
 
@@ -94,14 +94,16 @@ const MIN_PAINT_WIDTH = 6;
94
94
  // The attribution name every bridge surface of this package registers under (`lib/bash-design.js`).
95
95
  const PLUGIN_NAME = 'Odd worktree';
96
96
 
97
- // Each card's mark, title, tone, registration id and the label the bridge asks every registration
98
- // for. The label is not shown: a following design contributes no value to the customize menu, and
99
- // neither `default` nor `native` may be used as one. The id is identity, never shown either.
97
+ // Each card's mark, title, tone, the theme role its frame and name wear, registration id and the
98
+ // label the bridge asks every registration for. The label is not shown: a following design
99
+ // contributes no value to the customize menu, and neither `default` nor `native` may be used as one.
100
+ // The id is identity, never shown either.
100
101
  const IDENTITY = Object.freeze({
101
102
  [EXPLORATION_TYPE]: {
102
103
  glyph: '⌕',
103
104
  title: 'Exploration budget',
104
105
  tone: CARD_TONE.INFO,
106
+ titleRole: 'accent',
105
107
  id: 'odd-worktree.exploration-budget-card',
106
108
  label: 'card',
107
109
  description: 'draws the exploration budget alert as a card, in the style the shell has chosen',
@@ -109,7 +111,11 @@ const IDENTITY = Object.freeze({
109
111
  [VERIFIER_TYPE]: {
110
112
  glyph: '⚑',
111
113
  title: 'Verifier reminder',
112
- tone: CARD_TONE.WARNING,
114
+ // A REMINDER, not an alert: nothing failed and nothing is running, so the card is
115
+ // informational and wears the theme's accent like the budget card — not the amber that a
116
+ // warning tone owns the WHOLE box with (`TONE_OWNS_BOX`), which would override the identity role.
117
+ tone: CARD_TONE.INFO,
118
+ titleRole: 'accent',
113
119
  id: 'odd-worktree.verifier-settle-reminder-card',
114
120
  label: 'card',
115
121
  description: 'draws the verifier reminder as a card, in the style the shell has chosen',
@@ -192,6 +198,11 @@ function messageCardHeading(customType, body) {
192
198
  glyph: identity.glyph,
193
199
  title: identity.title,
194
200
  tone: identity.tone,
201
+ // The mark, the name AND the closed box wear one theme role, exactly as the job cards do: an
202
+ // informational card would otherwise keep the theme's plain `border` frame and read as if it had
203
+ // no role at all. The detail stays the substrate's muted subtitle, and the body stays `text`.
204
+ titleRole: identity.titleRole,
205
+ railRole: identity.titleRole,
195
206
  // The label is bolded inside the card's own role, exactly as the file and job cards do.
196
207
  labelBold: true,
197
208
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-odd-worktree",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Pi package for odd-worktree: the Git worktree tools a Pi session uses (create and list the checkouts the agent works in), the /warp worktree panel, the /odd ODD viewer, and the /issues GitHub issue reader. Needs only Pi and git: no companion app, no extra service.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -193,6 +193,18 @@ test('both job tools wear one mark and one role, so a monitor reads as a backgro
193
193
  assert.match(unpaint(monitor), /⧗ bash monitor ·/u);
194
194
  });
195
195
 
196
+ test('the two bash tools keep the role on the frame and the name, and mute the input text', () => {
197
+ publishBridge(ACTIVITY);
198
+ const resolver = jobsResolver();
199
+ const background = callRows(resolver, 'bash_background', { command: COMMAND, label: LABEL }, taggedTheme)[0];
200
+ const monitor = callRows(resolver, 'monitor', { command: COMMAND, label: LABEL, timeout_seconds: 60 }, taggedTheme)[0];
201
+ for (const row of [background, monitor]) {
202
+ assert.ok(row.includes('<bashMode>'), 'the frame and the mark keep the identity role');
203
+ assert.ok(row.includes('<muted>'), 'the input text — the label — is muted');
204
+ assert.ok(!row.includes('<accent>'), 'and it is not the accent the other two tools keep');
205
+ }
206
+ });
207
+
196
208
  test('expanded, the whole command is stated below the heading, every line of it', () => {
197
209
  publishBridge(ACTIVITY);
198
210
  const rows = callRows(jobsResolver(), 'bash_background', { command: 'sleep 20\n\ngh run list --repo acme/api', label: LABEL }, plainTheme, 70, { isPartial: false, expanded: true }).map(unpaint);
@@ -457,16 +457,20 @@ test('a mid-session flip repaints a card already on screen, in both directions',
457
457
 
458
458
  // ---- the palette (S5) ----
459
459
 
460
- test('each card wears its own tone: info for the budget, warning for the reminder', () => {
460
+ test('both cards are informational and wear the accent on the frame and the name', () => {
461
461
  const outcome = registered();
462
462
  const budget = designFor(outcome, EXPLORATION).apply(plainBody(EXPLORATION, STARTED), { width: 70, customType: EXPLORATION, theme: taggedTheme, render: { expanded: false, outputPad: 1, message: {} } });
463
- // INFO: the rounded frame keeps the theme's plain border role while the name carries the accent.
463
+ // Both cards name ONE theme role for the frame and the name, so an informational card is never the
464
+ // theme's plain border with no colour of its own: `accent` for the budget.
464
465
  assert.ok(budget[0].includes('<accent>⌕</accent>'), budget[0]);
465
- assert.ok(budget[0].includes('<border>╭'), 'the frame keeps the plain border role');
466
+ assert.ok(budget[0].includes('<accent>╭'), 'the frame wears the identity role, not the plain border');
467
+ assert.ok(budget[0].includes('<muted>'), 'the detail stays the muted subtitle');
466
468
  const reminder = designFor(outcome, VERIFIER).apply(plainBody(VERIFIER, VERIFIER_TEXT), { width: 70, customType: VERIFIER, theme: taggedTheme, render: { expanded: false, outputPad: 1, message: {} } });
467
- // WARNING owns the box: frame and name both carry the warning role.
468
- assert.ok(reminder[0].includes('<warning>⚑</warning>'), reminder[0]);
469
- assert.ok(reminder[0].includes('<warning>╭'), 'the frame carries the tone');
469
+ // A reminder is not an alert: it wears the same accent, never the amber a warning tone owns the
470
+ // whole box with.
471
+ assert.ok(reminder[0].includes('<accent>⚑</accent>'), reminder[0]);
472
+ assert.ok(reminder[0].includes('<accent>╭'), 'the frame wears the identity role');
473
+ assert.ok(!reminder[0].includes('<warning>'), 'nothing on a reminder card is painted as a warning');
470
474
  });
471
475
 
472
476
  test('every row fits the width the host asked for, at narrow and wide terminals, in both styles', () => {