DataGrid - AI Assistant: Remove the onChatCleared callback#33563
Open
Alyar666 wants to merge 1 commit into
Open
DataGrid - AI Assistant: Remove the onChatCleared callback#33563Alyar666 wants to merge 1 commit into
Alyar666 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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
onChatClearedfromAIChatOptionsand made the clear button always present; clicking it now callsAIChat.clear(). - Introduced
AIMessageandisAIMessagetype 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
pendingand 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. |
541e90a to
a438135
Compare
dmirgaev
reviewed
May 12, 2026
dmirgaev
approved these changes
May 12, 2026
anna-shakhova
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.