From 8eccc5c3d4be34cd40a254313c5fdf7582c78c59 Mon Sep 17 00:00:00 2001 From: Diana Gromova <72144169+16adianay@users.noreply.github.com> Date: Fri, 9 Oct 2026 17:23:50 +0400 Subject: [PATCH 1/3] Fix a mixed use case --- .../Chat/PageLevelAIAssistant/Angular/app/app.service.ts | 4 ++-- apps/demos/Demos/Chat/PageLevelAIAssistant/Vue/chatRouter.ts | 4 ++-- apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts b/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts index e24da4a89d5b..535a62511542 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts @@ -124,6 +124,8 @@ function buildGridResultsPromise( const columnNames = getGridColumnNames(gridInstance); const prompt = `${buildGridSystemPrompt(columnNames)}\n\nUser request: '${text}'`; + gridInstance?.instance.beginCustomLoading(''); + return executeAiCommand(prompt, aiIntegration) .then((parsed) => { const actions = Array.isArray((parsed as { actions?: ExecuteGridAssistantAction[] })?.actions) @@ -219,8 +221,6 @@ async function runCommand( } if (target === 'grid') { - gridInstance?.instance.beginCustomLoading(''); - const { results: gridResults, error: gridError } = await buildGridResultsPromise(gridInstance, aiIntegration, text); return joinSucceededOrThrow(gridResults, gridError); diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/Vue/chatRouter.ts b/apps/demos/Demos/Chat/PageLevelAIAssistant/Vue/chatRouter.ts index 4d711a1d243c..06e09175c776 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/Vue/chatRouter.ts +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/Vue/chatRouter.ts @@ -126,6 +126,8 @@ function buildGridResultsPromise( const columnNames = getGridColumnNames(gridInstance); const prompt = `${buildGridSystemPrompt(columnNames)}\n\nUser request: '${text}'`; + gridInstance?.beginCustomLoading(''); + return executeAiCommand(prompt, aiIntegration) .then((parsed) => { const actions = Array.isArray((parsed as { actions?: ExecuteGridAssistantAction[] })?.actions) @@ -221,8 +223,6 @@ async function runCommand( } if (target === 'grid') { - gridInstance?.beginCustomLoading(''); - const { results: gridResults, error: gridError } = await buildGridResultsPromise(gridInstance, aiIntegration, text); return joinSucceededOrThrow(gridResults, gridError); diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js b/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js index a600327f0824..6f0ac4ef4c61 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js @@ -811,6 +811,8 @@ function buildGridResultsPromise(gridInstance, aiIntegration, text) { const columnNames = getGridColumnNames(gridInstance); const prompt = `${buildGridSystemPrompt(columnNames)}\n\nUser request: '${text}'`; + gridInstance?.beginCustomLoading(''); + return executeAiCommand(prompt, aiIntegration) .then((parsed) => { const actions = Array.isArray(parsed.actions) ? parsed.actions : []; @@ -906,8 +908,6 @@ async function runCommand(text, { form, gridInstance, aiIntegration }) { } if (target === 'grid') { - gridInstance?.beginCustomLoading(''); - const { results: gridResults, error: gridError } = await buildGridResultsPromise(gridInstance, aiIntegration, text); From e60bfb1b5a2e6ea1613a6ec3e4ab4da16df3c1db Mon Sep 17 00:00:00 2001 From: Diana Gromova <72144169+16adianay@users.noreply.github.com> Date: Fri, 9 Oct 2026 17:28:04 +0400 Subject: [PATCH 2/3] Fix default form target to smart_paste when formAction is missing https://github.com/DevExpress/DevExtreme/pull/35603#discussion_r4230333514 --- .../Chat/PageLevelAIAssistant/Angular/app/app.service.ts | 2 +- .../Demos/Chat/PageLevelAIAssistant/React/chat-router.ts | 2 +- .../Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js | 2 +- apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts b/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts index 535a62511542..8c22123a59f7 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/Angular/app/app.service.ts @@ -215,7 +215,7 @@ async function runCommand( } if (target === 'form') { - const { results: formResults, error: formError } = await buildFormResultsPromise(form, formAction, text); + const { results: formResults, error: formError } = await buildFormResultsPromise(form, formAction ?? { type: 'smart_paste' }, text); return joinSucceededOrThrow(formResults, formError); } diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/React/chat-router.ts b/apps/demos/Demos/Chat/PageLevelAIAssistant/React/chat-router.ts index 9f2fc2939d96..b95dd22953fe 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/React/chat-router.ts +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/React/chat-router.ts @@ -212,7 +212,7 @@ async function runCommand(text: string, { form, gridInstance, aiIntegration }: R } if (target === 'form') { - const { results, error } = await buildFormResultsPromise(form, formAction, text); + const { results, error } = await buildFormResultsPromise(form, formAction ?? { type: 'smart_paste' }, text); return joinSucceededOrThrow(results, error); } diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js b/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js index 663870eda590..2119f2b36e5e 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js @@ -176,7 +176,7 @@ async function runCommand(text, { form, gridInstance, aiIntegration }) { ); } if (target === 'form') { - const { results, error } = await buildFormResultsPromise(form, formAction, text); + const { results, error } = await buildFormResultsPromise(form, formAction ?? { type: 'smart_paste' }, text); return joinSucceededOrThrow(results, error); } if (target === 'grid') { diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js b/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js index 6f0ac4ef4c61..05c7fc01b1de 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/jQuery/index.js @@ -902,7 +902,11 @@ async function runCommand(text, { form, gridInstance, aiIntegration }) { if (target === 'form') { const { results: formResults, error: formError } = - await buildFormResultsPromise(form, formAction, text); + await buildFormResultsPromise( + form, + formAction ?? { type: 'smart_paste' }, + text, + ); return joinSucceededOrThrow(formResults, formError); } From 573dc475e223b5fcad40de5464127e573b55ef1e Mon Sep 17 00:00:00 2001 From: Diana Gromova <72144169+16adianay@users.noreply.github.com> Date: Fri, 9 Oct 2026 17:49:35 +0400 Subject: [PATCH 3/3] Chat - Page-Level AI Assistant: regenerate ReactJs demo Co-Authored-By: Claude Sonnet 5.5 --- .../Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js b/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js index 2119f2b36e5e..d24ca6f5ff5d 100644 --- a/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js +++ b/apps/demos/Demos/Chat/PageLevelAIAssistant/ReactJs/chat-router.js @@ -176,7 +176,11 @@ async function runCommand(text, { form, gridInstance, aiIntegration }) { ); } if (target === 'form') { - const { results, error } = await buildFormResultsPromise(form, formAction ?? { type: 'smart_paste' }, text); + const { results, error } = await buildFormResultsPromise( + form, + formAction ?? { type: 'smart_paste' }, + text, + ); return joinSucceededOrThrow(results, error); } if (target === 'grid') {