Skip to content

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

Closed
bot-kiwi[bot] wants to merge 2 commits into
mainfrom
issue-484
Closed

feat(frontend): add stop button to cancel streaming response#485
bot-kiwi[bot] wants to merge 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 to abort the stream instead of waiting for it to complete.

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 destructure in ProjectChat.tsx
  • Added conditional Stop button that renders only while isAssistantTyping is true
  • Stop button replaces the Send button during streaming, calling stop() on click

Related Issues

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) - Added Square icon import

- 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 12:53
@bot-kiwi

bot-kiwi Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@greptile review

@m43i m43i 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 that cancels a streaming AI response. When isAssistantTyping is true the Send button is replaced by a Stop button that calls stop() from @ai-sdk/react's useChat; both locale files receive the required stop.response translation key.

  • The conditional swap between Send and Stop correctly removes the now-redundant isAssistantTyping guard from the Send button's disabled prop.
  • stop.response is added to both en.json and de.json, so the screen-reader label is properly localised.
  • The Square icon is imported in alphabetical order consistent with the existing import block.

Confidence Score: 5/5

The change is small and self-contained: it adds a stop button that calls the existing stop() hook, swaps button rendering based on isAssistantTyping, and adds the two missing i18n keys.

All three changed files are straightforward. The logic correctly mirrors the isAssistantTyping flag already used elsewhere in the component, the translation keys are present in both locales, and no existing guards were unintentionally dropped.

No files require special attention.

Important Files Changed

Filename Overview
apps/frontend/components/chat/ProjectChat.tsx Adds stop from useChat and swaps the Send button for a Stop button while isAssistantTyping is true; the isAssistantTyping guard is correctly removed from the Send button's disabled list since the button is now hidden during streaming.
apps/frontend/messages/en.json Adds the stop.response translation key required by the new Stop button.
apps/frontend/messages/de.json Adds the German stop.response translation key alongside its English counterpart.

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

Comment thread apps/frontend/components/chat/ProjectChat.tsx
Comment thread apps/frontend/components/chat/ProjectChat.tsx
Comment thread apps/frontend/components/chat/ProjectChat.tsx
@bot-kiwi

bot-kiwi Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@greptile review

@OFFIS-RIT OFFIS-RIT deleted a comment from greptile-apps Bot Jun 22, 2026
@bjrump bjrump closed this Jun 22, 2026
@bjrump
bjrump deleted the issue-484 branch June 22, 2026 13:18
@bjrump bjrump changed the title feat(frontend): add stop button to cancel streaming response (fixes #484) feat(frontend): add stop button to cancel streaming response Jun 22, 2026
@bot-kiwi
bot-kiwi Bot restored the issue-484 branch June 22, 2026 13:29
@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.

2 participants