Skip to content

Make Bot messages look sent the moment you press Send - #601

Merged
sambitcreate merged 8 commits into
mainfrom
claude/project-thread-ojva86
Oct 27, 2026
Merged

sambitcreate merged 8 commits into
mainfrom
claude/project-thread-ojva86

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Requested by sbt · project thread

Why

Sending in a Bot chat felt delayed. The message did appear at once (#576), but faded with "Sending…" until the Mac accepted it. On the Mac, bots:send resolves the Bot's model, rebuilds its tools/connectors (registry.refresh()) and system prompt before admitting the input, so the fade turning solid read as the real send. Phones showed the same faded look until the Mac answered.

What changed

Desktop (renderer/main/bots/bot-chat-pane.tsx)

  • The pending echo is drawn exactly like the user entry it becomes (same BotMessageActions row, Copy and Reply). Before, it sat in a different row without the actions slot, so the bubble also shifted and re-wrapped when the real entry arrived.
  • "Sending…" shows only when main has not accepted the send after 2 s.
  • A follow-up sent while the Bot works shows as Queued at once (matching the Mac's queued row it settles into); a Steer looks sent at once.
  • "Getting ready" shows from the send (the phones already did this), and an interrupted card leaves with the send that dismisses it; a failed send drops the echo and the line and brings the card back.
  • Echoes settle during render (shownSends), so an echo never shares a frame with the entry that replaces it.
  • Send motion: the words move from where they sat in the composer into their bubble over 360 ms while the bubble's fill comes in. A floating copy makes the trip (the scroll area clips anything over the composer); the real bubble holds its place unseen until it lands, and an entry or queued row that answers the send meanwhile is held unseen too, so the hand-over never shows twice. If anything is drawn after that entry first (a fast reply), the motion ends at once so the message never sits below its reply. Skipped under Reduce Motion or without layout.
  • A failed send showed two identical error toasts (the pane and the composer both toasted). The pane now throws the user-facing message and the composer shows it once.

iOS / Android

  • A message on its way is drawn as sent; "Sending…" appears only once it has waited 2 s (offline, or a slow Mac). Queued, Steer and "Couldn't send · Try again" are unchanged.

Not changed: how fast the Mac admits a send. Reusing the Bot's tool set and prompt between sends is a possible follow-up.

No Remote protocol change.

Docs

  • docs/plans/instant-ui-optimistic-updates-plan.md: follow-up section; docs/plans/README.md row.
  • docs/superpowers/specs/2026-10-14-bot-chat-activity-design.md: send bullet amended.
  • ios/CHANGELOG.md: Unreleased entry.

Tests

  • bot-chat-pane.test.tsx: echo is a normal message row with no "Sending…" and "Getting ready" shows before main answers; "Sending…" after 2 s and gone once main accepts; Queued at once while working; a Steer while working looks sent; failed send restores the interrupted card, clears "Getting ready", and shows one toast; a send still moving keeps its echo when its entry arrives and settles once it lands; mounted motion test (stubbed animate): the entry stays held until the copy lands, and a reply arriving mid-motion leaves one message above the reply.
  • Android AidenBotChatPresentationTest: Sending look with and without the 2 s wait.
  • Ran locally: bot-chat-pane.test.tsx (71/71) and the other renderer files in test:bots, tsc --noEmit, eslint on touched files. Swift/Kotlin are not compiled in the cloud container; CI is their first compile.

Screenshots and a recording of the send motion (desktop, light and dark) are in the project thread. Phone screenshots need the owner's Mac.

🤖 Generated with Claude Code

https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72

The message showed at once but faded with "Sending…" until the Mac
accepted it, which on the Mac waits for the Bot's model, tools and prompt
to be prepared. That fade turning solid read as the real send.

- Desktop: the echo is drawn exactly like the entry it becomes (same row,
  Copy and Reply), says "Sending…" only after 2 s without an answer, and
  shows as Queued at once while the Bot works. "Getting ready" shows from
  the send, an interrupted card leaves with the send that dismisses it,
  and a failed send shows one error toast instead of two.
- iOS and Android: a message on its way is drawn as sent, with
  "Sending…" only once it has waited 2 s.
- Docs: instant UI plan follow-up, plans index, Bot chat activity spec,
  iOS changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72
@sambitcreate sambitcreate self-assigned this Oct 27, 2026

@pullfrog pullfrog 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.

Important

The desktop optimistic state incorrectly presents Steer messages as queued follow-ups. Preserve the selected send mode before merging.

Reviewed changes across desktop, iOS, and Android, including acknowledgement timing, optimistic activity, failure recovery, and supporting tests/docs.

  • Desktop send presentation: Normal pending messages reuse the sent-message actions row, delay “Sending…” for two seconds, and track acknowledgement; busy sends receive an immediate queued presentation.
  • Optimistic activity and recovery: Pending sends show “Getting ready” and hide the interrupted card, with rollback on failure and one composer-owned error toast.
  • Native clients: iOS and Android draw sending messages without fading and reveal the sending caption after two seconds, retaining existing outbox reconciliation and retry behavior.
  • Tests and documentation: Desktop behavioral tests, Android presentation assertions, the optimistic-update plan, activity spec, and iOS changelog reflect the changes.

Validation: all 68 desktop pane tests passed, and both changed Swift files passed syntax parsing. Native execution remains unverified here: xcodebuild is unavailable, and the Android offline test run could not resolve org.gradle.toolchains.foojay-resolver-convention version 1.0.0.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread renderer/main/bots/bot-chat-pane.tsx Resolved

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread renderer/main/bots/bot-chat-pane.tsx Resolved
@very-hermes-bot

very-hermes-bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Hermes Review Bot

Confidence: 5

Engine: agy/gemini-3.8-flash-high
Review mode: full
Head: a8ba93da9d0853d962e9c1d8845fd53ed1b8410f
Generated: 2026-10-27T05:22:23+00:00
Reviews: 1

Summary

Bot chat sends now render optimistically as standard sent messages across desktop, iOS, and Android rather than appearing faded with "Sending…" while the Mac prepares the Bot turn. On the desktop, pending message bubbles adopt BotMessageActions with identical dimensions, quote/copy actions, and an arc transition from composer coordinates, deferring the "Sending…" caption until main has taken more than 2 seconds without acknowledgment. Steer submissions display as sent immediately, follow-up messages sent during active turns render as queued immediately, and single-toast error handling ensures failed sends restore drafts cleanly without duplicate notifications. Maintainers should double-check behavior on low-end Linux environments without hardware acceleration to verify that Element.prototype.animate execution remains fluid across rapid successive submissions.

Confidence Score: 5/5

Fully traced end-to-end across React layout lifecycles, Web Animations API coordination, Compose/SwiftUI states, and test suites.

📁 Important Files Changed
  • renderer/main/bots/bot-chat-pane.tsx: Replaces the faded pending send UI with full-fidelity message bubbles, coordinates the 90 ms morph animation from the composer, hides "Sending…" until a 2 s threshold, synchronizes arrival hand-offs in shownSends, and shows a single error toast on failure.
  • renderer/main/bots/bot-chat-pane.test.tsx: Adds behavioral tests for immediate sent styling, 2-second caption delay, queued/steer state transitions, motion hand-off and early arrival cancellation, and single-toast error recovery.
  • android/app/src/main/java/sbtbiswas/AidenOnTheGo/features/bots/AidenBotActivity.kt: Updates outgoing bubble rendering to look sent immediately, adding a 2-second delay gate via rememberAidenBotSendWaitMs before presenting the "Sending…" caption.
  • android/app/src/test/java/sbtbiswas/AidenOnTheGo/features/bots/AidenBotChatPresentationTest.kt: Extends presentation unit tests to verify outgoing bubbles look sent before the 2-second threshold and show captions after.
  • ios/AidenOnTheGo/Features/Bots/AidenBotSessionChatView.swift: Introduces AidenBotSendWait to render outgoing messages as solid sent bubbles, deferring "Sending…" until the 2-second delay has elapsed.
  • ios/AidenOnTheGo/Features/Bots/AidenBotSessionModel.swift & ios/CHANGELOG.md: Defines sendingCaptionDelay and documents the unreleased iOS presentation update.
  • docs/plans/README.md, docs/plans/instant-ui-optimistic-updates-plan.md, & docs/superpowers/specs/2026-10-14-bot-chat-activity-design.md: Documents the optimistic send presentation and animation specifications.

Findings

No findings.

📊 Sequence Diagram
sequenceDiagram
    autonumber
    actor User
    participant Composer as Composer (UI)
    participant Pane as BotChatPane (Renderer)
    participant Bubble as BotPendingSendBubble
    participant Main as Main Process (IPC)

    User->>Composer: Click Send / Press Enter
    Composer->>Pane: onSend(text, attachments)
    Pane->>Pane: Measure origin in composerRef
    Pane->>Pane: echoSend(requestId, body) & setMorphing(requestId)
    Pane->>Bubble: Mount pending bubble (data-bot-message)
    Note over Bubble: Clone element floats & animates (90ms)<br/>Real bubble hidden until landed
    Pane->>Main: botsApi.send({ botId, text, requestId })

    alt Fast Mac acknowledgment (<2s)
        Main-->>Pane: Live event: user entry arrives
        Pane->>Pane: matchBotPendingSends() & swap in TranscriptEntries
        Main-->>Pane: bots:send response resolves
        Note over Bubble: No "Sending…" caption ever rendered
    else Slow / Offline (>2s)
        Note over Bubble: 2s timer elapses in useSlowSend
        Bubble-->>User: Displays "Sending…" caption below bubble
        Main-->>Pane: bots:send response resolves
        Pane->>Pane: settleEchoLater() marks accepted: true
        Bubble-->>User: "Sending…" caption removed
    end
Loading

Machine-Readable Findings

[]

Last reviewed commit: a8ba93da9d08
Reviews (1) · Comment /hermes review to trigger a new review · /hermes review full for full re-review

The sent words leave the composer and become their bubble over 360 ms:
a floating copy starts as bare text where the words sat and moves to the
bubble's place while its fill comes in. The real bubble holds its space
unseen until the copy lands, and an entry or queued row that answers the
send meanwhile stays unseen too, so the hand-over never shows twice.
Reduce Motion skips it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72
A steer joins the running reply, and the Mac's transcript draws it as a
normal user message; only a follow-up waits as Queued. The echo now takes
its look from the send's mode instead of from whether the Bot runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread renderer/main/bots/bot-chat-pane.tsx Resolved
The pending echoes were pruned in a post-paint effect, so the frame that
showed the arriving entry (or released one held during the send motion)
could draw the echo too. The pane now matches pending sends against the
snapshot while rendering and draws only the unsettled ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72

@pullfrog pullfrog 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.

Important

A reply that starts during the new send animation can appear above the pending user message, followed by a visible jump when the animation finishes.

Reviewed changes since the prior review at 0ca88c78, focusing on desktop send motion and its handoff to live transcript entries.

  • Added composer-to-bubble motion: Animated a floating bubble copy for 360 ms, with reduced-motion/no-layout bypasses and cancellation cleanup.
  • Held arriving messages: Kept pending echoes during motion and hid matching durable entries or queued rows until completion.
  • Extended reconciliation coverage: Added a holding/settlement helper test and documented the desktop motion behavior.

Validation: all 69 Bot pane tests, desktop TypeScript checking, and eslint on both changed desktop files passed. A Chromium harness using the real pane and styles with fake IPC reproduced the early-reply ordering and landing discontinuity described inline; the temporary harness was removed.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread renderer/main/bots/bot-chat-pane.tsx Resolved

@pullfrog pullfrog 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.

Important

No new issues found in the latest two commits. Approval remains withheld because the existing send-animation ordering finding is still unresolved; same-frame echo settlement does not address that ordering problem.

Reviewed changes since the prior review at ac3b9a97, covering busy-send presentation and render-time echo reconciliation.

  • Preserved Steer presentation: Passed the selected busy mode into the optimistic echo so Steer looks sent immediately while follow-ups remain Queued.
  • Added mounted Steer coverage: Exercised the real composer menu and verified both the outgoing mode and the pending message's presentation.
  • Settled echoes during rendering: Derived visible pending sends from snapshot matches, removing the duplicate handoff frame and using the same visible set for optimistic activity.

Validation: all 86 Bot pane and transcript-row tests passed, npx tsc --noEmit passed, and eslint passed on both changed desktop files. The delta does not change either native client. Browser animation/layout behavior was not rerun in this pass; the existing finding remains supported by the unchanged held-entry filtering and pending-row placement.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

The moving echo sits below the whole transcript while the entry that
answers it waits unseen. A reply drawn before the motion ended put the
message under its own reply until it landed. A hold now lasts only while
nothing is drawn after the arrival; otherwise the motion stops and the
entry shows in its place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes since the prior review at 72bd0f49, focusing on early-reply ordering and animation cleanup.

  • Ended motion before later content: Limited held arrivals to the final transcript position, so an arriving reply or partial reveals the real user message above it and unmounts the animated echo.
  • Added mounted motion coverage: Exercised normal animation completion and early cancellation, verifying a single user message remains before its reply.
  • Updated the plan: Documented early completion when reply content arrives during the send animation.

Validation: all 87 Bot pane and transcript-row tests passed; npx tsc --noEmit and eslint on both changed desktop files passed. Real-browser animation geometry was not rerun; the mounted test uses stubbed animation and composer bounds. This delta changes neither native client nor the Remote protocol.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

The owner found 360 ms too slow and asked for under 100 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72
The owner asked for the words to curve into place rather than slide
straight. The two axes now ease apart: across first, then up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes since the prior review at 02383f58, including the additional arc-motion commit that landed during this run.

  • Shortened send motion: Reduced the composer-to-bubble animation from 360 ms to 90 ms.
  • Separated axis easing: Animated horizontal and vertical movement independently to create an arc, retaining completion-driven handoff and cancelling both animations on cleanup.
  • Updated documentation: Recorded the shorter duration and curved motion in the optimistic-updates plan.

Validation: all 87 Bot pane and transcript-row tests passed on f6051c9a; eslint passed on both desktop files. Real-browser visual/layout checks were not rerun; mounted motion coverage uses stubbed Web Animations. Neither native client nor the Remote protocol changed in this delta.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

The owner asked for the motion to ease in and out. Both axes now use an
ease-in-out curve, the sideways one leading, so the arc stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RGyYhqJ7iggyzfzS72

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes since the prior review at f6051c9a, scoped to the send-animation easing adjustment.

  • Smoothed both axes: Changed the horizontal and vertical curves to ease in and out while preserving the horizontal lead, 90 ms duration, and existing completion/cancellation behavior.
  • Updated motion documentation: Recorded the per-axis easing in the optimistic-updates plan.

Validation: all 87 Bot pane and transcript-row tests passed; eslint passed on both desktop files. Real-browser visual checks were not rerun, and the mounted motion tests stub Web Animations. Neither native client nor the Remote protocol changed in this delta.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@sambitcreate
sambitcreate merged commit e41e64d into main Oct 27, 2026
26 checks passed
@sambitcreate
sambitcreate deleted the claude/project-thread-ojva86 branch October 27, 2026 05:57
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.

3 participants