Skip to content

feat(webui/cluster): redesign cluster page #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2025

Conversation

Jitmisra
Copy link
Contributor

i have redesigned the cluster page
added tags
🟠 Orange "Migrating {slot}"= Shows when any shard has active migration (migrating_slot >= 0)
🟢 Green "Stable" = Shows when all shardds are stable(migrating_slot = -1)
🔵 Blue"Importing {slot}" == Shows when any shard is importing(import_slot >= 0)

let me know if there is something else i can do

Monosnap Apache Kvrocks Controller 2025-06-29 05-07-52
Monosnap Apache Kvrocks Controller 2025-06-29 05-08-06

@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.89%. Comparing base (6c56470) to head (c29d639).
Report is 68 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #322      +/-   ##
============================================
+ Coverage     43.38%   46.89%   +3.50%     
============================================
  Files            37       45       +8     
  Lines          2971     4391    +1420     
============================================
+ Hits           1289     2059     +770     
- Misses         1544     2126     +582     
- Partials        138      206      +68     
Flag Coverage Δ
unittests 46.89% <ø> (+3.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PragmaTwice PragmaTwice requested a review from Copilot June 30, 2025 02:17
Copy link

@Copilot 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

Redesign the cluster page to improve UX by adding new tags, filters, and enhanced sorting while also updating form dialog components. Key changes include:

  • Adding an optional children prop to the FormDialog and form creation components.
  • Updating typography variants and styling to match the new design.
  • Refactoring the cluster page to include new filter and sort popovers and detailed resource counts.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
webui/src/app/ui/formDialog.tsx Added support for an optional children prop and updated typography styling.
webui/src/app/ui/formCreation.tsx Updated ClusterCreation and ImportCluster components to accept children and wrap FormDialog accordingly.
webui/src/app/namespaces/[namespace]/page.tsx Overhauled the UI with new Material UI components, filters, sorting popovers, and tag displays.

@@ -101,7 +103,9 @@ const FormDialog: React.FC<FormDialogProps> = ({

return (
<>
{position === "card" ? (
{children ? (
<div onClick={openDialog}>{children}</div>
Copy link
Preview

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

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

The clickable div wrapping the children does not have inherent keyboard accessibility. Consider using a button element or adding tabindex and key press handlers to ensure the element is accessible.

Suggested change
<div onClick={openDialog}>{children}</div>
<button type="button" onClick={openDialog} style={{ all: "unset", cursor: "pointer" }}>
{children}
</button>

Copilot uses AI. Check for mistakes.

@@ -19,10 +19,23 @@

"use client";

import { Box, Typography, Chip } from "@mui/material";
import {
Copy link
Preview

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

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

The import 'listShards' is not used anywhere in the file. Removing unused imports can improve code maintainability.

Copilot uses AI. Check for mistakes.

Comment on lines +143 to +159
for (let i = 0; i < shards.length; i++) {
try {
const nodes = await listNodes(
params.namespace,
cluster,
i.toString()
);
if (Array.isArray(nodes)) {
clusterNodeCount += nodes.length;
}
} catch (error) {
console.error(
`Failed to fetch nodes for shard ${i}:`,
error
);
}
}
Copy link
Preview

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

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

The sequential fetching of nodes for each shard using a for-loop with await may be a performance bottleneck. Consider refactoring this loop using Promise.all to execute the node fetches concurrently.

Suggested change
for (let i = 0; i < shards.length; i++) {
try {
const nodes = await listNodes(
params.namespace,
cluster,
i.toString()
);
if (Array.isArray(nodes)) {
clusterNodeCount += nodes.length;
}
} catch (error) {
console.error(
`Failed to fetch nodes for shard ${i}:`,
error
);
}
}
const shardNodeCounts = await Promise.all(
shards.map(async (_, i) => {
try {
const nodes = await listNodes(
params.namespace,
cluster,
i.toString()
);
return Array.isArray(nodes) ? nodes.length : 0;
} catch (error) {
console.error(
`Failed to fetch nodes for shard ${i}:`,
error
);
return 0;
}
})
);
const clusterNodeCount = shardNodeCounts.reduce(
(sum, count) => sum + count,
0
);

Copilot uses AI. Check for mistakes.

@PragmaTwice PragmaTwice merged commit c6380ef into apache:unstable Jul 6, 2025
4 checks passed
@PragmaTwice
Copy link
Member

Thank you for your contribution! Sorry for the late merge.

@Jitmisra
Copy link
Contributor Author

Jitmisra commented Jul 6, 2025

Thank you for your contribution! Sorry for the late merge.

No worries at all , thank you for merging.

@Jitmisra Jitmisra deleted the redesign-cluster branch July 13, 2025 09:41
@Jitmisra Jitmisra restored the redesign-cluster branch July 13, 2025 09:42
@Jitmisra Jitmisra deleted the redesign-cluster branch July 13, 2025 09:45
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.

4 participants