Readable command output: ANSI stripped, Copy / Wrap / Expand / .txt (#27)
CI / Lint (eslint) (pull_request) Successful in 20s
CI / Test (jest) (pull_request) Successful in 21s
CI / Security (npm audit) (pull_request) Successful in 15s
CI / Integration (api) (pull_request) Successful in 2m43s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m44s
CI / UI (playwright) (pull_request) Successful in 2m35s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 1m54s

A shared output block (Pulse.output.render) now draws every command
output in Executions and Quick Command:
- ANSI escape codes (colours, cursor moves, titles, charset switches)
  are stripped, so systemctl, ls --color and docker read cleanly.
- Copy and .txt use the full, clean text; .txt downloads it as a file.
- Wrap turns long-line wrapping on or off for every block, remembered.
- Output over 25 lines starts at 24rem high with an Expand button.
- Over 100,000 characters, the display is cut with a notice saying how
  much is hidden; Copy and .txt still include all of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-23 16:10:52 -05:00
1 parent 64703482fd
commit ecc1b447be
6 files changed
+162 -22

No files matched your search

+5 -4
View File
@@ -282,8 +282,9 @@
return '<div class="ex-log-field"><span class="ex-log-label">' + esc(label) + ':</span> ' + value + '</div>';
}
function out(text, isErr) {
return '<pre class="lt-log-output' + (isErr ? ' ex-log-output-err' : '') + '">' + esc(text) + '</pre>';
// Shared output block: ANSI stripped, Copy / Wrap / Expand / .txt (#27).
function out(text, isErr, name) {
return Pulse.output.render(text, { err: isErr, name: (name || 'pulse-output') + (isErr ? '-stderr' : '') });
}
function promptOptions(options, executionId) {
@@ -314,8 +315,8 @@
(ok ? '&#x2713;' : '&#x2717;') + ' Command Result',
field('Status', ok ? 'Success' : 'Failed') +
(log.duration ? field('Duration', esc(log.duration) + 'ms') : '') +
(log.stdout ? field('Output', out(log.stdout, false)) : '') +
(log.stderr ? field('Errors', out(log.stderr, true)) : '') +
(log.stdout ? field('Output', out(log.stdout, false, 'pulse-' + String(log.command_id || '').slice(0, 8))) : '') +
(log.stderr ? field('Errors', out(log.stderr, true, 'pulse-' + String(log.command_id || '').slice(0, 8))) : '') +
(log.error ? field('Error', esc(log.error)) : ''));
}
-7
View File
@@ -105,13 +105,6 @@
}
.qc-run-time { color: var(--text-muted); font-size: 0.75rem; }
.qc-run-link { margin-left: auto; font-size: 0.75rem; }
.qc-run-body pre {
max-height: 24rem;
overflow: auto;
white-space: pre-wrap;
overflow-wrap: anywhere;
margin: 0.5rem 0 0;
}
.qc-out-err {
color: var(--accent-red);
border-left-color: var(--accent-red);
+3 -10
View File
@@ -169,7 +169,6 @@
/* Results show here as they arrive, per worker, instead of only in Executions (#5).
A card per run: "running" until its command_result comes in over the live
connection, or a poll finds it finished if that event was missed. */
const OUTPUT_MAX = 100000; // characters shown per stream
const _runs = new Map(); // execution id -> { card, startedAt, timer }
const _early = new Map(); // results that beat the POST response
@@ -210,13 +209,6 @@
'<div class="qc-run-body"></div></div>';
}
function clip(text) {
const t = String(text || '');
if (t.length <= OUTPUT_MAX) return esc(t);
return esc(t.slice(0, OUTPUT_MAX)) + '\n<span class="qc-out-note">[' + (t.length - OUTPUT_MAX).toLocaleString() +
' more characters: see the full output in Executions]</span>';
}
function failureLabel(r) {
if (r.timed_out) return 'Timed out';
if (r.signal) return 'Killed (' + r.signal + ')';
@@ -238,8 +230,9 @@
const ms = typeof r.duration === 'number' ? r.duration : Date.now() - run.startedAt;
run.card.querySelector('.qc-run-time').textContent = ms < 1000 ? ms + ' ms' : (ms / 1000).toFixed(1) + ' s';
const parts = [];
if (r.stdout) parts.push('<pre class="lt-log-output qc-out">' + clip(r.stdout) + '</pre>');
if (r.stderr) parts.push('<pre class="lt-log-output qc-out-err">' + clip(r.stderr) + '</pre>');
const name = 'pulse-' + String(executionId).slice(0, 8);
if (r.stdout) parts.push(Pulse.output.render(r.stdout, { cls: 'qc-out', name: name }));
if (r.stderr) parts.push(Pulse.output.render(r.stderr, { err: true, cls: 'qc-out-err', name: name + '-stderr' }));
if (!r.success && r.error && !r.stderr) parts.push('<pre class="lt-log-output qc-out-err">' + esc(r.error) + '</pre>');
if (!parts.length) parts.push('<div class="qc-out-note">No output</div>');
const body = run.card.querySelector('.qc-run-body');