Skip to content

Fix uncached tables requests#1812

Merged
lyubov-voloshko merged 2 commits into
mainfrom
fix-uncached-tables-requests
May 29, 2026
Merged

Fix uncached tables requests#1812
lyubov-voloshko merged 2 commits into
mainfrom
fix-uncached-tables-requests

Conversation

@lyubov-voloshko
Copy link
Copy Markdown
Collaborator

@lyubov-voloshko lyubov-voloshko commented May 29, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Edit schema button now displays only for databases that support schema editing.
    • Fixed schema diagram sidebar scrolling from interfering with diagram interaction.

Review Change Stack

lyubov-voloshko and others added 2 commits May 29, 2026 12:47
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>
Copilot AI review requested due to automatic review settings May 29, 2026 12:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

The 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.

Changes

Schema Editing Capability and Interaction Improvements

Layer / File(s) Summary
Schema edit capability gating
frontend/src/app/components/connections-list/own-connections/own-connections.component.ts, frontend/src/app/components/connections-list/own-connections/own-connections.component.html
The component imports DBtype and implements a supportsSchemaEditing() method that allowlists supported database engines. The template condition for the "Edit schema" button is tightened to require both accessLevel === 'edit' and schema-editing support for the connection type.
Schema diagram sidebar interaction fix
frontend/src/app/components/edit-database-schema/schema-diagram-viewer/schema-diagram-viewer.component.html
The sidebar <aside> element now stops wheel event propagation to prevent sidebar scrolling from triggering the diagram's zoom handler.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly Related PRs

  • rocket-admin/rocketadmin#1788: Extends the "Edit schema" button logic with an additional database-type capability check and corresponding helper method.
  • rocket-admin/rocketadmin#1784: Related to the wheel event handler addition in the schema diagram sidebar to prevent unwanted zoom interactions.

Suggested Reviewers

  • gugu

Poem

🐰 A rabbit's delight

Schema gates unlock with care,
Only for the types that share,
And sidebars now scroll so free,
Without zoom bugs—hop with glee! 🎉

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Fix uncached tables requests' does not match the actual changes, which focus on conditional schema editing UI rendering and event propagation in schema diagrams. Update the title to accurately reflect the main changes, such as 'Add conditional schema editing support and fix diagram wheel event propagation' or 'Conditionally render edit schema button based on database type support'.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed Dual-layer access control: backend ConnectionEditGuard via Cedar auth + frontend check for 'edit' access level and supported database type. Strict enum validation. No vulnerabilities identified.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-uncached-tables-requests

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot requested a review from gugu May 29, 2026 12:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
frontend/src/app/components/connections-list/own-connections/own-connections.component.ts (1)

117-126: ⚡ Quick win

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between 52edbf2 and 37c82a4.

📒 Files selected for processing (3)
  • frontend/src/app/components/connections-list/own-connections/own-connections.component.html
  • frontend/src/app/components/connections-list/own-connections/own-connections.component.ts
  • frontend/src/app/components/edit-database-schema/schema-diagram-viewer/schema-diagram-viewer.component.html

@lyubov-voloshko lyubov-voloshko merged commit 7a7ddf2 into main May 29, 2026
18 checks passed
@lyubov-voloshko lyubov-voloshko deleted the fix-uncached-tables-requests branch May 29, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants