Skip to content

CNS-145 - Flatten data for Cluster Usage table - #38437

Open
jdonelson wants to merge 1 commit into
mainfrom
jdonelson/CNS-145_flatten-cluster-table-data
Open

CNS-145 - Flatten data for Cluster Usage table #38437
jdonelson wants to merge 1 commit into
mainfrom
jdonelson/CNS-145_flatten-cluster-table-data

Conversation

@jdonelson

@jdonelson jdonelson commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

Feedback from Product team and others indicated that the previous design, grouped rows that separated out clusters and their replicas, should be simplified. This has an added benefit of reducing complexity in the UI code, which should make it easier to build out forthcoming enhancements.

Description

Simplify Cluster Replica Usage table by flattening the data to one row per replica, with an added cluster name column. A cluster with 2 replica now displays 2 rows. A cluster with 0 replicas in displayed with dashes in most columns.

Screenshot 2026-08-24 at 3 40 22 PM

Verification

Revised automated tests to handle single rows. Verified behavior locally. This version of the table is still gated behind a feature flag, so this PR does not touch any production-visible code.

…o one row per replica, with an added cluster name column. A cluster with 2 replica now displays 2 rows. A cluster with 0 replicas in displayed with dashes in most columns.
@jdonelson
jdonelson requested a review from leedqin August 24, 2026 19:50
@jdonelson
jdonelson requested a review from a team as a code owner August 24, 2026 19:50
@linear-code

linear-code Bot commented Aug 24, 2026

Copy link
Copy Markdown

CNS-145

@def-

def- commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

QA LLM Review

1. MEDIUM -- Give the flattened rows stable IDs

console/src/platform/clusters/ClusterUsageTable.tsx:251

The flattened table relies on position-based row IDs while every replica row owns stateful Alter and Drop dialogs. A live replica insertion or removal can therefore reuse an open dialog component for a different cluster, so submitting the dialog can alter the wrong cluster.

Details

No getRowId is passed to useUniversalTable, so TanStack derives each top-level row.id from its index. UniversalTable then uses that ID as the React key. For example, if a replica is removed from cluster A while an Alter dialog is open on a later row for cluster B, the flattened indices shift and the keyed component that held B's open dialog can be reused for cluster C. AlterClusterModal keeps its original form state but reads cluster.name from the updated prop when it submits, which can apply B's requested size, replication factor, and rename to C. Replica changes did not move the cluster parent rows in the grouped table, but they do move these new top-level rows. Pass a stable getRowId, using a composite such as the cluster ID plus the replica ID and a distinct suffix for the empty-cluster row.

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