AI Chat: disable clear button when chat is empty#33877
Open
dmirgaev wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the internal DataGrid AI Chat popup so the “Clear chat” toolbar button is disabled when there are no chat messages, and automatically toggles enabled/disabled as the chat’s underlying data changes.
Changes:
- Initialize the clear-chat button as disabled by default.
- Track the chat dataSource
changedevent and recompute the clear button’s disabled state based on message presence. - Extend Jest coverage to verify correct button state for empty/non-empty chats and after toggling the chat disabled state.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts |
Hooks dataSource changed to keep clear button disabled when the chat is empty. |
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.test.ts |
Adds tests for clear button initial state and updates on data source changes / disabled toggling. |
anna-shakhova
requested changes
Jun 8, 2026
a5808ca to
e7de868
Compare
- Extract rebindChatDataSource helper to dedupe unsubscribe/cache/resubscribe logic in AIChat - Bind updateClearChatButtonDisabled before popup creation so a synchronous contentTemplate (popup.visible: true) registers a bound handler instead of losing this - Guard aiChatInstance.dispose with optional chaining in AIAssistantView so disposing a view before its first render no longer throws - Add jest coverage for the rebind path via updateOptions, AIChat dispose, AIAssistantView dispose without render, and the synchronous contentTemplate regression
e67f86b to
3ceb67e
Compare
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.