Repository navigation
feat(studio): paginate Schema Designer via useInfiniteTablesQuery - #46402
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughSchemaGraph and table listing were migrated to an infinite, name-filterable query; a Find-table selector and shortcut were added; fit-view is preserved across incremental loads; table list cache keys and pg-meta SQL were updated; Playwright waiters/tests were adjusted to the new query key. ChangesPaginated Table Loading & Find UI
Data layer and SQL
Cache, tests, and helpers
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
This comment has been minimized.
This comment has been minimized.
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › database.spec.ts › Database › Tables › CRUD operations and copy works as expected Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
Swaps one-shot useTablesQuery for useInfiniteTablesQuery (pageSize: 100) in SchemaGraph. The first 100 tables paint immediately; a "Load more tables" button appears above the legend while more pages remain, letting users pull in the rest on demand instead of waiting for a single large payload. - Replace useTablesQuery with useInfiniteTablesQuery; flatten pages into tables via useMemo - Add a xyflow Panel at bottom-center (above the legend) with a Button that calls fetchNextPage; shows a loading spinner while fetching
2087fea to
847a93f
Compare
When the user clicks "Load more tables", set a ref before calling fetchNextPage so the layout effect calls fitView after the next Dagre pass, bringing all newly loaded tables into the viewport.
Adds a searchable Find table popover so users can jump to any table in the schema, pulling additional pages on demand when the target hasn't been loaded yet. The selector reuses useInfiniteTablesQuery with a server-side name filter (escaped ILIKE) and is bound to a new "O T" shortcut alongside the existing visualizer chords. Restructures tableKeys.infiniteList around a stable ['projects', ref, 'tables', 'infinite', schema] prefix plus an options leaf, with a sibling infiniteListPrefix helper for invalidation. The previous flattened-array shape made trailing-undefined invalidations silently no-op (React Query's partial match walks every element), which left the SchemaGraph showing stale data after edits in the side panel. Wires both the table and column edit flows to invalidate the new infinite-list prefix so the visualizer picks up fresh data after saves.
5512908 to
8a50d39
Compare
Braintrust eval reportAssistant (bt::sp::custom::GitHub Actions-e1f8e343-7ee3-4763-ae7f-62d4550a6e7c-1780082059)
|
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Performance improvement / feature
What is the current behavior?
The Schema Designer fetches all tables in a single request via
useTablesQuery. For schemas with 400+ tables this blocks first paint on a large payload.What is the new behavior?
SchemaGraphusesuseInfiniteTablesQuery(pageSize: 100) so the first 100 tables paint immediately. A "Load more tables" button appears above the legend whenever more pages remain, letting users load the rest on demand.Additional context
Summary by CodeRabbit
New Features
Refactor
Tests