pi-odd-worktree 3.12.1 → 3.12.2
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/message-card.js +4 -2
- package/package.json +1 -1
- package/tools/message-card.test.js +28 -0
package/lib/message-card.js
CHANGED
|
@@ -215,7 +215,9 @@ function messageCardHeading(customType, body) {
|
|
|
215
215
|
/**
|
|
216
216
|
* The rows of one message card, for one width, rebuilt on every pass: the heading, the whole
|
|
217
217
|
* body — with no preview budget and no content level in sight — and the closing rule. `floatRows`
|
|
218
|
-
* decides the style once, here, from the host's own setting
|
|
218
|
+
* decides the style once, here, from the host's own setting, and takes the card's identity role so
|
|
219
|
+
* the WHOLE closed box wears it: the top rule alone would leave the sides and the closing rule the
|
|
220
|
+
* theme's plain `border`, a frame that changes colour halfway down the card.
|
|
219
221
|
*/
|
|
220
222
|
function messageCardRows(customType, lines, paint, metrics, width) {
|
|
221
223
|
const body = messageCardBody(lines, customType);
|
|
@@ -227,7 +229,7 @@ function messageCardRows(customType, lines, paint, metrics, width) {
|
|
|
227
229
|
// instruction the agent must read, whatever the conversation's content level says.
|
|
228
230
|
body: cardBodyRows(body, heading.tone, paint, inner, { expanded: true }, metrics),
|
|
229
231
|
bottom: cardBottom(heading.tone, paint, inner, undefined, metrics),
|
|
230
|
-
}));
|
|
232
|
+
}), heading.railRole);
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-odd-worktree",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.2",
|
|
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",
|
|
@@ -504,6 +504,34 @@ test('both cards are informational and wear the accent on the frame and the name
|
|
|
504
504
|
assert.ok(!reminder[0].includes('<warning>'), 'nothing on a reminder card is painted as a warning');
|
|
505
505
|
});
|
|
506
506
|
|
|
507
|
+
test('the whole closed box wears the identity role: the sides and the closing rule too', () => {
|
|
508
|
+
const outcome = registered();
|
|
509
|
+
// The card names ONE role for its box (`accent`, S5), and the substrate paints the box — the top
|
|
510
|
+
// rule, every body row's two sides and the closing rule — in that role. Only the top rule wearing
|
|
511
|
+
// it leaves the frame brighter at the heading and dimmer around the body, which reads as a colour
|
|
512
|
+
// that stops halfway down the card.
|
|
513
|
+
const budget = designFor(outcome, EXPLORATION).apply(plainBody(EXPLORATION, STARTED), { width: 70, customType: EXPLORATION, theme: taggedTheme, render: { expanded: false, outputPad: 1, message: {} } });
|
|
514
|
+
assert.ok(budget.length >= 4, 'a heading, at least one body row and the closing rule');
|
|
515
|
+
for (const row of budget) {
|
|
516
|
+
assert.ok(!row.includes('<border>'), `no cell of the frame falls back to the plain border: ${row}`);
|
|
517
|
+
}
|
|
518
|
+
assert.ok(budget[0].includes('<accent>╭'), budget[0]);
|
|
519
|
+
assert.ok(budget[0].includes('<accent>╮'), budget[0]);
|
|
520
|
+
for (const row of budget.slice(1, -1)) {
|
|
521
|
+
assert.ok(row.startsWith('<accent>│</accent>'), `the left side wears the identity role: ${row}`);
|
|
522
|
+
assert.ok(row.endsWith('<accent>│</accent>'), `the right side wears the identity role: ${row}`);
|
|
523
|
+
}
|
|
524
|
+
assert.ok(budget[budget.length - 1].startsWith('<accent>╰'), 'the closing rule wears the identity role');
|
|
525
|
+
assert.ok(budget[budget.length - 1].endsWith('╯</accent>'), budget[budget.length - 1]);
|
|
526
|
+
// The same rule in float, where the box is two rails and no corner: nothing may fall back either.
|
|
527
|
+
globalThis[CARD_STYLE_SLOT] = CARD_STYLE.FLOAT;
|
|
528
|
+
const float = designFor(outcome, VERIFIER).apply(plainBody(VERIFIER, VERIFIER_TEXT), { width: 70, customType: VERIFIER, theme: { fg: taggedTheme.fg, bg: bandTheme.bg }, render: { expanded: false, outputPad: 1, message: {} } });
|
|
529
|
+
for (const row of float) assert.ok(!row.includes('<border>'), `no float rail falls back to the plain border: ${row}`);
|
|
530
|
+
assert.ok(float[0].includes('<accent>▎'), 'the float heading band wears the identity role');
|
|
531
|
+
assert.ok(float[float.length - 1].includes('<accent>▎'), 'so does the closing row');
|
|
532
|
+
assert.ok(!float.join('\n').includes('<warning>'), 'a reminder is still no warning');
|
|
533
|
+
});
|
|
534
|
+
|
|
507
535
|
test('every row fits the width the host asked for, at narrow and wide terminals, in both styles', () => {
|
|
508
536
|
const outcome = registered();
|
|
509
537
|
for (const style of [CARD_STYLE.NEON, CARD_STYLE.FLOAT]) {
|