Skip to content

Add Chat - Custom AI Assistant demo Angular - #35219

Open
16adianay wants to merge 8 commits into
DevExpress:feature/demo_custom_AI_assistantfrom
16adianay:feature/demo_custom_AI_assistant_Angular
Open

16adianay wants to merge 8 commits into
DevExpress:feature/demo_custom_AI_assistantfrom
16adianay:feature/demo_custom_AI_assistant_Angular

Conversation

@16adianay

Copy link
Copy Markdown
Contributor

No description provided.

@16adianay
16adianay requested a review from a team as a code owner September 15, 2026 14:51
@16adianay 16adianay self-assigned this Sep 15, 2026
@16adianay 16adianay added the 26_2 label Sep 15, 2026
@16adianay
16adianay force-pushed the feature/demo_custom_AI_assistant_Angular branch from 1a6725d to 2ff5e55 Compare September 15, 2026 14:55
@16adianay
16adianay requested a balanced review from Copilot September 16, 2026 08:16

Copilot AI left a comment

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.

🟡 Changes recommended

An unused private popup query violates the repository’s TypeScript settings and can block compilation.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an Angular version of the Chat Custom AI Assistant demo, integrating Chat with an employee Form and task DataGrid.

Changes:

  • Adds AI request routing and Form/DataGrid commands.
  • Adds standalone Angular UI components and styling.
  • Adds demo data, shared types, and Azure OpenAI integration.
File summaries
File Description
Angular/index.html Hosts the Angular demo.
app/types/types.ts Defines shared models and command types.
app/services/ai-service.ts Configures AI requests and retries.
app/routing/chat-router.ts Routes prompts to Form and DataGrid operations.
app/data/data.ts Provides configuration and sample data.
app/commands/grid-commands.ts Implements DataGrid AI commands.
app/commands/form-commands.ts Implements Form clear and smart-paste commands.
app/components/task-grid/task-grid.component.ts Configures the task grid.
app/components/task-grid/task-grid.component.html Defines task grid markup.
app/components/task-grid/task-grid.component.css Styles the task grid.
app/components/employee-form/employee-form.component.ts Configures the employee form.
app/components/employee-form/employee-form.component.html Defines employee form markup.
app/components/employee-form/employee-form.component.css Styles the employee form.
app/components/ai-assistant/ai-assistant.component.ts Manages popup chat behavior.
app/components/ai-assistant/ai-assistant.component.html Defines assistant popup markup.
app/components/ai-assistant/ai-assistant.component.css Styles the assistant popup.
app/app.component.ts, .html, .css Composes and bootstraps the demo.
Review details
  • Files reviewed: 19/19 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- Removed unused vars
- Added variables to change a form background color
- Add ChangeDetectorRef to force change change detection for chat disabling
Comment thread apps/demos/Demos/Chat/CustomAIAssistant/Angular/app/types/types.ts Outdated
@16adianay
16adianay requested a review from a team September 17, 2026 14:56
Comment thread apps/demos/Demos/Chat/CustomAIAssistant/Angular/app/services/ai-service.ts Outdated

@dmlvr dmlvr left a comment

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.

Although Angular doesn't impose strict limits on the number of files, in my view, there are too many of them in the current demo. The closest comparison is the CardView/FieldTemplate setup, but there the demo is broken down by visual components.

Proposal: keep app/components/* (the three components are justified), but consolidate types.ts, data.ts, chat-router.ts, grid-commands.ts, and form-commands.ts into app.service.ts and app/ai/ai.service.ts, following the reference examples.

https://github.com/DevExpress/DevExtreme/tree/main/apps/demos/Demos/DataGrid/AIAssistant/Angular
https://github.com/DevExpress/DevExtreme/tree/main/apps/demos/Demos/Form/SmartPaste/Angular
https://github.com/DevExpress/DevExtreme/tree/main/apps/demos/Demos/HtmlEditor/AITextEditing/Angular

@16adianay

Copy link
Copy Markdown
Contributor Author

Although Angular doesn't impose strict limits on the number of files, in my view, there are too many of them in the current demo. The closest comparison is the CardView/FieldTemplate setup, but there the demo is broken down by visual components.

Proposal: keep app/components/* (the three components are justified), but consolidate types.ts, data.ts, chat-router.ts, grid-commands.ts, and form-commands.ts into app.service.ts and app/ai/ai.service.ts, following the reference examples.

https://github.com/DevExpress/DevExtreme/tree/main/apps/demos/Demos/DataGrid/AIAssistant/Angular https://github.com/DevExpress/DevExtreme/tree/main/apps/demos/Demos/Form/SmartPaste/Angular https://github.com/DevExpress/DevExtreme/tree/main/apps/demos/Demos/HtmlEditor/AITextEditing/Angular

Agreed on the general direction - grouping by concern instead of by technical layer makes sense, and types.ts + data.ts are small enough that they don't need their own files; I'll fold them together.

I'd hold off on merging everything into a single app.service.ts though. The reference demos (DataGrid/AIAssistant, Form/SmartPaste, HtmlEditor/AITextEditing) each cover one AI scenario, so their logic fits comfortably in one file. This demo routes between two targets (grid/form/mixed) and executes commands against both widgets — chat-router.ts + grid-commands.ts + form-commands.ts together are 500+ lines of fairly distinct logic. Cramming all of that into one file would make it harder to read and to copy from as a reference, which matters here since it's a teaching demo.

So,my proposal: merge types.ts + data.ts, and rename chat-router.ts to app.service.ts, but keep grid-commands.ts and form-commands.ts as their own files, since each is a self-contained, sizeable piece of widget-specific logic rather than an artificial layer split

@dmlvr dmlvr closed this Sep 18, 2026
@dmlvr

dmlvr commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Agreed on the general direction - grouping by concern instead of by technical layer makes sense, and types.ts + data.ts are small enough that they don't need their own files; I'll fold them together.

I'd hold off on merging everything into a single app.service.ts though. The reference demos (DataGrid/AIAssistant, Form/SmartPaste, HtmlEditor/AITextEditing) each cover one AI scenario, so their logic fits comfortably in one file. This demo routes between two targets (grid/form/mixed) and executes commands against both widgets — chat-router.ts + grid-commands.ts + form-commands.ts together are 500+ lines of fairly distinct logic. Cramming all of that into one file would make it harder to read and to copy from as a reference, which matters here since it's a teaching demo.

So,my proposal: merge types.ts + data.ts, and rename chat-router.ts to app.service.ts, but keep grid-commands.ts and form-commands.ts as their own files, since each is a self-contained, sizeable piece of widget-specific logic rather than an artificial layer split

Agree, let's do it

@16adianay 16adianay reopened this Sep 18, 2026
- Replace export function createAiIntegration() with @Injectable() class AiService { getAiIntegration() {...} }
- Remove standalone
- Change clearButtonOptions to a static variable
- Rename the instance getter
- Merge types and data
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.

4 participants