Skip to content

feat(chat): animate first-message send handoff - #1301

Merged
arul28 merged 3 commits into
mainfrom
t3code/chat-send-slide-animation
Sep 24, 2026
Merged

arul28 merged 3 commits into
mainfrom
t3code/chat-send-slide-animation

Conversation

@arul28

@arul28 arul28 commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Problem

On the first send to a new chat, the prompt and composer switch to the chat pane without a coordinated transition. In an existing-lane foreground launch, the composer also used to clear before the create/send round trips finished.

Cause

The Work draft composer and new chat pane mounted independently, while renderer-owned launch state did not hand the first message and composer origin to the new pane as one visual transition. Footer clipping also blocked the composer glide.

Change and boundary

The first user bubble flies from the draft textbox while the composer docks, the Work Chat/CLI switcher becomes the chat header, and the remaining draft chrome fades. The animation is limited to the first message of a new chat and gives up for reduced motion, hidden windows, or resource pressure level 3 and above. Path A (new lane), Path B (existing lane), and Path C (in-place create) are covered. The prompt remains in the composer through renderer-owned launch waits, and remount reconciliation preserves later unsent content. No IPC, CLI, TUI, hosted web, iOS, or provider contract changes.

Verification

  • npx vitest run src/renderer/components/chat/AgentChatPane.test.tsx src/renderer/components/chat/launch/chatLaunchDock.test.ts src/renderer/components/chat/composerChipDom.test.ts from apps/desktop — 339 passed across 3 files.
  • npm --prefix apps/desktop run typecheck — passed.
  • Scoped ESLint on the 9 changed chat files — 0 errors; 23 warnings are on unchanged lines.
  • git diff --check — clean.

Before/after screenshots and a 3.1-second motion clip are attached in the first PR comment. They were captured in Browser Preview with a mocked session-creation API and the checked-in renderer; the final header morph against the real ADE header remains unverified on screen.

Model and harness: GPT-6 / Codex.

ADE   Open in ADE  ·  t3code/chat-send-slide-animation branch  ·  PR #1301


Devin Review

Summary by CodeRabbit

  • New Features
    • Added a send transition that animates the composer and first message into the opened chat.
    • Drafts preserve unsent text and attachments when a chat opens, while removing submitted content without discarding later edits or reattached items.
    • Send transitions respect reduced-motion preferences and adapt to high resource usage.
  • Bug Fixes
    • A second send during an active foreground launch now displays an error instead of being silently ignored.
    • Preserved draft content when a chat opens after a delayed send.

Note

Medium Risk
Touches draft persistence, launch timing, and optimistic message display across remounts; animation is gated but launch/composer state logic is easy to get wrong on edge cases.

Overview
Adds a first-send visual handoff from the Work draft to a new chat: the composer docks from the draft position, the first user bubble morphs up from the prompt text, and draft chrome (mode switcher, usage, etc.) departs—including morphing the Chat/CLI switcher into the chat header. Motion is skipped for reduced motion, hidden windows, and high resource pressure.

Draft lifecycle during slow foreground launches is reworked so the sent prompt stays visible until the chat opens, then only submitted text/attachments/context are cleared while later edits (append, replace, reattach, sidebar insert) survive pane remounts and delayed send completion. The composer reports ComposerDraftEditIntent via beforeinput; drafts persist attachmentDraftIds and submittedDraftTextEdit in local storage.

Renderer-owned foreground chat launches capture and stash composer handoff (with optional first-message envelope for optimistic UI), block duplicate foreground sends, and reconcile storage when a ready job opens after remount. DOM hooks (data-chat-composer-text, data-chat-user-message-card, data-chat-composer-dock, data-draft-depart) support measurement and tests.

Reviewed by Cursor Bugbot for commit a37267f. Configure here.

@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
ade Ignored Ignored Preview Sep 24, 2026 2:34am UTC

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: arul28/ADE/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: bebf93c5-c23a-4137-b232-e6b3ddf3fdf9

📥 Commits

Reviewing files that changed from the base of the PR and between 0958a4e and a37267f.

📒 Files selected for processing (9)
  • apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/chat/composerChipDom.test.ts
  • apps/desktop/src/renderer/components/chat/composerChipDom.ts
  • apps/desktop/src/renderer/components/chat/launch/chatLaunchDock.test.ts
  • apps/desktop/src/renderer/components/chat/launch/chatLaunchDock.ts
  • apps/desktop/src/renderer/components/chat/launch/rendererOwnedLaunch.ts
  • apps/desktop/src/renderer/lib/draftLaunchJobs.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Foreground chat launches capture and transfer composer and first-message state to the destination pane. The pane selectively reconciles submitted text and attachments with persisted drafts. The launch flow animates the composer, first message, and departing draft elements.

Changes

Chat launch flow

Layer / File(s) Summary
Capture and transfer launch handoffs
apps/desktop/src/renderer/components/chat/launch/chatLaunchDock.ts, apps/desktop/src/renderer/components/chat/launch/rendererOwnedLaunch.ts, apps/desktop/src/renderer/components/chat/AgentChatPane.tsx, apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx, apps/desktop/src/renderer/components/chat/launch/chatLaunchDock.test.ts
Foreground launches capture and pass composer handoffs and first-message data to the destination pane. The launch flow stores and discards handoffs as launches open, fail, or expire.
Hydrate and reconcile composer drafts
apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx, apps/desktop/src/renderer/components/chat/composerChipDom.ts, apps/desktop/src/renderer/components/chat/composerChipDom.test.ts, apps/desktop/src/renderer/components/chat/AgentChatPane.tsx, apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx, apps/desktop/src/renderer/components/chat/launch/rendererOwnedLaunch.ts, apps/desktop/src/renderer/lib/draftLaunchJobs.ts
The composer reports pre-edit text and selection offsets. The pane tracks attachment IDs and submitted-text edits, then reconciles submitted content with live and persisted drafts. Tests cover replacements, appended text, reattachments, and remounted launches.
Animate the send transition
apps/desktop/src/renderer/components/chat/launch/chatLaunchDock.ts, apps/desktop/src/renderer/components/chat/AgentChatPane.tsx, apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx, apps/desktop/src/renderer/components/chat/AgentChatMessageList.tsx, apps/desktop/src/renderer/components/chat/ChatSurfaceShell.tsx, apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx, apps/desktop/src/renderer/components/terminals/importSessions/ImportFloatingBadge.tsx, apps/desktop/src/renderer/lib/resourcePressure.ts, apps/desktop/src/renderer/components/chat/launch/chatLaunchDock.test.ts
The pane connects handoffs to composer, first-message, and departing-draft animations. DOM attributes identify animation elements. Motion is gated by document visibility, reduced-motion preference, and resource pressure. Tests cover animation paths and gates.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Suggested labels: desktop, docs

Merge Risk: ⚪ Minimal · up to a3726

This change animates the first message sent to a new chat and preserves unsent draft edits made while a launch is in progress. No concrete defects remain, and motion turns off under reduced-motion, hidden-window, or high resource-pressure conditions. The final header morph has not been visually confirmed against the real header. That is a polish check, not a merge blocker.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.10% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 58 functions across 13 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: animating the first-message send handoff in chat.
Full details: Docstring Coverage

Explanation

Docstring coverage is 43.10% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 58 functions across 13 files. (1 skipped: 1 too large.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@arul28

arul28 commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

UI evidence — captured in Browser Preview with the checked-in renderer and a mocked session-creation API. The final header morph against the real ADE header remains unverified on screen.

Before

Before send

After

After send

Motion clip (3.1 seconds)

ade-chat-handoff-motion.mp4

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@cursor

cursor Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_41968113-0fb0-4383-846a-24316d4dd024)

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

🐛 1 issue in files not directly in the diff

🐛 Sent prompt remains after chip insertion

When a user inserts a chip after a pending foreground prompt, updateComposerDraft records a replacement instead of an append. Chip insertion omits edit intent, so the sent prompt remains in the unsent draft.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@arul28
arul28 merged commit b183cd3 into main Sep 24, 2026
41 checks passed
arul28 added a commit that referenced this pull request Sep 24, 2026
…review-and-live-stream

AgentChatPane: this lane moved the session reset effect above the show
handler, and main changed its body to keep the pending bubble of the chat
just selected. Main's body now lives in the moved effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
arul28 added a commit that referenced this pull request Sep 24, 2026
#1299 (the Apple device tool, this lane's former parent) was squash-merged
into main as ed21a34. Its content equals the parent tip 02c8cf8 that
this lane already contains, plus a merge of #1301 (send-handoff
animation). 27 files conflicted only because the squash commit and this
lane's history carry the same parent changes: for the 26 files main did
not change after the parent tip, this lane's version is kept; for
AgentChatPane.tsx, #1301's change is applied on top. The merge adds
exactly main's diff since the parent tip (checked file by file).

Type-checks clean; chat, terminals, apple, RPC, work-tools and CLI
mac-desktop suites pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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