Skip to content

DataGrid - ✨AI: AI assistant - AIChat: Implement the disabled state#33462

Open
Alyar666 wants to merge 1 commit intoDevExpress:26_1from
Alyar666:datagrid_ai_assistant_disabled_state_26_1
Open

DataGrid - ✨AI: AI assistant - AIChat: Implement the disabled state#33462
Alyar666 wants to merge 1 commit intoDevExpress:26_1from
Alyar666:datagrid_ai_assistant_disabled_state_26_1

Conversation

@Alyar666
Copy link
Copy Markdown
Contributor

No description provided.

@Alyar666 Alyar666 self-assigned this Apr 30, 2026
Copilot AI review requested due to automatic review settings April 30, 2026 02:24
@Alyar666 Alyar666 requested a review from a team as a code owner April 30, 2026 02:24
@Alyar666 Alyar666 added the 26_1 label Apr 30, 2026
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

Implements a disabled/busy state for the DataGrid AI Assistant chat UI so user input/actions can be blocked while an AI request is in progress.

Changes:

  • Added setDisabled/isDisabled to AIChat, disabling message input, speech-to-text, clear-chat, and regenerate actions while busy.
  • Updated AI Assistant view/controller flow to disable chat during sendRequestToAI and re-enable on completion.
  • Added Jest coverage and SCSS styling for the disabled state.

Reviewed changes

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

Show a summary per file
File Description
packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Minor safe-access refactor in getWidgetInstance.
packages/devextreme/js/__internal/grids/grid_core/ai_chat/const.ts Added disabled-related class names/selectors for AIChat.
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts Implemented disabled state toggling and UI disabling hooks.
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.test.ts Added tests for AIChat disabled behavior (widgets/buttons/regenerate).
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts Disabled chat while an AI request is running, re-enabled on completion.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_controller.ts Changed sendRequestToAI to return a Promise for request lifecycle tracking.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_view.test.ts Added tests ensuring chat disable/enable behavior around requests.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_controller.test.ts Updated/added tests for Promise resolve/reject behavior.
packages/devextreme-scss/scss/widgets/base/gridBase/layout/aiChat/_index.scss Added styling to visually/interaction-disable parts of the chat UI.

Comment on lines +105 to 130
public sendRequestToAI(message: Message): Promise<void> {
const aiMessageId = this.createPendingAIMessage(message);

this.aiAssistantIntegrationController?.sendRequest(message.text, {
onComplete: (response: ExecuteGridAssistantCommandResult): void => {
fromPromise(this.processResponse(response))
.done((commands: CommandResults) => {
this.completeAIMessage(aiMessageId, commands);
})
.fail((errorMessage) => {
const error = errorMessage instanceof Error
? errorMessage
: new Error(String(errorMessage));

this.failAIMessage(aiMessageId, error);
});
},
onError: (error: Error): void => {
this.failAIMessage(aiMessageId, error);
},
return new Promise((resolve, reject) => {
this.aiAssistantIntegrationController?.sendRequest(message.text, {
onComplete: (response: ExecuteGridAssistantCommandResult): void => {
fromPromise(this.processResponse(response))
.done((commands: CommandResults) => {
this.completeAIMessage(aiMessageId, commands);
resolve();
})
.fail((errorMessage) => {
const error = errorMessage instanceof Error
? errorMessage
: new Error(String(errorMessage));

this.failAIMessage(aiMessageId, error);
reject(error);
});
},
onError: (error: Error): void => {
this.failAIMessage(aiMessageId, error);
reject(error);
},
});
});
Comment on lines +306 to +311
this.setTextAreaDisabled(disabled);
this.setSpeechToTextDisabled(disabled);

if (this.options.onChatCleared) {
this.popupInstance.option('toolbarItems[0].options.disabled', disabled);
}
Comment on lines +43 to 46
textArea: '.dx-textarea',
speechToTextButton: '.dx-speech-to-text',
};

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.

2 participants