Skip to content

CNS-120 In Console, cluster list now pulls data from SUBSCRIBE - #38014

Open
jdonelson wants to merge 1 commit into
mainfrom
jeremydonelson/CNS-120-cluster-list-subscribe
Open

CNS-120 In Console, cluster list now pulls data from SUBSCRIBE#38014
jdonelson wants to merge 1 commit into
mainfrom
jeremydonelson/CNS-120-cluster-list-subscribe

Conversation

@jdonelson

@jdonelson jdonelson commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

In Console, cluster list data is now sourced from SUBSCRIBE via Jotai store. This moves one more consumer away from the deprecated polling model and it's a prerequisite for adding replica usage metrics to the list display.

Motivation

Fixes CNS-120

Verification

  • Manually tested UI (add/delete clusters; sort; link to detail views) on integration environment and staging stack.
  • Passed automated tests.
Screenshot 2026-08-03 at 2 31 53 PM

…ow via Jotai store. This is a prerequisite for adding replica usage matrics to the list display.
@jdonelson jdonelson added the A-CONSOLE Area: Console label Aug 3, 2026
@jdonelson
jdonelson requested a review from a team as a code owner August 3, 2026 14:44
@jdonelson
jdonelson requested a review from leedqin August 3, 2026 14:44
@linear-code

linear-code Bot commented Aug 3, 2026

Copy link
Copy Markdown

CNS-120

@leedqin leedqin left a comment

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.

Thanks for the migration! looks pretty good to me; just had some suggestions. Would you mind updating the verification section in the PR description and also adding a Fixes- in the Motivation section in the PR description. This would directly sync this PR to the Linear issue

...c,
// Treat an in-flight owners query as non-owner so owner-only menu items
// stay hidden until ownership is known.
isOwner: !isOwnersPending && (ownersById?.get(c.ownerId) ?? false),

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.

do you think we could move this check into useOwners hook and share this check across ClustersList.tsx, ClusterDetail and ClusterReplica?

if (!clusters) return [];
const systemClusters = clusters.filter((c) => isSystemCluster(c.id));
const nonSystemClusters = clusters
const visibleClusters = clusters

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.

Same filter + sort already exists in ClusterDetailBreadcrumbs. Maybe pull it into a helper in store/allClusters.ts, e.g. visibleClusters(clusters, showSystemObjects)

export function visibleClusters(clusters: Cluster[], showSystemObjects: boolean) {
  return clusters
    .filter((c) => showSystemObjects || !isSystemCluster(c.id))
    .sort((a, b) => a.name.localeCompare(b.name));
}

expect(await screen.findByText(CLUSTERS_FETCH_ERROR_MESSAGE)).toBeVisible();
});

it("renders the cluster list", async () => {

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 system-cluster filtering is client-side logic now, so it'd be good to cover it: seed the atom with an s-id cluster plus user clusters and assert it's hidden by default / shown with the toggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CONSOLE Area: Console

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants