Skip to content

feat(ui): add DashboardsListPage, DashboardsPage, and routing integration - #490

Merged
AntonTyb merged 11 commits into
feat/metrics-dash-dialogsfrom
feat/metrics-dash-pages
Aug 21, 2026
Merged

AntonTyb merged 11 commits into
feat/metrics-dash-dialogsfrom
feat/metrics-dash-pages

Conversation

@AntonTyb

@AntonTyb AntonTyb commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR implements the third and final layer of the Performance Dashboards UI visualization pipeline by introducing the top-level page views (DashboardsListPageComponent and DashboardsPageComponent) and wiring dashboard navigation and routes into the main application.

Motivation & Context

With core models/services (#449), visualization plot cards (#461), container grids (#488), and interactive configuration dialogs (#489) in place, the application requires:

  1. A landing page (/dashboards) for listing, filtering, and creating performance dashboards.
  2. A detailed dashboard view (/dashboards/:id) for rendering comparative experiment grid layouts with toolbar actions.
  3. App routing protected by performanceDashboardGuard and navigation sidebar integration governed by the performanceDashboardEnabled feature flag.

Key Changes

  • DashboardsListPageComponent (cmd/ui/app/pages/dashboards/dashboards_list_page/):
    • Implements the /dashboards landing page listing available dashboards.
    • Adds search filtering, dashboard creation CTA button triggering CreateDashboardDialogComponent, and navigation links to specific dashboards.
  • DashboardsPageComponent (cmd/ui/app/pages/dashboards/dashboards_page/):
    • Implements the detailed view for /dashboards/:id.
    • Subscribes to DashboardService to load the active dashboard configuration.
    • Hosts DashboardGridComponent and renders top-level toolbar actions including Add Chart (AddExperimentDialogComponent) and time range/step selectors.
  • Routing & Navigation Wiring (app_routes.ts, app.ng.html, app.ts):
    • Registers /dashboards and /dashboards/:id routes protected by authGuard and performanceDashboardGuard.
    • Conditionally renders the "Dashboards" navigation menu item in the app sidebar when isPerformanceDashboardEnabled is true.
  • Unit Tests & Component Harnesses:
    • Adds full unit test coverage and Angular CDK component test harnesses for both page components and app routing.

Verification & Testing

  • Local Unit Tests:
    • bazel test //cmd/ui:ui_unit_tests (All 334 tests passed, including DashboardsListPageComponent, DashboardsPageComponent, and AppRoutes test suites).
  • Pre-commit Hooks:
    • Passed Buildifier, ESLint, Prettier, and license header verification.

TAG=agy
CONV=9ad586d8-14f0-4515-b966-fe385ce46c94

screenshot:

image

@github-actions
github-actions Bot requested a review from pachopepe August 19, 2026 21:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Performance Dashboards feature, adding a dashboard list page and a comparative detail page along with routing, guards, and tests, while removing the non-production authentication banner. The review feedback suggests several key improvements: deep-copying chart plots using structuredClone to prevent shared-state mutation, implementing persistence logic for the autosave toggle, safely mocking navigator.clipboard in tests to avoid failures in headless CI environments, and adding error feedback via a snackbar when dashboard loading fails.

@AntonTyb AntonTyb added the priority::2-high top of mind. should not wait. label Aug 20, 2026
@AntonTyb
AntonTyb requested review from VLukiantsev and removed request for pachopepe August 20, 2026 10:39
VLukiantsev
VLukiantsev previously approved these changes Aug 20, 2026
…tion

- Add DashboardsListPageComponent (/dashboards) with search filtering and creation dialog integration
- Add DashboardsPageComponent (/dashboards/:id) hosting DashboardGridComponent and Add Chart dialog
- Wire /dashboards routes protected by performanceDashboardGuard
- Conditionally render Dashboards navigation link when performanceDashboardEnabled is true

TAG=agy
CONV=9ad586d8-14f0-4515-b966-fe385ce46c94

Change-Id: I3ca6c11f067bca732d8f0c5026b7c9dba3b013e2
…Page

- Deep-copy templatePlots using structuredClone to prevent shared-state mutation across charts
- Integrate autosave persistence logic via DashboardService.updateDashboard when charts change
- Safely mock navigator.clipboard using Object.defineProperty in unit tests to prevent headless CI errors
- Inject SnackbarService and display user-friendly error message when listDashboards fails

TAG=agy
CONV=9ad586d8-14f0-4515-b966-fe385ce46c94

Change-Id: I3c47b9cb879cbf6ce91009a99b9064918675403e
…check

- Initialize each default comparison chart with an independent plots array in createDefaultCharts() to prevent shared-state mutation across default charts
- Add unit tests verifying independent plots array instances in DashboardsPage and deep-copied template plots in onOpenAddExperiment()
- Fix optional chaining on plot.data?.metrics?.[0] in CreateDashboardDialogComponent template to resolve TS2532 compiler error during production build

TAG=agy
CONV=c9f0c44d-4bdd-481b-bdb0-e72fa92b1e24

Change-Id: If82d15f9699849ca380f32ae246c774694fffbef
- Provide SnackbarService spy in TestBed.configureTestingModule for both dashboards_list_page_test.ts and dashboards_page_test.ts
- Replace monkey-patching of private component snackbar property with TestBed.inject(SnackbarService) to hermetically configure and test snackbar interactions

TAG=agy
CONV=892aa682-3895-4376-a997-3e03415caec0

Change-Id: Idc692a4adb051e2c3328cb004e0a4d50b58e31a6
- Refactor DashboardsListPage and DashboardsPage unit tests to adopt codebase standard cleanState, setupModule, and bootstrap testing helpers from xmanager_cloud/ui/app/testing/test.
- Remove top-level mutable let fixture, let component, and spy references declared inside describe closures to prevent state/DOM leakage across test specs and ensure automatic fixture teardown via afterEach.
- Update DashboardsPageHarness hostSelector to match root bootstrapped elements with [data-component-selector="xmc-dashboards-page"].

Comment link: #490

TAG=agy
CONV=8ec8744a-5569-4c96-a79d-c9a45c13b19c

Change-Id: I0488cea8dae2765c2e47e61affade89f32ca0c23
…helper

Remove hardcoded mock experiment fixtures (createDefaultPlots, createDefaultCharts, synthetic KPI metrics, and fallback comparison dashboard logic in loadDashboard) from dashboards_page.ts to ensure production source files remain strictly focused on live data rendering with proper empty/not-found states.

Create dedicated testing helper cmd/ui/app/testing/mock_dashboards.ts exporting reusable mock comparison dashboard and plot fixtures (createMockPlots, createMockComparisonCharts, createMockComparisonDashboard, createMockDashboardList).

Update dashboards_page_test.ts and dashboards_list_page_test.ts to import mock fixtures from mock_dashboards.ts instead of defining mock datasets inline or relying on production mock generators, and add tests for adding an experiment on an empty dashboard and handling absent/error dashboard states.

Comment link: #490

TAG=agy
CONV=0a5daed9-61cb-4dff-b5cd-f0c0243472bb

Change-Id: I30cac0b8057c43a11d0282e8c03e653e5f5425cc
Address PR review comment by injecting Angular CDK's Clipboard service (@angular/cdk/clipboard) via inject(Clipboard) in DashboardsPage. Refactor onShare() to use clipboard.copy(window.location.href), removing direct access to navigator.clipboard and trailing else branches. Update dashboards_page_test.ts to mock Clipboard using standard Angular Dependency Injection (TestBed.inject(Clipboard)) instead of hacking navigator.clipboard properties.

Comment link: #490

TAG=agy
CONV=3937319b-cf19-4d8c-bf2c-4d9c068439e3

Change-Id: Id54763409a5bcebb397460cd5a68fc8d6c5df834
Address PR review comment by extending DashboardsPageHarness with locators and action methods for header toolbar actions and not-found states (clickAddExperiment, clickRefresh, clickShare, isNotFoundVisible). Add descriptive CSS classes (.refresh-button, .add-experiment-button) to toolbar buttons in dashboards_page.ng.html for stable DOM querying. Refactor test suite in dashboards_page_test.ts to exercise user interactions through the CDK harness and DOM template bindings (emitting removeChart from DashboardGridComponent) instead of invoking component controller methods directly.

Comment link: #490

TAG=agy
CONV=dc37fe31-8cf2-4d16-927d-4357ab003275

Change-Id: Icd98dcc055736b6b6d7ad5561189bbbb7c7536e4
… fallback in DashboardsPage

Add unit test coverage for two boundary paths in DashboardsPage:
- Verify that charts remain unmodified when AddExperimentDialogComponent is closed without selection (afterClosed() emits undefined).
- Verify that dashboardNotFound signal is set to true when getDashboard errors for a non-existent dashboard ID.

Comment link: #490
Bug: PR-490

TAG=agy
CONV=53ae4a5b-1bd2-427f-b336-e9542dbae15e

Change-Id: I98b2c3c87d24f781525fbc5dacaad9ec1fe6e2f6
…in DashboardsListPage

Add aria-label="Filter dashboards by name or description" to the filter input and aria-label="Clear search query" to the clear button in DashboardsListPage to provide context to screen readers and improve accessibility compliance.
Add a unit test in dashboards_list_page_test.ts to verify both aria-label attributes are rendered in the DOM when a search query is present.

Bug: PR-490
Comment link: #490

TAG=agy
CONV=51542c75-64f0-4004-a49c-8873091fe753

Change-Id: I5cff6e76d0d9b279f7602b9ea43b4e05af6b66f3
…Dashboard

Use early return when id is present after router navigation in
DashboardsListPage.createDashboard to eliminate the redundant else block
and simplify control flow. Add unit tests verifying both navigation when an id
is present and reloading dashboards when id is absent or creation fails.

Comment link: #490

TAG=agy
CONV=a62c4ae5-cd71-46bf-ac13-7de5c2f95c68

Change-Id: Ie92ec82caf1161bb78b78c41de43c15ec8514f8c
@AntonTyb
AntonTyb dismissed VLukiantsev’s stale review August 21, 2026 08:07

The merge-base changed after approval.

@AntonTyb
AntonTyb force-pushed the feat/metrics-dash-pages branch from 25ade59 to 157e141 Compare August 21, 2026 08:07
@AntonTyb
AntonTyb added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 1bd054e Aug 21, 2026
15 checks passed
@AntonTyb
AntonTyb deleted the feat/metrics-dash-pages branch August 21, 2026 08:21
VLukiantsev added a commit that referenced this pull request Aug 21, 2026
Restore the isNonProdAuth computed signal and non-prod warning banner in App component that was accidentally dropped during the PR #490 merge.

BUG=b/535469656
TAG=agy
CONV=3dd78124-d582-4359-9410-28fd1a69f5a9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

koder::in_review open for review priority::2-high top of mind. should not wait.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants