FE-1687: Lay out the metric card's chart options as two aggregate dimensions and add an Enlarge button - #9666
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
89d12bd to
8a69ac8
Compare
8a69ac8 to
56ffb7e
Compare
56ffb7e to
3f625a5
Compare
PR SummaryLow Risk Overview Chart options no longer use a flat menu of mixed run/time choices. The ellipsis opens a popover with separate Runs (distribution metrics only) and Time blocks. Each block uses Every run / Every step vs Aggregate segments plus a select for heatmap, traces, or statistics. Settings still update the same fields, last choices are restored when toggling modes, and the popover stays open while the chart redraws. Enlarge sits next to chart options on each metric tile (experiments and optimization objective charts). It toggles a card to full row width and double row height; Shrink restores the default cell. Shared jsdom stubs for Popover, Select, and SegmentedControl support new unit tests and updated drawer tests. Reviewed by Cursor Bugbot for commit adf2dba. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
The enlargement controls currently expose conflicting focus and toggle-state behavior to keyboard and assistive-technology users.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Refines Petrinaut metric cards with two-dimensional chart aggregation controls and per-card enlargement.
Changes:
- Replaces the flat chart menu with Runs and Time aggregation controls.
- Adds per-card enlarge/shrink behavior and in-place plot resizing.
- Adds tests, stories, documentation, and a package changeset.
File summaries
| File | Description |
|---|---|
shared/metric-tiles.tsx |
Adds per-card sizing controls. |
shared/ds-control-stubs.tsx |
Adds shared test stubs for DS controls. |
shared/chart-card.tsx |
Supports spanning cards and dense grid packing. |
shared/chart-card.test.tsx |
Tests body-height calculations. |
shared/chart-card.stories.tsx |
Demonstrates an enlarged metric card. |
optimizations/view-optimization-drawer.test.tsx |
Tests enlargement in studies. |
experiments/view-experiment-drawer.test.tsx |
Tests enlargement in experiments. |
use-metric-plot.ts |
Resizes mounted uPlot charts in place. |
metric-view-menu/aggregation-dimension.tsx |
Implements reusable aggregation controls. |
metric-view-menu.tsx |
Replaces the flat menu with a popover. |
metric-view-menu.test.tsx |
Tests menu modes and selections. |
metric-view-menu.stories.tsx |
Adds distribution and scalar menu stories. |
docs/optimization.md |
Documents enlarged study metric cards. |
docs/experiments.md |
Documents the revised controls and enlargement. |
.changeset/metric-card-chart-options.md |
Records the Petrinaut patch change. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 2
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3f625a5 to
85a4725
Compare
8fe0bb7 to
79850fe
Compare
…d's toggle as pressed
… of a padding the withPadding override cancelled
79850fe to
adf2dba
Compare
Summary
Before this PR, a metric card's Chart options button opened one flat list of seventeen items under two headings: Heatmap, Percentile lines and eight statistics under Runs; Value, two running extremes and four aggregates under Time. Nothing said which items aggregate and which draw every run or step, picking one silently dropped the other mode's choice, and the card had no way to grow beyond its grid cell.
This PR lays the menu out as the two dimensions the settings already have. The same ellipsis opens a compact popover with a Runs block and a Time block, each a two-segment switch,
Every run | AggregateandEvery step | Aggregate, beside one select whose options follow the mode. Switching a mode back restores that side's last statistic, and the chart redraws behind the open popover. Right of the ellipsis a second button enlarges the card to the grid's full row at twice the height and shrinks it back, per card, without touching the other cards' sizes.9666.mp4
Links
Changes
Chart options
PopoverdefaultsEnlarge
Tests
Review fixes
reading-flow: grid-orderpressedTest coverage
metric-view-menu.test.tsx:metric-tilescoverage inview-experiment-drawer.test.tsxandview-optimization-drawer.test.tsx:chart-card.test.tsx:How to test