feat(experimentation): metrics list view with edit, delete and pagination#7731
Conversation
…iment-metrics-frontend
Build the metrics list page: searchable, paginated table showing each metric's aggregation, event, usage and last-updated, with create, edit (reusing CreateMetricForm) and delete actions. Wire the new experiments field, update mutation and q search into the metric service. Drop the pagination top border on the experiments and metrics lists, and lighten the experiment status badge.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for searching, paginating, editing, and deleting experiment metrics in the frontend. It introduces a new MetricsTable component, updates the CreateMetricForm to support editing, and refactors the MetricsPage to integrate these features. The code review identified several issues to address, including a potential runtime crash if metric.experiments is undefined, a missing Input import, unsafe parsing of the editingId query parameter (which could result in NaN or incorrectly treat 0 as falsy), and an infinite loading spinner when an invalid metric ID is provided in the edit view.
… experiment counts
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to edit and delete experiment metrics, adding a new MetricsTable component, a search bar, and pagination to the MetricsPage. It also updates CreateMetricForm to support editing with an initial state and adds corresponding unit tests and RTK Query mutations. Feedback on these changes includes resolving a missing import for the Input component, addressing a potential bug when deep-linking to edit a metric on a non-default page, and adding a unique key prop to CreateMetricForm to prevent stale state issues.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Builds the metrics list experience on top of the create-metric foundation, against the metrics API now on
main:MetricsTablerenders an environment's metrics with pagination, including the experiments each metric is attached to (newexperiments[]field).updateMetric(PATCH) mutation wired into the create form for editing existing metrics.qparam) with a dedicated empty state.How did you test this code?
CreateMetricForm/__tests__/utils.test.ts).