Skip to content

Block making AI chat calls for pending statuses #877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2025

Conversation

rSnapkoOpenOps
Copy link
Contributor

@rSnapkoOpenOps rSnapkoOpenOps commented Jun 27, 2025

Copy link

linear bot commented Jun 27, 2025

@rSnapkoOpenOps rSnapkoOpenOps marked this pull request as ready for review June 27, 2025 16:16
@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 16:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR prevents new AI chat requests from being submitted while a previous request is still pending or streaming.

  • Adds a status prop to chat containers to be forwarded to the input component
  • Introduces a shared ChatStatus constant in ai-chat-input.tsx and uses it to disable the send button
  • Removes duplicate ChatStatus definitions in React UI and imports the shared constant

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/ui-components/src/components/ai-chat-container/step-settings-ai-chat-container.tsx Pass status down to the input component
packages/ui-components/src/components/ai-chat-container/ai-chat-input.tsx Export ChatStatus, add status prop, disable send button on pending statuses
packages/ui-components/src/components/ai-chat-container/ai-assistant-chat-container.tsx Pass status down to the input component
packages/react-ui/src/app/features/builder/ai-chat/step-settings-ai-conversation.tsx Remove local ChatStatus, import from shared UI package
packages/react-ui/src/app/features/ai/ai-assistant-conversation.tsx Remove local ChatStatus, import from shared UI package
Comments suppressed due to low confidence (3)

packages/ui-components/src/components/ai-chat-container/ai-chat-input.tsx:17

  • [nitpick] The prop name status is quite generic; consider renaming it to chatStatus for clarity and to avoid naming collisions in parent components.
  status?: string;

packages/ui-components/src/components/ai-chat-container/ai-chat-input.tsx:60

  • Add unit or integration tests to verify that the send button is properly disabled when status is STREAMING or SUBMITTED, and enabled otherwise.
          disabled={

packages/ui-components/src/components/ai-chat-container/step-settings-ai-chat-container.tsx:288

  • Ensure the StepSettingsAiChatContainer props interface includes status, otherwise TypeScript will report a missing prop error when forwarding it to AiChatInput.
            status={status}

export type AiChatInputProps = {
className?: string;
placeholder?: string;
status?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think Copilot's remark is legit, I think it should not be string, but a type based on ChatStatus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link

@rSnapkoOpenOps rSnapkoOpenOps merged commit 03f6f9d into main Jun 30, 2025
19 checks passed
@rSnapkoOpenOps rSnapkoOpenOps deleted the feat/block-ai-chat-when-loading branch June 30, 2025 07:16
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.

2 participants