DataGrid - ✨AI: AI assistant - AIChat: Implement the disabled state#33462
Open
Alyar666 wants to merge 1 commit intoDevExpress:26_1from
Open
DataGrid - ✨AI: AI assistant - AIChat: Implement the disabled state#33462Alyar666 wants to merge 1 commit intoDevExpress:26_1from
Alyar666 wants to merge 1 commit intoDevExpress:26_1from
Conversation
Contributor
There was a problem hiding this comment.
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/isDisabledto AIChat, disabling message input, speech-to-text, clear-chat, and regenerate actions while busy. - Updated AI Assistant view/controller flow to disable chat during
sendRequestToAIand 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', | ||
| }; | ||
|
|
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.