Skip to content

AI Assistant: Add deselect option to selectByIndexes command#33790

Open
dmirgaev wants to merge 2 commits into
DevExpress:26_1from
dmirgaev:26_1__unselect_certain_row
Open

AI Assistant: Add deselect option to selectByIndexes command#33790
dmirgaev wants to merge 2 commits into
DevExpress:26_1from
dmirgaev:26_1__unselect_certain_row

Conversation

@dmirgaev
Copy link
Copy Markdown
Contributor

@dmirgaev dmirgaev commented Jun 2, 2026

No description provided.

@dmirgaev dmirgaev self-assigned this Jun 2, 2026
Copilot AI review requested due to automatic review settings June 2, 2026 12:29
@dmirgaev dmirgaev requested a review from a team as a code owner June 2, 2026 12:29
@github-actions github-actions Bot added the .d.ts label Jun 2, 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

This PR extends the grid AI Assistant’s selectByIndexes command to support deselecting rows (in addition to selecting them) by introducing a deselect boolean flag and wiring it through schema validation, execution logic, and public TypeScript types.

Changes:

  • Added a deselect: boolean argument to the selectByIndexes predefined command type definitions.
  • Updated selectByIndexes command implementation to call deselectRows (via index→key resolution) when deselect is true.
  • Expanded Jest coverage for schema validation, deselect execution path, and default messages.

Reviewed changes

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

File Description
packages/devextreme/ts/dx.all.d.ts Updates aggregated public typings for selectByIndexes to include deselect.
packages/devextreme/js/common/grids.d.ts Updates source public typings (PredefinedCommands) for selectByIndexes to include deselect.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/selection.ts Extends the command schema and execution logic to support deselection; updates command description and default message.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/tests/selection.test.ts Updates/extends unit tests to cover the new deselect flag behavior.

Copilot AI review requested due to automatic review settings June 2, 2026 14:25
@dmirgaev dmirgaev force-pushed the 26_1__unselect_certain_row branch from 6a3280a to 3604110 Compare June 2, 2026 14:25
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

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

@anna-shakhova anna-shakhova self-requested a review June 2, 2026 14:58

const selectByIndexesCommandSchema = z.object({
indexes: z.array(z.number().int().min(1)).min(1),
deselect: z.boolean().optional(),
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.

use optionalNullish instead of optional - it allows null values and sanitize them on parse, which is necessary for proper work in strict mode

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.

3 participants