Skip to content

feat: rework metric cards to tabs #2580

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

feat: rework metric cards to tabs #2580

wants to merge 21 commits into from

Conversation

astandrik
Copy link
Collaborator

@astandrik astandrik commented Jul 17, 2025

Closes #2443

Stand

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
354 347 0 5 2
Test Changes Summary ⏭️2

⏭️ Skipped Tests (2)

  1. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  2. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: 🔺

Current: 85.19 MB | Main: 85.18 MB
Diff: +9.81 KB (0.01%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@astandrik astandrik force-pushed the astandrik.2443 branch 2 times, most recently from 33d70ca to e6bb453 Compare July 21, 2025 08:45
@astandrik astandrik marked this pull request as ready for review July 21, 2025 10:41
@astandrik astandrik requested a review from Copilot July 21, 2025 11:39
Copy link
Contributor

@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

This PR reworks the metric cards from a traditional card-based interface to a tab-based navigation system for better UX and visual consistency. The changes improve state management, modernize UI components, and enhance the overall user experience with charts and metrics visualization.

  • Replaced traditional metric cards with tab-style navigation using TabCard components
  • Updated state management to ensure metrics tab always has a valid default value
  • Modernized chart components with integrated time frame controls and improved layout
  • Removed deprecated components and consolidated utility functions

Reviewed Changes

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

Show a summary per file
File Description
src/utils/metrics.ts New utility functions for metric calculations and aggregation
src/store/reducers/tenant/types.ts Made metricsTab required instead of optional
src/store/reducers/tenant/tenant.ts Added validation for metricsTab with CPU fallback
src/containers/Tenant/Diagnostics/TenantOverview/TabCard/TabCard.tsx New tab-style card component with doughnut metrics visualization
src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.tsx Complete refactor to use TabCard components with flex layout
src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.scss Extensive new styling for tab interface with pseudo-elements
src/components/MetricChart/MetricChart.tsx Simplified chart component with integrated time frame controls
src/components/QueriesActivityBar/QueriesActivityBar.tsx Updated from Disclosure to Card component
tests/suites/tenant/diagnostics/tabs/info.test.ts Updated test assertions for new metric structure
tests/suites/tenant/diagnostics/Diagnostics.ts Updated page object model for new CSS selectors
Comments suppressed due to low confidence (1)

src/components/MetricChart/MetricChart.tsx:29

  • The variable name and comment reference 'fullWidth' which is no longer a prop in this component. Consider renaming to DEFAULT_CHART_WIDTH or updating the comment to reflect current usage.
const DEFAULT_EFFECTIVE_WIDTH = 600; // Used for maxDataPoints calculation when using fullWidth

Comment on lines +88 to +89
const totalUsed = Number(items.reduce((sum, item) => sum + (item.used || 0), 0).toFixed(2));
const totalLimit = Number(items.reduce((sum, item) => sum + (item.limit || 0), 0).toFixed(2));

This comment was marked as off-topic.

@ydb-platform ydb-platform deleted a comment from Copilot AI Jul 21, 2025
@ydb-platform ydb-platform deleted a comment from Copilot AI Jul 21, 2025
@astandrik
Copy link
Collaborator Author

bugbot run

cursor[bot]

This comment was marked as outdated.

@astandrik
Copy link
Collaborator Author

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ BugBot reviewed your changes and found no bugs!


Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

rework metric cards to tabs
1 participant