Skip to content

fix(chat): stabilize assistant loading state - #1869

Merged
yyhhyyyyyy merged 1 commit into
devfrom
fix/assistant-loading-placeholder
Jul 3, 2026
Merged

fix(chat): stabilize assistant loading state#1869
yyhhyyyyyy merged 1 commit into
devfrom
fix/assistant-loading-placeholder

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Show the pending assistant placeholder for command submits and clear command composer state before the send route resolves.

Summary by CodeRabbit

  • New Features

    • Assistant responses now show an immediate loading placeholder after normal message and command submissions.
    • The placeholder appears inline, is cleared when the real response starts, and is removed if sending fails.
    • Queued turns and manual compaction actions won’t show a placeholder.
  • Documentation

    • Updated the related issue documentation to reflect the implemented behavior and revised acceptance details.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d962137d-2f9e-411d-8931-edc1b0517f99

📥 Commits

Reviewing files that changed from the base of the PR and between 673a79f and a9e9fd2.

📒 Files selected for processing (5)
  • docs/issues/assistant-loading-placeholder-delay/plan.md
  • docs/issues/assistant-loading-placeholder-delay/spec.md
  • docs/issues/assistant-loading-placeholder-delay/tasks.md
  • src/renderer/src/pages/ChatPage.vue
  • test/renderer/components/ChatPage.test.ts
💤 Files with no reviewable changes (2)
  • docs/issues/assistant-loading-placeholder-delay/tasks.md
  • docs/issues/assistant-loading-placeholder-delay/plan.md

📝 Walkthrough

Walkthrough

This PR implements an immediate assistant loading placeholder for non-queued user and command submits in ChatPage.vue, refactoring submit logic into shared helper functions, updating the feature spec to "implemented," removing stale planning docs, and expanding test coverage.

Changes

Assistant loading placeholder implementation

Layer / File(s) Summary
Spec status and acceptance criteria
docs/issues/assistant-loading-placeholder-delay/spec.md, docs/issues/assistant-loading-placeholder-delay/plan.md, docs/issues/assistant-loading-placeholder-delay/tasks.md
Spec status changed to implemented, "Current Behavior" renamed to "Original Behavior," acceptance criteria expanded for command submits and manual compaction exclusion; stale plan.md and tasks.md removed.
Shared outgoing-turn feedback helpers
src/renderer/src/pages/ChatPage.vue
Adds SendMessageInput import and two helpers, beginOutgoingTurnFeedback and sendMessageWithOutgoingTurnFeedback, that create optimistic messages, start pending assistant placeholders, send messages, and clear state on failure; wires them into onSubmit and onCommandSubmit non-generating branches.
Placeholder and queued/compaction test coverage
test/renderer/components/ChatPage.test.ts
Adds/updates tests verifying pending assistant row presence for submit and command-submit, absence for queued and manual compaction cases, composer state clearing before send resolves, and cleanup on send failure.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ChatPage
  participant messageStore
  participant agentPlanStore
  participant chatClient

  User->>ChatPage: onSubmit / onCommandSubmit
  ChatPage->>messageStore: addOptimisticUserMessage
  ChatPage->>agentPlanStore: beginTurn (pending assistant placeholder)
  ChatPage->>ChatPage: clear input/attachments/skills, schedule scroll
  ChatPage->>chatClient: sendMessage
  alt send fails
    chatClient-->>ChatPage: error
    ChatPage->>agentPlanStore: clear pending placeholder
    ChatPage->>messageStore: removeOptimisticMessage
  else send succeeds
    chatClient-->>ChatPage: stream starts
  end
Loading

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1732: Both PRs modify the onSubmit/onCommandSubmit submission logic in ChatPage.vue, with #1732 handling post-submit scrolling behavior that this PR's refactor also incorporates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: stabilizing the chat assistant loading state during submissions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/assistant-loading-placeholder

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.

@yyhhyyyyyy
yyhhyyyyyy merged commit bd85fe8 into dev Jul 3, 2026
3 checks passed
@zhangmo8
zhangmo8 deleted the fix/assistant-loading-placeholder branch July 7, 2026 05:47
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