feat(chat): edit the final user message - #7237
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
One finding: invariant documentation was dropped while moving shared eligibility helpers out of apps/server/src/orchestration/decider.ts into packages/contracts/src/messageCorrection.ts. Everything else in the changed Effect code (namespace subpath imports, Context.Service/make/layer shapes, dependency acquisition, no new ManagedRuntime/runPromise outside tests, error construction at the failure boundary) looks consistent with the conventions.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Reviewed the web UI changes (MessagesTimeline.tsx, ChatView.tsx) for shared-primitive usage, Tailwind ownership, and theming/layout preservation. The new edit action correctly reuses Button/Tooltip/Textarea and mirrors the existing RevertUserMessageButton composition. Two findings on the new inline editor: a viewport-relative min-width that can overflow a narrow chat column, and a surface/foreground token pairing that can lose contrast under custom themes.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding on the new inline message editor inside the user message bubble. The shared primitives (Textarea, Button) are used correctly and the Edit affordance mirrors RevertUserMessageButton; the only issue is the ghost Cancel button's hover state on the message surface.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One inline-editor consistency finding on the new message-edit surface in apps/web/src/components/chat/MessagesTimeline.tsx. The rest of the web changes (Button/Textarea primitive usage, ghost Cancel hover treatment, edited-metadata row, and the Revert/Edit mutual exclusion driven by revertTurnCountByUserMessageId) look consistent with the existing chat timeline patterns.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding in the new inline message editor: the editor textarea has no height cap, so it can grow past the viewport for the long user messages this row otherwise collapses.
Posted via Macroscope — UI Consistency
Users could not correct a thread-ending prompt after the thread became idle without sending a separate follow-up.
This adds a first-class message-correction command and event across contracts, server orchestration, projections, persistence, relay snapshots, and both web and mobile clients. Edit is offered only when the final visible message is the user message and the thread is idle. Corrections preserve structured context, reject stale edits, start a normal replacement turn, remain consistent through pagination and server restarts, and reconcile correctly when checkpoints are reverted.
Implemented with gpt-5.6-sol via Codex in T3 Code.