Skip to content

feat(frontend): add stop button to cancel streaming response#486

Merged
bjrump merged 2 commits into
mainfrom
issue-484
Jun 22, 2026
Merged

feat(frontend): add stop button to cancel streaming response#486
bjrump merged 2 commits into
mainfrom
issue-484

Conversation

@bot-kiwi

@bot-kiwi bot-kiwi Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a Stop button to cancel streaming AI responses. When the assistant is generating a response, users can now click the Stop button (replacing the Send button) to abort the stream instead of waiting for it to complete. The partial message remains in place after stopping.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation update
  • CI/CD or infrastructure change

Changes Made

  • Added stop to the useChat destructuring in ProjectChat.tsx
  • Replaced Send button with Stop button (Square icon) when isAssistantTyping is true
  • Added stop.response i18n key in both de.json and en.json with appropriate translations
  • Stop button uses aria-label via the i18n string for accessibility

Related Issues

Closes #484

Supersedes PR #485 (closed without merging).

Testing

  • I have tested these changes locally
  • I have added/updated tests as appropriate
  • All existing tests pass

Checklist

  • My code follows the project's coding standards
  • I have updated documentation as needed
  • I have run make generate if SQL queries were modified (backend)
  • I have updated barrel exports if components were added (frontend)

Screenshots (if applicable)

Hermes Agent added 2 commits June 22, 2026 14:53
- Add stop() from useChat to destructure
- Add conditional Stop button visible only while isAssistantTyping
- Stop button replaces send button during streaming
- Call stop() on click to cancel the AI response

Closes #484
@bot-kiwi
bot-kiwi Bot requested a review from bjrump as a code owner June 22, 2026 13:29
@bot-kiwi bot-kiwi Bot added enhancement New feature or request frontend labels Jun 22, 2026
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a Stop button to cancel in-flight streaming AI responses, swapping the Send button for a Square icon button while isAssistantTyping is true. The change is minimal and well-scoped.

  • stop is destructured from useChat and called on click; isAssistantTyping is correctly removed from the Send button's disabled check in the else branch since the button is only rendered when the condition is already false.
  • The new stop.response i18n key is added to both en.json and de.json, matching the placement and naming pattern of neighboring keys like stop.recording.

Confidence Score: 5/5

Safe to merge — the change is a small, self-contained UI toggle that adds a Stop button when the assistant is streaming and restores the Send button otherwise.

All three modified files have clean, focused changes: the component correctly conditions on isAssistantTyping, removes the now-redundant guard from the Send button's disabled list, and the i18n additions are consistent with neighboring keys. No logic paths or state transitions appear broken.

No files require special attention.

Important Files Changed

Filename Overview
apps/frontend/components/chat/ProjectChat.tsx Destructures stop from useChat and replaces the Send button with a Stop button (Square icon) when isAssistantTyping is true; the isAssistantTyping guard is correctly removed from the Send button's disabled check in the else branch.
apps/frontend/messages/en.json Adds stop.response i18n key with value "Stop response".
apps/frontend/messages/de.json Adds stop.response i18n key with German translation "Antwort stoppen".

Reviews (1): Last reviewed commit: "fix(frontend): add missing stop.response..." | Re-trigger Greptile

@bjrump
bjrump added this pull request to the merge queue Jun 22, 2026
Merged via the queue into main with commit 76a9fd3 Jun 22, 2026
5 checks passed
@bjrump
bjrump deleted the issue-484 branch June 22, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Stop button to cancel a streaming response

1 participant