Skip to content

fix(chat): hide a queued held message for up to 1 s before showing it - #483

Open
andrebrait wants to merge 2 commits into
mainfrom
fix/queued-held-delay
Open

andrebrait wants to merge 2 commits into
mainfrom
fix/queued-held-delay

Conversation

@andrebrait

@andrebrait andrebrait commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

A follow-up or steer sent during a run is held in the outbox and drawn as a held bubble until omp's queue_update turns it into a queue chip, so it flashed in the chat first.

  • HeldMessageView hides a follow-up/steer bubble that is still sending, held or delivering for 1 s after it mounts. If omp has not taken it by then, it appears with its delivery status.
  • Failed and waiting-for-host bubbles (known not queued) and idle prompts (Send) show at once. Once shown, a bubble stays shown.
  • A late reveal re-runs the hook's follow-scroll effect (followHeldMessages), so a reader at the bottom sees it.

Tests: new MessageView.test.mjs case pins the 1000 ms with mock timers (mutating the delay to 10 ms fails it); MessageView, useAgentSession.rpc and ChatWindow* suites pass (385/0); typecheck and lint clean.

Summary by CodeRabbit

  • Bug Fixes
    • Queued follow-up and steer messages now appear after a brief delay of up to one second, reducing premature display while delivery is in progress.
    • Messages appear immediately when the host is offline or delivery fails. Idle prompts continue to appear immediately.
    • Once a queued message is revealed, it remains visible as its delivery status changes.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11163cbc-2bc2-4e56-a5d9-95caee4c8212
Commits

Reviewing files that changed from the base of the PR and between 546a945 and 31f9e65.

Files selected for processing: 5

  • CHANGELOG.md
  • components/ChatWindow.tsx
  • components/MessageView.test.mjs
  • components/MessageView.tsx
  • hooks/useAgentSession.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: CodeRabbit
  • GitHub Check: Verify (ubuntu-latest)
  • GitHub Check: Verify (windows-latest)
Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 2

Source excerpt: A module under test that must see a fake builtin is imported with a fresh query (`?fresh=N`) after `mockBuiltin(t, name, overrides)` (`tests/mock-builtin.mjs`, built on `mock.module`; Bun's `mock.restore()` does not undo `mo...

CodeRabbit inference engine (AGENTS.md)

Files:

  • components/MessageView.test.mjs
Source excerpt: `components/ui/` holds the shared primitives (built on `@base-ui/react`): `primitives.tsx` (Dialog/Tooltip/Collapsible), `field.tsx` (form fields + ConfirmDialog), `toast.tsx` (`toast.success/error/info`, mounted in AppShell...

CodeRabbit inference engine (AGENTS.md)

Files:

  • components/ChatWindow.tsx
  • components/MessageView.test.mjs
  • components/MessageView.tsx
Additional comments: 5

components/MessageView.tsx: 1

533-558: LGTM!

hooks/useAgentSession.ts: 1

4459-4460: LGTM!

Also applies to: 4966-4966

components/ChatWindow.tsx: 1

467-467: LGTM!

Also applies to: 1343-1343

components/MessageView.test.mjs: 1

50-78: LGTM!

CHANGELOG.md: 1

52-52: LGTM!

Walkthrough

Held follow-up and steer messages now remain hidden for up to one second before appearing. Prompts, failed messages, and messages waiting for a host appear immediately. Revealing a message triggers the held-message follow-scroll action.

Changes: Held-Message Reveal

Layer / File(s) Summary
Delayed reveal and follow-scroll
components/MessageView.tsx, hooks/useAgentSession.ts, components/ChatWindow.tsx, components/MessageView.test.mjs, CHANGELOG.md
HeldMessageView delays selected messages and calls onReveal when they appear. ChatWindow passes the session callback, which increments the held follow-scroll counter. Tests cover visibility by message state and persistence after state changes. The changelog documents the delay and immediate-display cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant HeldMessageView
  participant ChatWindow
  participant useAgentSession
  ChatWindow->>HeldMessageView: Pass followHeldMessages as onReveal
  HeldMessageView->>ChatWindow: Call onReveal after delayed reveal
  ChatWindow->>useAgentSession: Invoke followHeldMessages
  useAgentSession->>useAgentSession: Increment heldFollow for follow-scroll
Loading

Suggested reviewers: kahme247, gtanger

Merge Risk: Minimal · up to 31f9e

Held follow-up and steer bubbles now stay hidden for up to one second before appearing, and the chat scrolls to them when they are revealed. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a queued follow-up or steer message is hidden for up to 1 second before it appears. The title uses the fix(chat) prefix and matches the MessageView, ChatWindow, and us…
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.
Full details: Title check

Explanation

The title names the main change: a queued follow-up or steer message is hidden for up to 1 second before it appears. The title uses the fix(chat) prefix and matches the MessageView, ChatWindow, and useAgentSession changes. The title does not mention the follow-scroll reveal behavior added in the second commit, but that detail is secondary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit watches queued words wait,
One second passes by the gate.
The held words hop into the chat,
A scroll follows after that.
Prompts pop in without delay,
Then off the rabbit bounds away!

@kilo-code-bot

kilo-code-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Code Review Roast 🔥

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. The only jump-scare was my environment rejecting some read-only file reads, so I reviewed from the PR diff and metadata rather than spelunking every surrounding line like I usually do.

📊 Overall: Like a delayed toast notification that finally behaves — restrained, on time, and not yelling “I EXIST” a millisecond too early.

Files Reviewed (5 files)
  • CHANGELOG.md
  • components/ChatWindow.tsx
  • components/MessageView.test.mjs
  • components/MessageView.tsx
  • hooks/useAgentSession.ts

Reviewed by free · Input: 28.4K · Output: 1.1K · Cached: 52.7K

This branch has not been deployed

No deployments
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