feat(story-mode): a run panel shows what its command printed

From review round 8: you asked to see a dry run, Claude's balloon said
"Here's the dry run you asked for", and the page showed nothing of it.
A run panel's terminal card now prints, dimmer under the commands, the
first lines its last command printed (the last ones when it failed:
that is where an error is).

The card is drawn on the canvas, so it goes into a saved image someone
may share: a line that looks like a secret (token, password, api key,
credential, inside identifiers too) is left out, addresses and long
token-like strings are masked, and Claude Code's own markers ("(Bash
completed with no output)", tool-error tags) are dropped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-18 15:32:36 +02:00
1 parent b19317175e
commit e892278abc
17 files changed
+296 -7

No files matched your search

+18
View File
@@ -1034,6 +1034,24 @@ describe('buildStoryPage', () => {
);
});
it("a run panel's terminal card shows what the command printed, never what looks like a secret", () => {
const page = pageOf([
prompt('dry run please'),
...bash(
'b1',
'./rename.sh --dry-run samples/',
'Dry run',
'a.jpg -> holiday_2024-05-01.jpg\nAPI_TOKEN=abc123\nauthor: me@example.com\nb.jpg -> holiday_2024-05-02.jpg'
),
end(1000),
]);
expect(page.panels.find((p) => p.kind === 'run')!.printed).toEqual([
'a.jpg -> holiday_2024-05-01.jpg',
'author: …@…',
'b.jpg -> holiday_2024-05-02.jpg',
]);
});
it('a helper messaged twice reads as one finished run, not as superseded', () => {
const r = createStoryReducer({ sidechain: true });
const lines = [prompt('write it'), said('Done.'), prompt('also the tests'), said('Done too.')].map((l) => ({