Skip to content

AI Chat: disable clear button when chat is empty#33877

Open
dmirgaev wants to merge 6 commits into
DevExpress:26_1from
dmirgaev:26_1__ai_chat_clear_button
Open

AI Chat: disable clear button when chat is empty#33877
dmirgaev wants to merge 6 commits into
DevExpress:26_1from
dmirgaev:26_1__ai_chat_clear_button

Conversation

@dmirgaev

@dmirgaev dmirgaev commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@dmirgaev dmirgaev self-assigned this Jun 5, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 16:11
@dmirgaev dmirgaev requested a review from a team as a code owner June 5, 2026 16:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 changed event 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.

Comment thread packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts Outdated
@dmirgaev dmirgaev force-pushed the 26_1__ai_chat_clear_button branch from a5808ca to e7de868 Compare June 8, 2026 12:28
Copilot AI review requested due to automatic review settings June 8, 2026 13:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts Outdated
@Alyar666 Alyar666 self-assigned this Jun 8, 2026
@Alyar666 Alyar666 self-requested a review June 8, 2026 14:04
dmirgaev and others added 5 commits June 8, 2026 22:01
- 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
Copilot AI review requested due to automatic review settings June 8, 2026 19:25
@Alyar666 Alyar666 force-pushed the 26_1__ai_chat_clear_button branch from e67f86b to 3ceb67e Compare June 8, 2026 19:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

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