Skip to content

Conversation

@dmlvr
Copy link
Contributor

@dmlvr dmlvr commented Nov 26, 2025

No description provided.

@dmlvr dmlvr self-assigned this Nov 26, 2025
Copilot AI review requested due to automatic review settings November 26, 2025 14:37
@dmlvr dmlvr requested a review from a team as a code owner November 26, 2025 14:37
@dmlvr dmlvr added the 25_2 label Nov 26, 2025
Copy link
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

This PR fixes an issue where the AI prompt editor would enter an endless loading state when a user edits a prompt and then rolls back the changes to the original value. The fix adds a check to prevent triggering the loading state and column option updates when the prompt value hasn't actually changed.

Key changes:

  • Added early return in onSubmit handler when prompt value hasn't changed from the original
  • Added comprehensive test coverage for the new behavior with two test cases
  • Included temporary debug logging for troubleshooting

Reviewed changes

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

File Description
packages/devextreme/js/__internal/grids/grid_core/ai_column/views/m_ai_prompt_editor_view.ts Added change detection logic in onSubmit to prevent unnecessary state updates and API calls when prompt hasn't changed; includes temporary debug console.log statements
packages/devextreme/js/__internal/grids/grid_core/ai_column/views/m_ai_prompt_editor_view.test.ts Added two new test cases to verify that loading state is not triggered when prompt is unchanged and is properly triggered when prompt changes

Copilot AI review requested due to automatic review settings November 27, 2025 13:04
Copy link
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

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

height: 110,
stylingMode: 'outlined',
onValueChanged: (e): void => {
if (e.value === this.prompt) {
Copy link
Contributor

@Alyar666 Alyar666 Nov 27, 2025

Choose a reason for hiding this comment

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

I think you can write it more simply:
this.updateButtonOption(APPLY_BUTTON_INDEX, 'disabled', !e.value || e.value === this.prompt);
this.updateButtonOption(REGENERATE_DATA_BUTTON_INDEX, 'disabled', !e.value || e.value !== this.prompt);

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also move the e.value === this.prompt condition to a separate variable. For example, isValueChanged.

Copy link
Contributor Author

@dmlvr dmlvr Nov 27, 2025

Choose a reason for hiding this comment

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

thank you! Did it

Copilot AI review requested due to automatic review settings November 27, 2025 14:00
Copy link
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

@dmlvr dmlvr merged commit c4851b0 into DevExpress:25_2 Nov 27, 2025
124 of 128 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants