Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend AI widget generation flow to stop depending on a dashboard context, aligning the client with an endpoint that no longer requires a dashboardId.
Changes:
- Updated
DashboardsService.generateWidgetWithAito call/widget/generate/{connectionId}and removed thedashboardIdargument. - Removed
dashboard_idfrom theGeneratedPanelWithPosition.panel_positionmodel. - Simplified
ChartEditComponentAI generation logic/UI by removingaiDashboardIdstate and the template gating.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
frontend/src/app/services/dashboards.service.ts |
Removes dashboardId from AI widget generation API call and updates the endpoint path. |
frontend/src/app/models/saved-query.ts |
Updates AI response typing to drop dashboard_id from panel_position. |
frontend/src/app/components/charts/chart-edit/chart-edit.component.ts |
Removes dashboard-derived AI state and updates AI generation call signature. |
frontend/src/app/components/charts/chart-edit/chart-edit.component.html |
Makes the AI section no longer conditional on aiDashboardId(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| async generateWithAi(): Promise<void> { | ||
| const dashboardId = this.aiDashboardId(); | ||
| if (!dashboardId || !this.aiDescription().trim()) return; | ||
| if (!this.aiDescription().trim()) return; | ||
|
|
||
| this.aiGenerating.set(true); | ||
|
|
||
| try { | ||
| const result = await this._dashboards.generateWidgetWithAi(dashboardId, this.connectionId(), { | ||
| const result = await this._dashboards.generateWidgetWithAi(this.connectionId(), { |
There was a problem hiding this comment.
Now that AI widget generation no longer depends on a dashboardId (and the aiDashboardId state/effect was removed), the component still calls _loadAiPrerequisites() on init which sets DashboardsService.setActiveConnection() and triggers an unnecessary /dashboards/{connectionId} fetch. Consider removing _loadAiPrerequisites() (and its ngOnInit call) or updating it to only run when the dashboards list is actually needed; also update the stale inline comment that references an effect that no longer exists.
No description provided.