Repository navigation
feat(content): open the editor on the Content Agent at work, step by step - #1349
Conversation
…step Start offers the agent first (Agent · Me · Team; Me stays the default, as the agent's run is metered). Picking the agent opens the editor at once instead of a toast to click. While the agent writes, the editor shows its steps as Chat shows its tools: the reading and the rules done, the writing (or the suggestions on a live page) under way with the time it has taken, and the review to come. Past two minutes it says the wait is longer than usual. The draft carries agent_state_at as agentSince for the timer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk the Start → Agent flow from the Content Editor feedback: Agent is offered first (Me stays the default), the editor opens at once, and while the agent writes it shows the agent's steps with a timer, plus a 'longer than usual' note after 2 minutes. Web only, no migration. It touches the editor's page.tsx and page.test.tsx like #1347/#1348, in other places; whichever lands second, I'll merge main in. |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good, and approved in substance. One step before merge: #1351 is landing now, and its new test expects "Content Agent is writing this page", which this PR changes to "working on this page". Please merge main in and update that expectation.
Optional (a11y): put aria-hidden on the timer inside role="status", so screen readers don't announce it every second.
…keep the timer from screen readers Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk merged main in (02d9636), then d8a1d70:
Checks: web lint (0 errors), typecheck, 2,722 tests and build pass. |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good. Ready to merge.
Both items from the last review are done in d8a1d70:
- #1351's test now expects "Content Agent is working on this page" (
page.test.tsx:1559). The old title isn't used anywhere on this head. - The timer has
aria-hidden(_agent-writing.tsx:102), so therole="status"region no longer reads it out every second.
Merge notes
- Merges cleanly on current main and with #1346. No migration.
- The merge of main (02d9636) has no changes of its own: it matches a clean re-merge of its parents exactly.
- The rewrite from #1351 fits the steps: a new page shows the writing steps, and a live page shows the suggestion steps. Both open in review, as the "leave" note says.
Tested on top of main together with #1346, #1349 and #1127: web and server tests, tsc, lint and Prettier pass.
Summary
Content Editor feedback items 1, 2 and 11 (the Start → Agent flow):
Agent first. New content's "Who does it" now reads Agent · Me · Team. Me stays the default, since the agent's run is metered from the AI usage.
The editor opens at once. Picking the agent used to show a toast you had to click, "Content Agent is drafting · Open draft". Once the agent has started, the dialog now opens the editor on the draft. If it can't start (budget, subscription, another draft being written…), the error toast with Open draft stays as it was, and the editor isn't opened.
agentStarted/agentStartedDescriptionkeys are gone.An agentic waiting screen. The new
_agent-writing.tsxreplaces the bot icon and line of text. While the draft sayswriting, it shows the agent's steps, as Chat shows its tools:useNow, fromagent_state_at);The first two finish within a second of the start, so the model's call is the wait. After 2 minutes, "Usually a minute or two." becomes "Taking longer than usual. If it can't finish within a few minutes, this page says so…". The model call is cut at 3 minutes (
CALL_TIMEOUT_MS).ContentDraft.agentSincecarriesagent_state_atfor the timer. The editor sets it too when its own Try again starts the agent.The next PR fixes item 8 on its own: Fix open rules showing "couldn't run" while the agent was still working.
Related issue
Content Editor feedback round (no issue).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
agent_state = 'writing'andagent_state_at = now()on a dev DB. Withnow() - interval '150 seconds'the "longer than usual" note shows. Set both back to null after.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn test(2631 tests pass) andyarn build. Checked in the browser on a dev draft set to writing (restored after).🤖 Generated with Claude Code