repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

fix(the-system): avoid repeated board proposal details

22f1e049d9a246f085482db85b239b0c499276af

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

Changed files (2)

extensions/the-system/__tests__/board-runtime.test.ts

Modified
82 82 const expandedResult = render(expandedResultComponent);
83 83 assert.equal(expandedResultComponent, collapsedResultComponent);
84 - assert.match(collapsedResult, /^✓ 2 changes proposed/);
85 - assert.match(collapsedResult, /to expand/);
86 - assert.doesNotMatch(collapsedResult, /PX-SPEC-SPEC0001/);
87 - assert.match(expandedResult, /TODO PX-SPEC-SPEC0001/);
88 - assert.match(expandedResult, /Regression coverage proves closure/);
84 + assert.equal(collapsedResult.trimEnd(), "✓ 2 changes proposed");
85 + assert.equal(expandedResult.trimEnd(), "✓ 2 changes proposed");
90 87 const empty = render(
91 88 tool.renderResult(

extensions/the-system/board-runtime.ts

Modified
61 61 text.setText(output);
62 62 return text;
64 - renderResult(result, { expanded }, theme, context) {
64 + renderResult(result, _options, theme, context) {
65 65 const text =
66 66 (context.lastComponent as Text | undefined) ?? new Text("", 0, 0);
67 67 const items = (result.details as { items?: BoardProposal[] } | undefined)
78 78 return text;
80 80 const count = items.length;
81 - let output = theme.fg(
82 - "success",
83 - count === 0
84 - ? "✓ no changes proposed"
85 - : `✓ ${count} change${count === 1 ? "" : "s"} proposed`,
81 + text.setText(
82 + theme.fg(
83 + "success",
84 + count === 0
85 + ? "✓ no changes proposed"
86 + : `✓ ${count} change${count === 1 ? "" : "s"} proposed`,
87 + ),
87 - if (!expanded && count > 0) {
88 - output += theme.fg(
89 - "dim",
90 - ` (${keyHint("app.tools.expand", "to expand")})`,
91 - );
92 - } else if (expanded) {
93 - for (const item of items)
94 - output += `\n${theme.fg("accent", item.state.toUpperCase())} ${theme.fg("toolOutput", item.id)}\n${theme.fg("dim", item.rationale)}`;
95 - }
96 - text.setText(output);
97 89 return text;
99 91 async execute(_toolCallId, params, _signal, _onUpdate, ctx) {