Skip to content

feat: redesign CPU section #2597

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 2 commits into from
Jul 24, 2025
Merged

feat: redesign CPU section #2597

merged 2 commits into from
Jul 24, 2025

Conversation

astandrik
Copy link
Collaborator

@astandrik astandrik commented Jul 22, 2025

Closes #2445

Stand

Figma

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
354 349 0 3 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.22 MB | Main: 85.21 MB
Diff: +0.01 MB (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.

Copilot

This comment was marked as outdated.

@astandrik astandrik requested a review from Copilot July 22, 2025 14:54
Copilot

This comment was marked as outdated.

@astandrik
Copy link
Collaborator Author

bugbot run

Copilot

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@astandrik astandrik requested a review from Copilot July 23, 2025 14:23
@astandrik
Copy link
Collaborator Author

bugbot run

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

Redesign of the CPU section in the tenant diagnostics interface to improve navigation and organization. This change transforms the previous linear layout into a tabbed interface with enhanced navigation controls.

  • Restructures CPU section with tabs for Nodes, Shards, and Queries
  • Adds node filtering modes (by load vs by pool usage) with "All Nodes" navigation link
  • Refactors MetricsCards to MetricsTabs with updated CSS class names

Reviewed Changes

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

Show a summary per file
File Description
tests/suites/tenant/diagnostics/Diagnostics.ts Updates test selectors to use new CSS class names
src/utils/metrics.ts Updates comment reference from MetricsCards to MetricsTabs
src/store/state-url-mapping.ts Adds URL mapping for new cpuTab and nodesMode state
src/store/reducers/tenant/types.ts Defines TypeScript types for CPU tab and nodes mode
src/store/reducers/tenant/tenant.ts Implements Redux actions and state management for CPU navigation
src/store/reducers/tenant/constants.ts Defines constants for CPU tabs and nodes mode options
src/containers/Tenant/TenantPages.tsx Adds cpuTab to tenant tabs groups
src/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json Adds internationalization keys for new UI elements
src/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.tsx Makes title prop optional for flexible table layouts
src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx Updates component imports and layout structure
src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss Updates CSS classes and typography mixins
src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.tsx Removes title and navigation logic, simplifies component
src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.tsx Removes title and navigation logic, simplifies component
src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.tsx Major redesign with tabbed interface and enhanced navigation
src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.scss New stylesheet for redesigned CPU section
src/containers/Tenant/Diagnostics/TenantOverview/MetricsTabs/MetricsTabs.tsx Renames component from MetricsCards to MetricsTabs
src/containers/Tenant/Diagnostics/TenantOverview/MetricsTabs/MetricsTabs.scss Updates CSS class names throughout stylesheet
CONTRIBUTING.md Adds development guidelines for updating documentation
.github/copilot-instructions.md New file with GitHub Copilot instructions for the project

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 👎

@@ -48,12 +52,31 @@ const slice = createSlice({
const isValidTab = action.payload && validTabs.includes(action.payload as any);
state.metricsTab = isValidTab ? action.payload : TENANT_METRICS_TABS_IDS.cpu;
},
setCpuTab: (state, action: PayloadAction<TenantCpuTab>) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need these in redux? It seems to be local state...

Copy link
Collaborator Author

@astandrik astandrik Jul 24, 2025

Choose a reason for hiding this comment

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

These tabs are in Redux rather than local state because of URL synchronization- The cpuTab state is automatically synced with URL parameters through the state-url-mapping.ts middleware. This enables:

  • Shareable URLs (e.g., /tenant?cpuTab=queries)
  • Browser back/forward navigation
  • State persistence on page refresh

Without Redux, you'd lose the ability to share links to specific tabs, browser history wouldn't work correctly, and refreshing the page would reset to the default tab. The URL-state synchronization is the key reason - it's not truly "local" state when it needs to be reflected in the URL.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far as I see its common way to work with tabs in our app

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved to search params pattern

@astandrik astandrik requested a review from Raubzeug July 24, 2025 09:52
@astandrik astandrik added this pull request to the merge queue Jul 24, 2025
Merged via the queue into main with commit c170578 Jul 24, 2025
12 of 15 checks passed
@astandrik astandrik deleted the astandrik.2445-3 branch July 24, 2025 18:22
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.

redesign CPU section
2 participants