Fix uncached tables requests#1812
Conversation
The Edit schema button on the connection card now only appears for SQL databases (Postgres, MySQL, Oracle, MSSQL, IBM DB2, ClickHouse), since the Schema Assistant can only generate DDL for those engines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wheel events over the tables list bubbled to the viewport's zoom handler, so scrolling the list zoomed the diagram instead of scrolling. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR refines schema editing functionality by gating the "Edit schema" button to connections with edit-level access and database types that support schema editing, and fixes an interaction issue where sidebar scrolling inadvertently triggers the diagram's wheel handler. ChangesSchema Editing Capability and Interaction Improvements
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly Related PRs
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 adjusts the frontend UI to reduce unintended interactions and limit access to schema-editing UX to database types that support it, which can help avoid triggering unnecessary schema/table-related requests.
Changes:
- Prevent wheel events inside the schema diagram sidebar from bubbling to the diagram viewport (avoids accidental zoom while scrolling the sidebar).
- Add a
supportsSchemaEditing()helper to gate the “Edit schema” action by database type. - Update the own-connections list template to only show “Edit schema” for editable connections of supported DB types.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/app/components/edit-database-schema/schema-diagram-viewer/schema-diagram-viewer.component.html | Stops wheel-event propagation from the sidebar to prevent unintended viewport zooming. |
| frontend/src/app/components/connections-list/own-connections/own-connections.component.ts | Introduces DB-type gating logic for schema editing. |
| frontend/src/app/components/connections-list/own-connections/own-connections.component.html | Applies schema-editing gating in the UI for eligible connections only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/src/app/components/connections-list/own-connections/own-connections.component.ts (1)
117-126: ⚡ Quick winConsider using a Set for better maintainability.
The method uses multiple OR conditions to check supported database types. Using a Set would make this more maintainable and easier to extend when adding new supported databases.
♻️ Proposed refactor using a Set
+ private readonly SCHEMA_EDITING_SUPPORTED_TYPES = new Set<DBtype>([ + DBtype.Postgres, + DBtype.MySQL, + DBtype.Oracle, + DBtype.MSSQL, + DBtype.DB2, + DBtype.ClickHouse, + ]); + supportsSchemaEditing(type: DBtype | string): boolean { - return ( - type === DBtype.Postgres || - type === DBtype.MySQL || - type === DBtype.Oracle || - type === DBtype.MSSQL || - type === DBtype.DB2 || - type === DBtype.ClickHouse - ); + return this.SCHEMA_EDITING_SUPPORTED_TYPES.has(type as DBtype); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/src/app/components/connections-list/own-connections/own-connections.component.ts` around lines 117 - 126, Replace the multiple OR checks in supportsSchemaEditing with a Set lookup for clarity and maintainability: define a constant Set (e.g. SUPPORTED_SCHEMA_EDITING_TYPES) at module/component scope containing DBtype.Postgres, DBtype.MySQL, DBtype.Oracle, DBtype.MSSQL, DBtype.DB2, DBtype.ClickHouse and change supportsSchemaEditing(type) to return SUPPORTED_SCHEMA_EDITING_TYPES.has(type as DBtype) (or coerce/normalize string inputs as needed); this centralizes supported values and makes future additions trivial.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@frontend/src/app/components/connections-list/own-connections/own-connections.component.ts`:
- Around line 117-126: Replace the multiple OR checks in supportsSchemaEditing
with a Set lookup for clarity and maintainability: define a constant Set (e.g.
SUPPORTED_SCHEMA_EDITING_TYPES) at module/component scope containing
DBtype.Postgres, DBtype.MySQL, DBtype.Oracle, DBtype.MSSQL, DBtype.DB2,
DBtype.ClickHouse and change supportsSchemaEditing(type) to return
SUPPORTED_SCHEMA_EDITING_TYPES.has(type as DBtype) (or coerce/normalize string
inputs as needed); this centralizes supported values and makes future additions
trivial.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ce3080f1-a70f-4ff3-b5d5-24182caeaaed
📒 Files selected for processing (3)
frontend/src/app/components/connections-list/own-connections/own-connections.component.htmlfrontend/src/app/components/connections-list/own-connections/own-connections.component.tsfrontend/src/app/components/edit-database-schema/schema-diagram-viewer/schema-diagram-viewer.component.html
Summary by CodeRabbit