Ddl ai#1772
Conversation
Move AI schema generation from the dashboard into a dedicated edit-database-schema component with its own route. Add a schema edit button to connection cards and update the tables list with an edit-schema action. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ist scroll Navigate to connection dashboard after hosted database rename dialog closes. Remove max-height/overflow scroll from schema editor SQL changes list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Display current database structure diagram when opening schema editor - Show updated diagram after successfully applying schema changes - Add zoom in/out/reset controls for diagram viewing - Convert "Open tables" from button to router link - Defer navigation until user explicitly clicks "Open tables" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces a dedicated “Edit Database Schema” flow in the Angular frontend: a new routed page for AI-driven schema edits with optional Mermaid ER diagrams, plus UI entry points for schema editing from the connections list. It also replaces the previous embedded schema-editor panel usage in the dashboard.
Changes:
- Added Mermaid/Markdown-powered diagram rendering and a routed “Edit Database Schema” page.
- Updated schema generation/approval calls and added a diagram fetch endpoint wrapper in
TableSchemaService. - Removed the dashboard’s embedded “edit structure” panel and added a schema-edit icon action to connection cards.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/services/table-schema.service.ts | Adds diagram response type + diagram fetch; changes generate/approve to a throwing fetch helper. |
| frontend/src/app/components/edit-database-schema/edit-database-schema.component.ts | New routed/embedded component behavior, Mermaid init, diagram loading, zoom controls. |
| frontend/src/app/components/edit-database-schema/edit-database-schema.component.html | Adds routed header, diagram rendering via ngx-markdown Mermaid, zoom UI, “Open tables” CTA. |
| frontend/src/app/components/edit-database-schema/edit-database-schema.component.css | Styles for routed layout, diagram container/zoom, loading states, and footer CTA. |
| frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.ts | Removes editStructure output event. |
| frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html | Removes “Edit structure” buttons from sidebar. |
| frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.css | Adjusts sticky positioning after removing edit-structure section. |
| frontend/src/app/components/dashboard/dashboard.component.ts | Swaps old schema component for new one; removes embedded editor state. |
| frontend/src/app/components/dashboard/dashboard.component.html | Uses <app-edit-database-schema> for no-tables flow; removes embedded editor panel and bindings. |
| frontend/src/app/components/dashboard/dashboard.component.css | Removes embedded schema editor panel CSS. |
| frontend/src/app/components/connections-list/own-connections/own-connections.component.ts | Adds MatTooltipModule; navigates to dashboard after rename dialog closes. |
| frontend/src/app/components/connections-list/own-connections/own-connections.component.html | Adds schema edit icon/link on connection cards (edit access only). |
| frontend/src/app/components/connections-list/own-connections/own-connections.component.css | Adds layout support and schema icon button styles. |
| frontend/src/app/app-routing.module.ts | Adds edit-database-schema/:connection-id route. |
Comments suppressed due to low confidence (5)
frontend/src/app/components/edit-database-schema/edit-database-schema.component.ts:72
EditDatabaseSchemaComponentimplementsAfterViewInit, butngAfterViewInitis declaredasync(so it returnsPromise<void>), which is not signature-compatible withAfterViewInit’sngAfterViewInit(): voidand can cause a TS compile error. Consider makingngAfterViewInit()synchronous and calling an internal async initializer (or remove the interface).
frontend/src/app/components/edit-database-schema/edit-database-schema.component.ts:173onReject()always appends the "Changes rejected" success message even if the reject request fails (sincerejectBatch()can returnnullon errors and no error handling is done here). This can leave the UI out of sync with backend state; handle the failure case (e.g. catch/branch on a falsy response and show an error message instead).
frontend/src/app/components/edit-database-schema/edit-database-schema.component.html:113- Icon-only diagram zoom controls don’t provide an accessible name. Add
aria-label(ormatTooltip+aria-label) to the zoom in/out/reset buttons so screen readers can announce their purpose.
frontend/src/app/components/edit-database-schema/edit-database-schema.component.css:411 .schema-chat__open-tablesstyles targetbutton mat-icon, but the template uses an<a mat-flat-button>, so these icon spacing rules won’t apply. Update the selector to match the actual rendered element/classes (e.g. target the anchor or the Material button classes) so the icon aligns as intended.
frontend/src/app/components/edit-database-schema/edit-database-schema.component.css:4:hostheight uses a hard-coded44pxoffset (calc(100vh - 44px)), while the routed layout below usesvar(--mat-toolbar-standard-height). Using the same CSS variable (or another shared token) would avoid breakage if the toolbar height changes and keeps the two modes consistent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private async _fetchOrThrow<T>(url: string, body: unknown): Promise<T> { | ||
| const fullUrl = `${environment.apiRoot || '/api'}${url}`; | ||
| const response = await fetch(fullUrl, { | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| credentials: 'include', | ||
| body: JSON.stringify(body), | ||
| }); |
| async rejectBatch(batchId: string): Promise<SchemaChangeBatchResponse | null> { | ||
| return this._api.post<SchemaChangeBatchResponse>(`/table-schema/batch/${batchId}/reject`); |
| <a mat-icon-button | ||
| class="connectionSchemaButton" | ||
| routerLink="/edit-database-schema/{{connectionItem.connection.id}}" | ||
| matTooltip="Edit schema" | ||
| (click)="$event.stopPropagation()"> | ||
| <mat-icon>schema</mat-icon> | ||
| </a> |
No description provided.