Skip to content

Update DataPlaneTable in admin view to use GQL instead of Supabase - #2067

Open
adrian-estuary wants to merge 13 commits into
mainfrom
2065-data-plane-table-gql
Open

Update DataPlaneTable in admin view to use GQL instead of Supabase#2067
adrian-estuary wants to merge 13 commits into
mainfrom
2065-data-plane-table-gql

Conversation

@adrian-estuary

@adrian-estuary adrian-estuary commented Aug 26, 2026

Copy link
Copy Markdown

Issues

#2065

Changes

Tests

Test plan

  • npm run format
  • npm run typecheck
  • npm run lint
  • npm run test (310 passed)
  • Manual: verify the admin Data Planes table (public + private toggle) renders and the detail dialog opens

Screenshots

Public data planes (default 1 local plane)
Screenshot 2026-08-26 at 2 53 01 PM

Private data planes (none in local)
Screenshot 2026-08-26 at 2 53 31 PM

Many data planes - paginated (seeded data)
Screenshot 2026-08-26 at 3 45 56 PM

Private data planes (only 1 page, no pagination controls show up)
Screenshot 2026-08-26 at 4 29 25 PM

Dialog
Screenshot 2026-08-26 at 4 27 47 PM

GQL query in network tab
Screenshot 2026-08-26 at 2 57 45 PM

If applicable - please include some screenshots of the new UI

@adrian-estuary
adrian-estuary requested a review from a team as a code owner August 26, 2026 20:30
@adrian-estuary adrian-estuary linked an issue Aug 26, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

⚪ Code Health

No change to the dead-code surface.

48 Unused files

File imported nowhere — delete (or import) it.

     src/hooks/useDelay.ts
     src/hooks/useDraft.ts
     src/pages/NoGrants.tsx
     src/pages/OAuth.tsx
     src/services/encryption.ts
     src/types/global.ts
     src/types/vitest.ts
     src/components/graphs/TaskHoursByMonthGraph.tsx
     src/components/tables/Link.tsx
     src/context/LoopIndex/index.tsx
…and 38 more

66 Unused exports

Exported symbol with no references outside its own file — un-export it, or delete it if unused entirely

     src/context/Theme.tsx : logoColors
     src/context/Theme.tsx : intensifiedOutlineThick
     src/context/Theme.tsx : tableAlternateRowsSx
     src/context/Theme.tsx : draggableChipIconSx
     src/context/Theme.tsx : hiddenButAccessibleInput
     src/context/Theme.tsx : primaryColoredBackground_hovered
     src/context/Theme.tsx : detailsPanelBgColor
     src/context/Theme.tsx : menuBackgroundColor
     src/context/Theme.tsx : flexGrowToSiblingsSx
     src/context/Theme.tsx : shardTableRow
…and 56 more

30 Unused exported types

Exported type with no references outside its own file — un-export it, or delete it if unused entirely

     src/utils/billing-utils.ts : FREE_GB_BY_TIER
     src/types/index.ts : InferredSchemas
     src/types/index.ts : Shard
     src/components/shared/WizardDialog/index.ts : WizardStep
     src/api/dataPlanes.ts : AwsDnsEntry
     src/stores/ShardDetail/types.ts : TaskShardDetailsWithShard
     src/stores/ShardDetail/types.ts : ShardDetails
     src/components/tables/Logs/types.ts : RefreshLogsFunction
     src/types/schemaModels.ts : CollectionSchema
     src/components/editor/Bindings/types.ts : SelectedCollectionChangeData
…and 20 more

14 Unused exported enum members

An enum member referenced nowhere

     src/services/supabase.ts : CONNECTOR_TAGS
     src/services/supabase.ts : DRAFTS_EXT
     src/services/supabase.ts : TASKS_BY_DAY
     src/stores/Tables/hooks.ts : accessGrants
     src/stores/Tables/hooks.ts : accessLinks
     src/stores/Tables/hooks.ts : billing
     src/stores/Tables/hooks.ts : connectors
     src/stores/Tables/hooks.ts : entitySelector
     src/stores/Tables/hooks.ts : prefixes
     src/stores/Tables/hooks.ts : prefixAlerts
…and 4 more

5 Unused dependencies

In package.json but never imported

     package.json : @mui/lab
     package.json : @testing-library/jest-dom
     package.json : @urql/exchange-retry
     package.json : logrocket-react
     package.json : stripe

3 Unused devDependencies

In package.json devDependencies but never used

     package.json : @types/logrocket-react
     package.json : @types/react-inspector
     package.json : sharp

Comment on lines +28 to +32
// The region is parsed out of the data plane name rather than read off the
// `region` field so it stays in sync with the displayed name. They differ
// for the local data plane: `ops/dp/public/local-flow` parses to `flow`,
// while the field reports `local`.
const { region } = parseDataPlaneName(dataPlane.name, scope);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not sure if this is just a local environment quirk and if this logic is really needed for production. Thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not following here - region is in fact parsed from the name in the gql resolver so i wouldn't expect this logic to change anything in the UI.

I sometimes wonder if we could just get rid of the "local" region and call it GCP or whatever, would simplify a bunch of little annoying things.

Comment on lines +148 to +151
<ToggleDataPlaneScope
scope={dataPlaneScope}
onChange={handleDataPlaneScopeChange}
/>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the ToggleDataPlaneScope component to take in the scope and handle changes via a callback. There was some wonky interaction with it directly updating the context that caused a render loop.

Comment thread src/components/tables/EntityTable/index.tsx
Comment thread src/components/tables/DataPlanes/DataPlaneDialog.tsx Outdated
Comment thread src/api/dataPlanes.ts Outdated
Comment thread src/components/tables/DataPlanes/types.ts Outdated
@GregorShear

Copy link
Copy Markdown
Contributor

left a few low-conviction comments so far - i'll get to the stuff that actually matters with fresh eyes tomorrow.

Comment thread src/components/tables/DataPlanes/index.tsx
@adrian-estuary
adrian-estuary force-pushed the 2065-data-plane-table-gql branch from 53680d0 to 2a5bbf4 Compare August 28, 2026 17:35
@adrian-estuary
adrian-estuary force-pushed the 2065-data-plane-table-gql branch 2 times, most recently from b6d1284 to 5227bb8 Compare August 31, 2026 21:06
@adrian-estuary
adrian-estuary force-pushed the 2065-data-plane-table-gql branch from 5227bb8 to 140e0b0 Compare September 1, 2026 16:36
Comment on lines +62 to +66
const { rowsPerPage, setRowsPerPage } = useTableState(
TablePrefixes.dataPlanes,
'name',
'asc'
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can go even further and delete this (does stuff like stores the rows-per-page selection in the url, like admin/settings?dpt-r=25 IMO not necessary)

@GregorShear GregorShear Sep 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and just declare const PAGE_SIZE = 10 to replace rowsPerPage

count={-1}
page={currentPage}
rowsPerPage={rowsPerPage}
onPageChange={handlePageChange}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
onPageChange={handlePageChange}
rowsPerPageOptions={[PAGE_SIZE]} // hides the rows-per-page selector (which i wish was just off by default - who actually ever touches that?
onPageChange={handlePageChange}

Comment on lines +95 to +108
const slotProps = useMemo(() => {
const previousButtonDisabled = !pageInfo?.hasPreviousPage;
const nextButtonDisabled = !pageInfo?.hasNextPage;
return {
actions: {
previousButton: {
disabled: previousButtonDisabled,
},
nextButton: {
disabled: nextButtonDisabled,
},
},
};
}, [pageInfo?.hasNextPage, pageInfo?.hasPreviousPage]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the <TablePagination /> component isn't memoized, so stabilizing slotProps (and many of its siblings) does nothing. Could probably inline some of them in the component props

Suggested change
const slotProps = useMemo(() => {
const previousButtonDisabled = !pageInfo?.hasPreviousPage;
const nextButtonDisabled = !pageInfo?.hasNextPage;
return {
actions: {
previousButton: {
disabled: previousButtonDisabled,
},
nextButton: {
disabled: nextButtonDisabled,
},
},
};
}, [pageInfo?.hasNextPage, pageInfo?.hasPreviousPage]);
const slotProps = {
actions: {
previousButton: {
disabled: !pageInfo?.hasPreviousPage,
},
nextButton: {
disabled: !pageInfo?.hasNextPage,
},
},
};

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.

Switch data plane table queries over to GQL

2 participants