Skip to content

feat(experimentation): metrics list view with edit, delete and pagination#7731

Merged
Zaimwa9 merged 10 commits into
mainfrom
feat/experiment-metrics-list-view
Jun 9, 2026
Merged

feat(experimentation): metrics list view with edit, delete and pagination#7731
Zaimwa9 merged 10 commits into
mainfrom
feat/experiment-metrics-list-view

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Builds the metrics list experience on top of the create-metric foundation, against the metrics API now on main:

  • List viewMetricsTable renders an environment's metrics with pagination, including the experiments each metric is attached to (new experiments[] field).
  • Edit — new updateMetric (PATCH) mutation wired into the create form for editing existing metrics.
  • Delete — delete action surfaced in the table.
  • Search — debounced name search (q param) with a dedicated empty state.

How did you test this code?

  • Unit tests for the create/edit form helpers (CreateMetricForm/__tests__/utils.test.ts).
  • Manually, against the merged metrics API:
    1. Open an environment → Metrics.
    2. Create a metric, confirm it appears; page through when there are several.
    3. Edit it via the form and confirm the change persists after reload.
    4. Search by name; delete a metric and confirm it's removed.

Zaimwa9 added 6 commits June 5, 2026 09:05
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.
@Zaimwa9 Zaimwa9 requested a review from a team as a code owner June 8, 2026 15:07
@Zaimwa9 Zaimwa9 requested review from talissoncosta and removed request for a team June 8, 2026 15:07
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jun 9, 2026 8:28am
flagsmith-frontend-staging Ready Ready Preview, Comment Jun 9, 2026 8:28am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 9, 2026 8:28am

Request Review

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Jun 8, 2026
@github-actions github-actions Bot added the feature New feature or request label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-7731 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-7731 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-7731 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7731 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7731 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-7731 Finished ✅ Results

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  19 passed

Details

stats  19 tests across 15 suites
duration  1 minute, 6 seconds
commit  0bbf16d
info  🔄 Run: #17344 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.9 seconds
commit  0bbf16d
info  🔄 Run: #17344 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.8 seconds
commit  0bbf16d
info  🔄 Run: #17344 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  53 seconds
commit  0bbf16d
info  🔄 Run: #17344 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  34.3 seconds
commit  ec176e5
info  🔄 Run: #17346 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.1 seconds
commit  ec176e5
info  🔄 Run: #17346 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  34 seconds
commit  ec176e5
info  🔄 Run: #17346 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.1 seconds
commit  ec176e5
info  🔄 Run: #17346 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41 seconds
commit  852ceac
info  🔄 Run: #17362 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  19 passed

Details

stats  19 tests across 15 suites
duration  1 minute, 7 seconds
commit  852ceac
info  🔄 Run: #17362 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  39.5 seconds
commit  852ceac
info  🔄 Run: #17362 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  54 seconds
commit  852ceac
info  🔄 Run: #17362 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.7 seconds
commit  11053fe
info  🔄 Run: #17364 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  44.4 seconds
commit  11053fe
info  🔄 Run: #17364 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.8 seconds
commit  11053fe
info  🔄 Run: #17364 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40 seconds
commit  11053fe
info  🔄 Run: #17364 (attempt 1)

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@Zaimwa9 Zaimwa9 requested review from gagantrivedi and removed request for talissoncosta June 8, 2026 15:41
@Zaimwa9

Zaimwa9 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 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.

Comment thread frontend/web/components/experiments/MetricsTable/MetricsTable.tsx Outdated
Comment thread frontend/web/components/pages/MetricsPage.tsx
Comment thread frontend/web/components/pages/MetricsPage.tsx Outdated
Comment thread frontend/web/components/pages/MetricsPage.tsx
Comment thread frontend/web/components/pages/MetricsPage.tsx Outdated
@Zaimwa9

Zaimwa9 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 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.

Comment thread frontend/web/components/pages/MetricsPage.tsx
Comment thread frontend/web/components/pages/MetricsPage.tsx
Comment thread frontend/web/components/pages/MetricsPage.tsx
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jun 9, 2026
Base automatically changed from feat/experiment-metrics-frontend to main June 9, 2026 08:17
@Zaimwa9 Zaimwa9 merged commit fef753d into main Jun 9, 2026
28 of 29 checks passed
@Zaimwa9 Zaimwa9 deleted the feat/experiment-metrics-list-view branch June 9, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants