Repository navigation
refactor(site): prepare the composer for queued message edits - #29553
Conversation
This comment has been minimized.
This comment has been minimized.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This comment has been minimized.
This comment has been minimized.
DanielleMaywood
left a comment
There was a problem hiding this comment.
seems mostly fine. readability of the code isn't the best though. classic LLMs
4964ae5 to
553ea3a
Compare
e692db1 to
29a4bc9
Compare
29a4bc9 to
2b463bf
Compare
This comment has been minimized.
This comment has been minimized.
|
Chat: Review in progress (1/1 reviewers complete) | View chat deep-review v0.9.0 | Round 1 | Last posted: Round 1, 6 findings (1 P2, 2 P3, 3 Note), COMMENT. Review Finding inventoryFinding inventory: PR #29553Findings
Contested and acknowledgedNone. Round logRound 1Netero-only (P2 gate). 1 P2, 2 P3, 3 Note. Law not run (effective additions 358). Orchestrator reproduced CRF-1: About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
First-pass review only. These are mechanical findings from Netero. The full review panel has not reviewed this PR yet; it will review once these findings are addressed.
The EditingTarget rename is otherwise complete: Netero's grep for every old name (handleEditUserMessage, handleCancelHistoryEdit, isEditingHistoryMessage, busyItem, and the rest) found one stale caller. Netero's mutation runs show the new tests pin real behavior: the draft-guard test fails when the editingTarget !== null guard is removed, and the pending/restore test fails when restoreHiddenItem is removed.
1 P2, 2 P3, 3 Notes. The P2 is that one stale caller. ChatPageContent.test.tsx still passes the removed props, and tsc -p . never checks the file because it shares a basename with ChatPageContent.test.ts, so CI stays green while the fixture silently switches to edit mode.
"Until the pair is split, any future prop change breaks this test just as silently." (Netero)
site/src/pages/AgentsPage/components/ChatPageContent.test.tsx:38
P2 [CRF-1] This test still passes the removed isEditing={false} and onCancelHistoryEdit props, so it now renders ChatPageInput in edit mode, and no type check reports it. (Netero)
At runtime
editingTargetisundefined, soconst isEditing = editingTarget !== null(+ChatPageContent.tsx:439) istrue. The fixture that used to render compose mode now pickseditAttachmentsand the edit-mode reset paths, and the test name says nothing about editing.
ChatPageContent.test.tsandChatPageContent.test.tsxshare a basename, and TypeScript'sincludeexpansion keeps only the higher-priority.tsfile.
I reproduced both halves. tsc -p . --listFilesOnly in site/ lists ChatPageContent.test.ts and omits the .tsx. Type-checking the .tsx on its own (plus src/@types/*.d.ts) fails with TS2322 ... Property 'isEditing' does not exist on type 'IntrinsicAttributes & ChatPageInputProps'. Edit mode also drops slashCommands (ChatPageContent.tsx:631), so the Stop test now runs against the edit-mode composer rather than compose mode.
Fix lines 38-39 with editingTarget={null} and onCancelEdit={vi.fn()}. Merging ChatPageContent.test.ts into the .tsx file (or renaming one of them) lets pnpm lint:types check both, so the next prop rename cannot repeat this.
🤖
🤖 This review was automatically generated with Coder Agents.
| aiGatewayDisabled, | ||
| slashCommands, | ||
| }) => { | ||
| const isEditingMessage = editingKind !== undefined; |
There was a problem hiding this comment.
Note [CRF-5] editingKind is only compared against undefined, so kind-specific UI now depends on a kind-agnostic flag. (Netero)
isEditingMessagegates the header text "Editing will delete all subsequent messages and restart the conversation here." (AgentChatInput.tsx:1148-1153) and the "Save Edit" label. Both describe history edits. WithEditingTargetlimited to{ kind: "history" }this is correct today. Once #29555 addsqueued, that text would show for queued edits unless the header branches oneditingKind.
🤖
There was a problem hiding this comment.
No change here. This PR has only the history kind, so the header text is correct for every edit it can show. #29555 adds queued and branches the banner on it in AgentChatInput.tsx (editingKind === "queued" ? "Editing a queued message. It is not sent until you save or cancel." : ...). "Save Edit" applies to both kinds.
🤖 Posted using
/amend-reviewskill via Coder Agents.
|
In reply to CRF-1 (P2, Fixed in 909a43f. The test passes
|
909a43f to
6f130fc
Compare
6f130fc to
cf64adf
Compare
4eb6d33 to
0113e76
Compare
8262555 to
3dde166
Compare
f331080 to
a2c60b0
Compare
4c2d66f to
ad210c5
Compare
81e09bd to
d17a0ff
Compare
d17a0ff to
790d6db
Compare
790d6db to
408b7f6
Compare
Edit state is an EditingTarget, { kind: "history"; id }, so a second
kind can be added without touching every consumer. submitChatTurn takes
the target and handles the history kind. Extracted helper:
getEditableContentPayload (text and editable attachments from message
parts). The queued row actions share one QueuedMessageActionButton and
one runAction that hides the row optimistically and restores it on
failure.
No behavior changes.
ChatPageContent.test.tsx still passed the removed isEditing and onCancelHistoryEdit props, which left editingTarget undefined and put the composer in edit mode. tsc never saw the file because it shares a basename with ChatPageContent.test.ts and include expansion keeps the .ts. Merging the two files puts the tests under the type check. editingMessageId was derived from editingTarget and carried next to it through the hook, the view props, and the story builder. The timeline is its only reader, so the view derives it there. The action buttons no longer sit inside a span, so a disabled button shows no tooltip, as on main.
…e chip Escape test
…r popovers React bubbles keydown from the portaled MCP and model popovers through the composer, so the Escape that closed a popover also cancelled the edit or interrupted the streaming turn.
408b7f6 to
2573f7a
Compare
Prepares the composer for editing queued messages. No behavior changes.
The edit state is an
EditingTargetwith akindand anid. History rows and queued rows have separate ID spaces, sokindsays which oneidbelongs to; #29555 adds thequeuedkind.getEditableContentPayloadis extracted so the queued save path can reuse it,submitChatTurntakes anEditingTargetin place of a history message ID, and the queued row actions share oneQueuedMessageActionButtonand onerunActionhelper.For review: unit tests in
messageParsing.test.tspin the cases the inline code ofgetEditableContentPayloadhandled.QueuedMessagesList.test.tsbecomes.test.tsxand gains render tests of the shared action runner and of each row action forwarding its row ID.useConversationEditingState.test.tsgains a test that an edit does not overwrite the persisted draft.ChatPageContent.test.tsis merged intoChatPageContent.test.tsx, because while both basenames existed,tsc -p .checked only the.tsfile and the.tsxfile had stale props without a type error.Part of the CODAGT-971 frontend stack: 1 of 3.