Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
feat(view): a finished action's output steps aside [N27]
Corey Olsond50e3b1a6b4c
diff --git a/src/cockpit.js b/src/cockpit.jsindex 94eb9ce4..faeceb7e 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -767,8 +767,13 @@ function search() {render();}+/**+ * Run an action as its CLI command on the server, show what the command said, and redraw from the+ * board. A new action cancels the last one's pending close, so it can never hide this one's output.+ */async function act(command, args, root = view.root) {const out = $('console');+ clearTimeout(view.closing);out.hidden = false;out.className = 'console';out.textContent = 'running…';@@ -776,6 +781,8 @@ async function act(command, args, root = view.root) {const result = await api('/api/act', { root, command, args });out.className = 'console ' + (result.code === 0 ? 'ok' : 'no');out.textContent = '$ ' + result.command + '\\n' + (result.out + result.err).trim();+ // What went through says so and then steps aside; a refusal stays until the person closes it.+ if (result.code === 0) view.closing = setTimeout(() => { out.hidden = true; }, 6000);await refresh();return result.code === 0;} catch (error) {diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex c5017c73..48225396 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -1237,3 +1237,36 @@ test('needs-you lines keep their titles on a phone [N26]', async () => {await view.stop();}});++test("a finished action's output steps aside [N27]", async () => {+ const box = machine();+ project(box, 'alpha');+ const view = await startView(box);+ try {+ const page = await openPage(view);+ // The page's timers, held by the test: each pending close is recorded and fired at will.+ page.run('globalThis.closes = []; globalThis.setTimeout = (run, ms) => closes.push({ run, ms, live: true }); globalThis.clearTimeout = (id) => { if (closes[id - 1]) closes[id - 1].live = false; };');+ const pending = () => JSON.parse(page.run('JSON.stringify(closes.map((close) => [close.ms, close.live]))'));+ const out = page.element('console');+ const shout = async (to, text) => {+ page.element('shout-to').value = to;+ page.element('shout-text').value = text;+ await page.fire('shout-form', 'submit');+ };++ await shout('web', 'hello');+ assert.match(out.textContent, /^\$ pullboard shout web hello\n/);+ assert.deepEqual([out.className, out.hidden], ['console ok', false]);+ assert.deepEqual(pending(), [[6000, true]], 'a close six seconds on');+ page.run('closes[0].run()');+ assert.equal(out.hidden, true, 'and then the output steps aside');++ await shout('web', 'again');+ await shout('nobody-here', 'is anyone there');+ assert.match(out.textContent, /NO_READER/);+ assert.deepEqual([out.className, out.hidden], ['console no', false]);+ assert.deepEqual(pending().slice(1), [[6000, false]], 'the refusal cancelled the close the shout before it left, and set none');+ } finally {+ await view.stop();+ }+});