Skip to content

DataGrid - AI Assistant: Remove the onChatCleared callback#33563

Open
Alyar666 wants to merge 1 commit into
DevExpress:26_1from
Alyar666:datagrid_ai_assistant_remove_onChatCleared_26_1
Open

DataGrid - AI Assistant: Remove the onChatCleared callback#33563
Alyar666 wants to merge 1 commit into
DevExpress:26_1from
Alyar666:datagrid_ai_assistant_remove_onChatCleared_26_1

Conversation

@Alyar666
Copy link
Copy Markdown
Contributor

No description provided.

@Alyar666 Alyar666 self-assigned this May 12, 2026
Copilot AI review requested due to automatic review settings May 12, 2026 18:55
@Alyar666 Alyar666 requested a review from a team as a code owner May 12, 2026 18:55
Copy link
Copy Markdown
Contributor

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 updates the DataGrid AI Assistant chat integration by removing the onChatCleared option/callback and shifting “clear chat” behavior into the AIChat component itself, while also improving regenerate flow by passing the originating AI message back to the controller so it can re-run the original prompt and reset the message state.

Changes:

  • Removed onChatCleared from AIChatOptions and made the clear button always present; clicking it now calls AIChat.clear().
  • Introduced AIMessage and isAIMessage type guard to consistently identify assistant messages and to pass the AI message into the regenerate callback.
  • Updated controller/view logic and tests so regeneration resets an existing message to pending and resends the stored prompt.

Reviewed changes

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

Show a summary per file
File Description
packages/devextreme/js/__internal/grids/grid_core/ai_chat/utils.ts Removes isAIChatMessage, loosens helpers to accept undefined inputs, and keeps message-state utilities.
packages/devextreme/js/__internal/grids/grid_core/ai_chat/types.ts Removes onChatCleared, changes onRegenerate signature to receive an AIMessage.
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts Clear button now always clears internally; regenerate now passes the message; uses isAIMessage guard.
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.test.ts Updates clear-button expectations and adds a click test validating clear() behavior.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/utils.ts Adds isAIMessage type guard based on assistant author id.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/types.ts Introduces AIMessage type to model assistant messages (status/header/prompt/etc.).
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts Routes regeneration through a shared executeRequest helper; removes onChatCleared wiring.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_controller.ts Refactors pending message creation to return AIMessage, supports regenerate by resetting an existing message to pending and resending its prompt.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/utils.test.ts Adds unit tests for the new isAIMessage helper.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_view.test.ts Updates view tests to reflect new regenerate flow and removal of isProcessing/onChatCleared.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_view_controller.integration.test.ts Adds integration coverage ensuring regenerate resets status to pending and completes successfully.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_controller.test.ts Adds controller coverage for “ignore concurrent request” and for regenerate behavior via AIMessage.

@Alyar666 Alyar666 force-pushed the datagrid_ai_assistant_remove_onChatCleared_26_1 branch from 541e90a to a438135 Compare May 12, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants