Skip to content

feat: editable user messages with conversation forking#22

Merged
dsfaccini merged 11 commits intopydantic:mainfrom
dsfaccini:feat/editable-user-messages
Apr 10, 2026
Merged

feat: editable user messages with conversation forking#22
dsfaccini merged 11 commits intopydantic:mainfrom
dsfaccini:feat/editable-user-messages

Conversation

@dsfaccini
Copy link
Copy Markdown
Contributor

Summary

  • Editable user messages: hover to reveal pencil icon, click to edit inline with draft persistence across cancel/re-edit cycles
  • Modify/fork dialog: after editing, choose to update the current conversation (truncate + resend) or fork into a new conversation from that point
  • Fork navigation: < 1/N > arrows appear on messages with sibling forks, allowing navigation between conversation branches
  • Removed regenerate button from assistant messages (replaced by edit-based workflow)
  • 10 Playwright e2e tests covering edit UI, modify flow, fork flow, draft persistence, and button removal

Test plan

  • pnpm exec playwright test — 10/10 passing
  • pnpm exec eslint src/ tests/ — clean
  • pnpm run typecheck — clean
  • Manual Chrome verification: edit icon hover, inline textarea, dialog, update conversation, fork creation

🤖 Generated with Claude Code

dsfaccini and others added 11 commits April 7, 2026 20:11
Replace the regenerate button with inline message editing. Users can
click the pencil icon on any user message to edit it, then choose to
update the current conversation (truncate + resend) or fork into a new
conversation from that point. Fork navigation arrows (< 1/N >) appear
on messages that have sibling forks, allowing users to navigate between
conversation branches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set up Playwright with Chromium, mock AI SDK UI Message Stream protocol,
and add 10 tests covering: edit icon hover, inline textarea, draft
persistence, escape cancel, modify/fork dialog, update conversation,
fork creation, sidebar update, and regenerate button removal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The submit (checkmark) and cancel (X) buttons on the edit textarea
were left-aligned despite the user message bubble being right-aligned.
Now they align to the right and use green/red colors for clarity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If the user enters edit mode but submits without changing the text,
just close the editor instead of showing the dialog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the regenerate button with inline message editing. Users can
click the pencil icon on any user message to edit it, then choose to
update the current conversation (truncate + resend) or fork into a new
conversation from that point. Fork navigation arrows (< 1/N >) appear
on messages that have sibling forks, allowing users to navigate between
conversation branches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set up Playwright with Chromium, mock AI SDK UI Message Stream protocol,
and add 10 tests covering: edit icon hover, inline textarea, draft
persistence, escape cancel, modify/fork dialog, update conversation,
fork creation, sidebar update, and regenerate button removal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The submit (checkmark) and cancel (X) buttons on the edit textarea
were left-aligned despite the user message bubble being right-aligned.
Now they align to the right and use green/red colors for clarity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Defer setSendTrigger in handleModify to avoid race with setMessages
- Guard handleFork against invalid conversationId
- Restore regenerate/Retry button removed by accident
- Add bounds checks on ForkNavigation click handlers
- Use edited text for fork sidebar label

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge remote feat/editable-user-messages (old localStorage base)
into local (rebased onto upstream/main with IndexedDB).
All conflicts resolved keeping local version.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add braces to setTimeout arrow to satisfy no-confusing-void-expression
- Remove unnecessary ?? fallback (pendingEdit.text is always defined)
- Format lucide-react import per prettier
- Remove redundant bounds checks flagged by no-unnecessary-condition

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set up husky + lint-staged to run eslint --fix on staged ts/tsx files,
typecheck the full project, and run Playwright tests before each commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dsfaccini dsfaccini merged commit 376f24c into pydantic:main Apr 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant