Skip to content

feat(chat): edit the final user message - #7237

Draft
ipanasenko wants to merge 9 commits into
pingdotgg:mainfrom
ipanasenko:t3code/be0955f1
Draft

feat(chat): edit the final user message#7237
ipanasenko wants to merge 9 commits into
pingdotgg:mainfrom
ipanasenko:t3code/be0955f1

Conversation

@ipanasenko

@ipanasenko ipanasenko commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

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.

edit-last-message-before edit-last-message-after

Implemented with gpt-5.6-sol via Codex in T3 Code.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 092a35f9-e7b6-48e9-b56b-a27fb390172a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 16, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread packages/contracts/src/messageCorrection.ts Outdated
Comment thread packages/contracts/src/messageCorrection.ts
Comment thread apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Comment thread apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Comment thread apps/mobile/src/features/threads/ThreadFeed.tsx
Comment thread apps/web/src/components/ChatView.tsx Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/mobile/src/features/threads/ThreadRouteScreen.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
@ipanasenko ipanasenko changed the title feat: edit the last user message feat(chat): edit the final user message Aug 16, 2026
Comment thread apps/web/src/components/ChatView.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant