mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-15 18:59:33 +01:00
fix(story-mode): the rest of review round 3
- A report's turn links to the helper it answers: its drawer shows what the
helper did. Reports arrive HTML-escaped (`<a@b.c>`) and now read as
text.
- Screen readers: a polite status region says when a new turn starts and
when one finishes; the note is a status, the drawer a dialog named by its
title; "Open file" buttons name their file.
- Save image draws the balloons' tails (from their CSS triangles) and is
disabled with nothing to save.
- App toasts move to the bottom while Story Mode is open: at the top they
covered its bar and turn picker on phones.
- The bar names the session as its tab does; a click on the mission balloon
opens the prompt.
- A heading ends at its line (a plan's "# Plan: add wrap" no longer runs
into its next paragraph) and a short one ("## Summary") is dropped; the
plan you approved stamps "You approved it".
- "Claude's part is done in 3 minutes. A helper is still working."; the
helper steps say "still working" while the helper runs; the advisor's
labels call it a second opinion; a check run twice the same way reads once
with a count; the session folder reads "." in commands only, never in
prose; the loop's POW keeps off its board on a narrow panel; a shell
session's note says it runs a shell or another CLI.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
757e14e991
commit
873b899c52
6 files changed
+198
-38
No files matched your search
@@ -84,7 +84,7 @@ describe('GET /api/sessions/:id/story', () => {
|
||||
const { app } = await setup({ mode: 'codex' });
|
||||
const data = (await app.inject({ method: 'GET', url: URL })).json().data;
|
||||
expect(data.supported).toBe(false);
|
||||
expect(data.reason).toMatch(/different CLI/);
|
||||
expect(data.reason).toMatch(/shell or another CLI/);
|
||||
});
|
||||
|
||||
it('answers unsupported for remote and Docker sessions, whose transcript is not on this host', async () => {
|
||||
|
||||
+33
-2
@@ -148,7 +148,13 @@ describe('text helpers', () => {
|
||||
'Renamed rename_by_date.sh to __init__.py style.'
|
||||
);
|
||||
expect(firstSentence('It is *really* done and _very_ fast.')).toBe('It is really done and very fast.');
|
||||
expect(firstSentence('## Summary\n- Fixed the 2*3 bug.')).toBe('Summary Fixed the 2*3 bug.');
|
||||
expect(firstSentence('## Summary\n- Fixed the 2*3 bug.')).toBe('Fixed the 2*3 bug.');
|
||||
});
|
||||
|
||||
it('firstSentence ends a heading at its line', () => {
|
||||
expect(firstSentence('# Plan: add `wrap` to mathx.py\n\n**Context:** it has clamp().')).toBe(
|
||||
'Plan: add wrap to mathx.py.'
|
||||
);
|
||||
});
|
||||
|
||||
it('firstSentence treats code spans as words and an ellipsis or e.g. as no end', () => {
|
||||
@@ -347,7 +353,7 @@ describe('buildStoryTurns', () => {
|
||||
'Claude sends 1 helper off to work in the background.'
|
||||
);
|
||||
expect(page.panels[page.panels.length - 1].caption.story).toBe(
|
||||
'Done in 1 second for now. A helper is still working.'
|
||||
"Claude's part is done in 1 second. A helper is still working."
|
||||
);
|
||||
|
||||
const notification = [
|
||||
@@ -371,6 +377,8 @@ describe('buildStoryTurns', () => {
|
||||
const second = buildStoryPage(turns[1]);
|
||||
expect(second.prompt).toBe('Agent "Write README" finished');
|
||||
expect(second.events[0].output).toBe('I wrote README.md.');
|
||||
// The report's turn links back to the helper it answers.
|
||||
expect(second.events[0].helper).toMatchObject({ agentId: 'h9', result: 'I wrote README.md.' });
|
||||
});
|
||||
|
||||
it('a prompt typed while Claude works (a queued_command attachment, no user line) joins the turn', () => {
|
||||
@@ -489,6 +497,29 @@ describe('buildStoryTurns', () => {
|
||||
expect(first.helpersRunning).toBe(0);
|
||||
});
|
||||
|
||||
it('a report written HTML-escaped reads as text', () => {
|
||||
const [turn] = buildStoryTurns(
|
||||
entriesOf([
|
||||
prompt(
|
||||
'<task-notification>\n<summary>Agent "Docs" finished</summary>\n<result>Co-Authored-By: A <a@b.c> & more</result>\n</task-notification>',
|
||||
{ turnOrigin: 'task_notification' }
|
||||
),
|
||||
])
|
||||
);
|
||||
expect(turn.prompt).toBe('Agent "Docs" finished');
|
||||
expect(turn.events[0].output).toBe('Co-Authored-By: A <a@b.c> & more');
|
||||
});
|
||||
|
||||
it('a check run twice the same way reads once, with a count', () => {
|
||||
const page = pageOf([
|
||||
prompt('test twice'),
|
||||
...bash('b1', 'pytest -q', 'Run tests', '3 passed in 0.1s'),
|
||||
...bash('b2', 'pytest -q', 'Run tests again', '3 passed in 0.1s'),
|
||||
end(1000),
|
||||
]);
|
||||
expect(page.panels.find((p) => p.kind === 'check')!.caption.director).toBe('pytest -q → ok ×2 · 3 passed');
|
||||
});
|
||||
|
||||
it('a message from another session names its sender; pasted text loses its wrapper', () => {
|
||||
const [peer] = buildStoryTurns(
|
||||
entriesOf([
|
||||
|
||||
Reference in new issue
Block a user