From eda319e16a4b94e323c793dddad00c7f3265fae5 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 23 Nov 2026 13:27:12 -0500 Subject: [PATCH 1/2] Executions list: show what a command ran and on which worker (#15) Every command execution was listed as "[Quick Command]". The list API now returns, for command executions, the first command (up to 120 characters) and the worker's name (from the first log entry, joined to workers), and the row shows them as `command @ worker`. Workflows keep their name. Co-Authored-By: Claude Opus 5.5 --- public/assets/pages/executions.css | 12 ++++++++++++ public/assets/pages/executions.js | 9 ++++++++- server.js | 6 +++++- tests/integration/gandalf.int.js | 8 ++++++++ tests/ui/quick-command.ui.js | 4 ++++ 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/public/assets/pages/executions.css b/public/assets/pages/executions.css index 3164a9e..66ea746 100644 --- a/public/assets/pages/executions.css +++ b/public/assets/pages/executions.css @@ -250,3 +250,15 @@ html[data-theme="light"] .ex-cmp-head { background: var(--bg-secondary); } html[data-theme="light"] .ex-log-title { color: var(--text-primary); } html[data-theme="light"] .ex-diff-same { color: var(--text-muted); } html[data-theme="light"] .ex-row.is-selected td { background: rgba(255, 179, 0, 0.18); } + +/* Command executions in the list: `command @ worker` (#15). */ +.ex-row-cmd { + display: inline-block; + max-width: 32rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: bottom; + color: var(--text-primary, inherit); +} +.ex-row-worker { color: var(--text-muted, inherit); white-space: nowrap; } diff --git a/public/assets/pages/executions.js b/public/assets/pages/executions.js index 87892a2..3ad229e 100644 --- a/public/assets/pages/executions.js +++ b/public/assets/pages/executions.js @@ -128,6 +128,13 @@ return '(' + st.total + ')'; } + // Workflows by name; commands as `command @ worker` instead of "[Quick Command]" (#15). + function nameCell(e) { + if (e.workflow_name || !e.command) return '' + esc(execName(e)) + ''; + return '' + esc(e.command) + '' + + (e.worker_name ? ' @ ' + esc(e.worker_name) + '' : ''); + } + // 'waiting' when a running execution is blocked on a prompt (#3). function displayStatus(e) { return e.status === 'running' && e.waiting_for_input ? 'waiting' : e.status; @@ -157,7 +164,7 @@ ' data-execution-id="' + esc(e.id) + '" tabindex="0">' + check + '' + esc(displayStatus(e)) + '' + - '' + esc(execName(e)) + '' + + '' + nameCell(e) + '' + '' + esc(e.started_by || '') + '' + '' + esc(Pulse.fmt.dateTime(e.started_at)) + '' + '' + completed + '' + diff --git a/server.js b/server.js index 5e86faa..3ca5f3a 100644 --- a/server.js +++ b/server.js @@ -1695,9 +1695,13 @@ app.get('/api/executions', authenticateSSO, async (req, res) => { const [rows] = await pool.query( `SELECT e.id, e.workflow_id, e.status, e.started_by, e.started_at, e.completed_at, - w.name as workflow_name + w.name as workflow_name, + -- What a command execution ran, and where (#15): its first log entry. + IF(e.workflow_id IS NULL, LEFT(JSON_UNQUOTE(JSON_EXTRACT(e.logs, '$[0].command')), 120), NULL) AS command, + IF(e.workflow_id IS NULL, wk.name, NULL) AS worker_name FROM executions e LEFT JOIN workflows w ON e.workflow_id = w.id + LEFT JOIN workers wk ON e.workflow_id IS NULL AND wk.id = JSON_UNQUOTE(JSON_EXTRACT(e.logs, '$[0].worker_id')) ${whereClause} ORDER BY e.started_at DESC LIMIT ? OFFSET ?`, [...queryParams, limit, offset] diff --git a/tests/integration/gandalf.int.js b/tests/integration/gandalf.int.js index f835fa9..5f115ef 100644 --- a/tests/integration/gandalf.int.js +++ b/tests/integration/gandalf.int.js @@ -76,3 +76,11 @@ test('execution search finds runs by the command they ran (#16)', async () => { expect(byId.executions.map(e => e.id)).toContain(submit.json.execution_id); expect((await sso('GET', '/api/executions?search=no-such-command-anywhere')).json.executions).toEqual([]); }); + +test('the execution list says what a command ran and where (#15)', async () => { + const marker = `sum-${Date.now().toString(36)}`; + const submit = await gandalf('POST', '/api/internal/command', { worker_id: workerId, command: `echo ${marker}` }); + await waitForExecution(submit.json.execution_id); + const row = (await sso('GET', `/api/executions?search=${marker}`)).json.executions[0]; + expect(row).toMatchObject({ command: `echo ${marker}`, worker_name: 'node-01' }); +}); diff --git a/tests/ui/quick-command.ui.js b/tests/ui/quick-command.ui.js index 30fd48a..1cd6e7e 100644 --- a/tests/ui/quick-command.ui.js +++ b/tests/ui/quick-command.ui.js @@ -21,6 +21,10 @@ test('a quick command runs on a worker and its output shows in Executions', asyn const detail = page.locator('#ex-detail-body'); await expect(detail).toContainText(marker); await expect(detail).toContainText(/completed/i); + + // The list row says what ran and where, not just "[Quick Command]" (#15). + await page.keyboard.press('Escape'); + await expect(page.locator('#ex-list-manual .ex-row').filter({ hasText: `echo ${marker}` }).first()).toContainText('@ node-02'); }); test('a failing command is reported as failed with its stderr', async ({ page }) => { -- 2.47.3 From d7d1381259c4a79ef6dfe23b5dd2619b2ada5df2 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 23 Nov 2026 13:29:52 -0500 Subject: [PATCH 2/2] Long commands: narrower box, 500-character hover text The command box stops at min(24rem, 100%) so a long command ends in an ellipsis well short of the next column, and the list returns up to 500 characters so the hover text shows the whole command. Co-Authored-By: Claude Opus 5.5 --- public/assets/pages/executions.css | 2 +- server.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/pages/executions.css b/public/assets/pages/executions.css index 66ea746..59bcd0f 100644 --- a/public/assets/pages/executions.css +++ b/public/assets/pages/executions.css @@ -254,7 +254,7 @@ html[data-theme="light"] .ex-row.is-selected td { background: rgba(255, 179, 0, /* Command executions in the list: `command @ worker` (#15). */ .ex-row-cmd { display: inline-block; - max-width: 32rem; + max-width: min(24rem, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/server.js b/server.js index 3ca5f3a..eb7f889 100644 --- a/server.js +++ b/server.js @@ -1697,7 +1697,7 @@ app.get('/api/executions', authenticateSSO, async (req, res) => { `SELECT e.id, e.workflow_id, e.status, e.started_by, e.started_at, e.completed_at, w.name as workflow_name, -- What a command execution ran, and where (#15): its first log entry. - IF(e.workflow_id IS NULL, LEFT(JSON_UNQUOTE(JSON_EXTRACT(e.logs, '$[0].command')), 120), NULL) AS command, + IF(e.workflow_id IS NULL, LEFT(JSON_UNQUOTE(JSON_EXTRACT(e.logs, '$[0].command')), 500), NULL) AS command, IF(e.workflow_id IS NULL, wk.name, NULL) AS worker_name FROM executions e LEFT JOIN workflows w ON e.workflow_id = w.id -- 2.47.3