Skip to content

Add polished theme and motion examples - #79

Merged
tannerlinsley merged 5 commits into
mainfrom
taren/catalog-theme-motion
Aug 11, 2026
Merged

Add polished theme and motion examples#79
tannerlinsley merged 5 commits into
mainfrom
taren/catalog-theme-motion

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • add five polished theme and motion catalog cases with Recharts and Plot reference parity
  • expose inherited tooltip CSS variables and document reusable theme and motion patterns
  • strengthen catalog preview and census contracts and refresh comparison evidence

Release

  • minor: @tanstack/charts; the fixed release group will publish all 12 packages at 0.10.0

Validation

  • pnpm run validate
  • focused browser conformance: 5/5 visual, 3/3 behavior, 95% geometry

Summary by CodeRabbit

  • New Features
    • Customize built-in DOM tooltips with inherited CSS variables for colors, borders, sizing, spacing, shadows, and typography.
    • Added themed interactive areas, dashboards, KPI sparklines, donut metrics, and palette-based chart examples.
  • Documentation
    • Added guidance for themes, motion, reduced-motion behavior, tooltip styling, and styling ownership.
    • Expanded chart gallery navigation and reference materials.
  • Bug Fixes
    • Improved catalog preview reliability when transient browser errors occur.
  • Tests
    • Expanded coverage for tooltip styling, themes, responsive layouts, interactions, accessibility, animation, and cleanup.
    • Added five conformance scenarios.

@nx-cloud

nx-cloud Bot commented Aug 10, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 7ceac8c

Command Status Duration Result
nx run charts-workspace:ci-distributed ✅ Succeeded 4m 34s View ↗
nx run charts-workspace:package-check ✅ Succeeded <1s View ↗
nx run charts-workspace:benchmark-check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-11 00:04:46 UTC

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d0fb31aa-0d6a-48fd-9c92-91122825a46a

📥 Commits

Reviewing files that changed from the base of the PR and between dae1333 and 7ceac8c.

📒 Files selected for processing (3)
  • benchmarks/conformance/cases/123-active-donut-metric/chart.ts
  • benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts
  • benchmarks/conformance/previews/manifest.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • benchmarks/conformance/previews/manifest.json
  • benchmarks/conformance/cases/123-active-donut-metric/chart.ts

📝 Walkthrough

Walkthrough

The PR adds five themed interactive chart conformance cases, CSS-variable tooltip theming, theme and motion documentation, catalog validation, Chromium preview retries, and refreshed benchmark metadata.

Changes

Themed chart and motion coverage

Layer / File(s) Summary
Tooltip theming and documentation
packages/charts-core/src/tooltip.ts, packages/charts-core/src/runtime.test.ts, docs/..., packages/charts-core/docs/...
Tooltip appearance now uses inherited --ts-chart-tooltip-* variables with existing fallbacks. Documentation covers tooltip styling and theme and motion ownership.
Cases 120–124
benchmarks/conformance/cases/120-..., 121-..., 122-..., 123-..., 124-...
Added themed area, active bar, KPI sparkline, active donut, and palette matrix cases with definitions, reference views, mounts, interactions, animation handling, and tests.
Catalog and preview validation
benchmarks/conformance/catalog-index.json, benchmarks/conformance/definition-coverage-*, scripts/catalog-preview.*
Registered five cases, updated coverage counts, added presentation checks, and added one-time fresh-context retries for transient Chromium errors.
Benchmark refresh
benchmarks/comparison/bundle-baseline.json, docs/comparison.md, packages/charts-core/docs/comparison.md, scripts/measure-bundles.mjs
Updated workspace revisions, bundle measurements, conformance totals, and the gzip budget.
Supporting records
API-FRICTION.md, benchmarks/conformance/previews/manifest.json, docs/config.json, packages/charts-core/docs/config.json, llms.txt
Updated friction findings, preview assets, navigation, and documentation indexes.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: full-conformance

Sequence Diagram(s)

sequenceDiagram
  participant Catalog
  participant CaseMount
  participant ChartDefinition
  participant Renderer
  participant ConformanceTests

  Catalog->>CaseMount: mount a conformance case
  CaseMount->>ChartDefinition: create chart scene and application state
  CaseMount->>Renderer: render and animate chart marks
  Renderer-->>CaseMount: report settled state
  ConformanceTests->>CaseMount: inspect targets, state, geometry, and cleanup
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.23% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding polished theme and motion examples.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/catalog-theme-motion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Actionable comments posted: 7

🧹 Nitpick comments (12)
benchmarks/conformance/cases/120-themed-interactive-area/tanstack.ts (1)

216-311: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: inject the card stylesheet once per document.

Every mount appends an identical class-scoped <style> block. The rules are not mount-scoped, so a page with several mounts holds several duplicate copies. Consider a document-level guard, for example a data-themed-area-styles marker on the first injected element, and skip injection when the marker exists. Keep the current behavior if per-mount teardown simplicity is the goal.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/120-themed-interactive-area/tanstack.ts` around
lines 216 - 311, Update the stylesheet injection around the
`document.createElement('style')` call to add the themed-area CSS only once per
document, using a document-level marker such as `data-themed-area-styles` on the
injected style element and skipping creation when that marker already exists.
Preserve the current stylesheet contents and mounting behavior.
benchmarks/conformance/cases/121-active-bar-dashboard/recharts.ts (1)

47-59: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Unmemoized rows feeds hook dependency arrays in both implementations. Each component calls dashboardRows(input.revision) directly in the render body, so the returned array has a new identity on every render. Both components then list that array in a hook dependency array, which defeats the memoization.

  • benchmarks/conformance/cases/121-active-bar-dashboard/recharts.ts#L47-L59: wrap dashboardRows(input.revision) in useMemo keyed on input.revision, so the effect at lines 52-54 runs only when the metric or revision changes, and remove the duplicate onMetricChange call in selectMetric.
  • benchmarks/conformance/cases/121-active-bar-dashboard/view.tsx#L63-L67: wrap dashboardRows(input.revision) in useMemo keyed on input.revision, so the useImperativeHandle dependency list at line 125 stops changing on every render.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/121-active-bar-dashboard/recharts.ts` around
lines 47 - 59, Memoize the dashboardRows result by input.revision in
benchmarks/conformance/cases/121-active-bar-dashboard/recharts.ts:47-59 and
benchmarks/conformance/cases/121-active-bar-dashboard/view.tsx:63-67, so the
dependent hooks receive a stable rows reference. In recharts.ts, remove the
duplicate onMetricChange call from selectMetric while preserving the
effect-driven update.
benchmarks/conformance/cases/121-active-bar-dashboard/tanstack.test.ts (1)

66-71: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert that the motion state is applied to the element settleChartMotion reads.

svg?.setAttribute(...) is a no-op if the query returns null, and the test still passes. settle() passes chartHost.current (the onRender container) to settleChartMotion, which resolves when the motion state is finished or null. Both the "attribute applied" path and the "element missing" path therefore satisfy await settled, so the test does not prove that the settle path observes the finished state.

Assert that svg exists before setting the attribute.

💚 Proposed test fix
       const hosts = container.querySelectorAll('.ts-chart-host')
       const svg = container.querySelector('svg.ts-chart')
       expect(hosts).toHaveLength(1)
-      svg?.setAttribute('data-ts-motion-state', 'finished')
+      expect(svg).not.toBeNull()
+      svg!.setAttribute('data-ts-motion-state', 'finished')
       const settled = handle.driver?.settle?.()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/121-active-bar-dashboard/tanstack.test.ts`
around lines 66 - 71, Ensure the test asserts that the queried `svg` element
exists before setting its motion state attribute. Update the test around
`settleChartMotion` and `settle()` so a missing `svg` fails the test rather than
allowing optional chaining to mask the issue, while preserving the existing
settled Promise assertions.
benchmarks/conformance/cases/123-active-donut-metric/chart.ts (2)

172-180: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Compute the total once.

browserTotal(rows) runs twice on lines 177 and 178.

♻️ Proposed change
   const selected = rows.find((row) => row.id === activeId) ?? rows[0]!
+  const total = browserTotal(rows)
   return {
     selected,
-    total: browserTotal(rows),
-    share: selected.visitors / browserTotal(rows),
+    total,
+    share: selected.visitors / total,
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/123-active-donut-metric/chart.ts` around lines
172 - 180, Update donutSummary to compute browserTotal(rows) once in a local
total variable, then reuse that variable for both the returned total and share
calculations.

41-48: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Derive the active arc from selected to keep the fallback consistent.

Line 47 filters arcs by activeId. Line 48 falls back to rows[0] when activeId matches no row. If an unknown activeId reaches this function, the center metric shows the first row while no wedge or ring renders. The arc count then drops from 7 to 5 and breaks the geometry contract in case.json.

Filter the arcs with selected.id so both branches use the same row.

♻️ Proposed change
   const arcs = pie(rows, { value: 'visitors', gapAngle })
-  const active = arcs.filter((row) => row.id === activeId)
   const selected = rows.find((row) => row.id === activeId) ?? rows[0]!
+  const active = arcs.filter((row) => row.id === selected.id)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/123-active-donut-metric/chart.ts` around lines
41 - 48, Update activeDonutDefinition so the active arc filter uses selected.id
instead of activeId, ensuring the fallback selected row also produces its
corresponding arc and preserves the expected geometry.
benchmarks/conformance/cases/123-active-donut-metric/recharts.ts (1)

496-531: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Share the anchor-resolution geometry helpers between both renderers. Both files define svgPathPoint and center with copied logic, but the sampling grids differ: 32×32 in recharts.ts and 10×10 in view.tsx. The two renderers can therefore resolve different points inside the same wedge, which reduces geometry parity for the shared wedge: anchor. The 32×32 grid also runs about 961 isPointInFill calls per target resolution.

  • benchmarks/conformance/cases/123-active-donut-metric/recharts.ts#L496-L531: move svgPathPoint, radialPathPoint, and center into a shared module under benchmarks/conformance/shared/, and import them here.
  • benchmarks/conformance/cases/123-active-donut-metric/view.tsx#L258-L292: delete the local svgPathPoint and center copies and import the shared helpers so both renderers use one sampling resolution.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/123-active-donut-metric/recharts.ts` around
lines 496 - 531, Extract svgPathPoint, radialPathPoint, and center from
benchmarks/conformance/cases/123-active-donut-metric/recharts.ts#L496-L531 into
a shared module under benchmarks/conformance/shared/, then import the shared
helpers in recharts.ts. In
benchmarks/conformance/cases/123-active-donut-metric/view.tsx#L258-L292, remove
the local svgPathPoint and center implementations and import the shared versions
so both renderers use the same sampling resolution and geometry logic.
benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts (1)

84-138: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a driver assertion for legend selection.

The test verifies layout and DOM structure only. The case.json scenario depends on driver.readState() returning activeId, focusedId, and the tooltip object with the same keys in both implementations. Click a legend button and compare readState() between both mounts. This catches contract drift between view.tsx and recharts.ts before the browser conformance run.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts` around
lines 84 - 138, Extend the active donut test around the existing legend button
assertions to click a legend button and read the driver state from each mount.
Compare the resulting readState() values, including activeId, focusedId, and
tooltip with matching keys, so both TanStack and Recharts implementations
satisfy the scenario contract before cleanup.
benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx (2)

19-19: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Memoize metrics so the per-card useMemo works.

premiumKpisForRevision(input.revision) returns new metric objects on every render. The useMemo in KpiCard depends on metric, so its dependency changes on every render and premiumKpiDefinition runs again. Chart then receives a new definition object on every render, which can restart the spring transition.

♻️ Proposed fix
-  const metrics = premiumKpisForRevision(input.revision)
+  const metrics = useMemo(
+    () => premiumKpisForRevision(input.revision),
+    [input.revision],
+  )

Also applies to: 109-110

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx` at line 19,
Memoize the result of premiumKpisForRevision in the view component so metrics
remains referentially stable when input.revision has not changed. Update the
relevant useMemo dependency list around metrics and preserve the existing
KpiCard metric dependency behavior, preventing unnecessary premiumKpiDefinition
and Chart definition recalculation.

233-364: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the shared KPI styles and layout into one module. The TanStack view and the Plot reference each define an identical style constant and an identical fullLayout function. A change to one copy silently breaks visual parity with the other, and the color-scheme assertions in plot.test.ts and tanstack.test.ts then diverge.

  • benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx#L233-L364: move premiumKpiStyles into a new shared module in this case directory, for example styles.ts, and import it.
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx#L212-L231: move fullLayout and the fullGap constant into the same shared module and import them.
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/plot.ts#L301-L432: delete premiumKpiPlotStyles and import the shared constant.
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/plot.ts#L280-L299: delete the local fullLayout and fullGap and import the shared versions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx` around
lines 233 - 364, Extract the duplicated KPI layout and styles into a shared
module: in
benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx:212-231 and
:233-364, move fullLayout, fullGap, and premiumKpiStyles into the new module and
import them; in plot.ts:280-299 and :301-432, remove the local fullLayout,
fullGap, and premiumKpiPlotStyles definitions and import the shared versions,
preserving identical behavior and styling.
packages/charts-core/src/runtime.test.ts (1)

365-389: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add one assertion for an inherited override.

These assertions verify the inline var(...) declarations and fallback strings. They do not verify that a --ts-chart-tooltip-* value set on the chart container reaches the tooltip. Add a browser-level check for at least one token, or confirm that the existing browser conformance suite already covers this behavior.

Based on the PR objective, inherited tooltip variables are part of the public behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/charts-core/src/runtime.test.ts` around lines 365 - 389, Add a
browser-level assertion in the tooltip runtime test that sets at least one
--ts-chart-tooltip-* custom property on the chart container and verifies the
tooltip inherits and uses that value. Reuse the existing tooltip setup and
preserve the current inline var(...) fallback assertions.
benchmarks/conformance/cases/124-theme-palette-matrix/plot.ts (1)

119-134: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid assigning undefined to style properties.

Object.assign copies undefined into panel.style, which the CSSOM stringifies to "undefined" and then rejects as an invalid value. The panel element is recreated on every render, so no stale value survives, but the intent is clearer if the preview-only properties are set conditionally.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/124-theme-palette-matrix/plot.ts` around lines
119 - 134, Update the Object.assign call configuring panel.style to omit
preview-only properties when preview is true instead of assigning undefined.
Keep the existing non-preview gridTemplateColumns, border, and borderRadius
values, and apply those properties conditionally while preserving all other
style assignments.
benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts (1)

69-105: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for resolveTarget.

The driver in view.tsx (Lines 63-71) parses a palette:<id> anchor and returns the panel center. No test exercises this path. A wrong prefix or a wrong data-palette-treatment selector would return null and browser behavior scenarios would fail without a unit-level signal. Add one assertion for a valid anchor and one for an unknown anchor.

💚 Suggested addition
     expect(handle.driver?.readState()).toMatchObject({
       rowCount: 8,
       paletteCount: 3,
       svgCount: 3,
       palettes: ['neutral', 'vibrant', 'monochrome'],
     })
+    expect(
+      handle.driver?.resolveTarget({ anchor: 'palette:vibrant' }),
+    ).not.toBeNull()
+    expect(
+      handle.driver?.resolveTarget({ anchor: 'palette:unknown' }),
+    ).toBeNull()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts`
around lines 69 - 105, Add coverage for the driver's resolveTarget behavior in
the existing test: assert that a valid palette:<id> anchor resolves to the
corresponding panel center, and that an unknown anchor returns null. Use the
mounted handle/driver and existing palette fixture symbols, without changing the
current rendering assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@benchmarks/conformance/cases/120-themed-interactive-area/recharts.ts`:
- Around line 96-101: Update the cleanup effect around animationTracker to
dispose the current tracker and then reset animationTracker.current to null,
allowing the lazy initializer to create a usable tracker on remount while
preserving the existing cleanup behavior.

In `@benchmarks/conformance/cases/120-themed-interactive-area/tanstack.test.ts`:
- Around line 219-256: Update the reduced-motion test around mount and cleanup
so handle.destroy() runs in the finally block, including when assertions or
setup fail. Make the mocked matchMedia function return matches: true only when
the query is '(prefers-reduced-motion: reduce)' and false for other preference
queries, while preserving the existing restoration and container removal.
- Around line 48-52: Update the second assertion in the axis expectations to
guard the optional `axis`, `ticks`, and `values` fields using a nested matcher,
while preserving the `toHaveLength(3)` assertion for `values`. Keep the existing
`definition.x` access and axis shape checks unchanged.

In `@benchmarks/conformance/cases/123-active-donut-metric/recharts.ts`:
- Around line 454-464: Update sectorAngles to calculate the drawable sweep as
360 minus the non-zero item count multiplied by gapAngle, and base sector spans
on that sweep rather than the full 360 degrees. Keep the first sector anchored
at 90 degrees, apply one gapAngle offset before each later non-zero sector, and
preserve correct handling of zero-valued rows.

In `@benchmarks/conformance/cases/124-theme-palette-matrix/model.ts`:
- Around line 97-104: Keep paletteValue in model.ts unchanged and document that
consumers must opt into both color schemes. In view.tsx lines 124-141, add
colorScheme: 'light dark' to the section style object; in plot.ts lines 119-134,
add the same declaration to the Object.assign(panel.style, …) call.

In `@docs/reference/focus-and-interaction.md`:
- Around line 777-792: Clarify the inherited tooltip-token documentation around
the variable table to note that tokens defined only on the chart container are
unavailable when the portal fallback mounts the tooltip under
ownerDocument.body. Link to or briefly reference the existing portal guidance
and state that body-level tokens are required to preserve themed styling when
Popover is unavailable.

In `@scripts/catalog-definition-shapes.test.mjs`:
- Around line 60-62: Update classifyDefinitions to recognize defineChart calls
with the supported two-argument (definition, options) form, so the five new
cases include all four such calls while preserving existing one-argument
classification and counts.

---

Nitpick comments:
In `@benchmarks/conformance/cases/120-themed-interactive-area/tanstack.ts`:
- Around line 216-311: Update the stylesheet injection around the
`document.createElement('style')` call to add the themed-area CSS only once per
document, using a document-level marker such as `data-themed-area-styles` on the
injected style element and skipping creation when that marker already exists.
Preserve the current stylesheet contents and mounting behavior.

In `@benchmarks/conformance/cases/121-active-bar-dashboard/recharts.ts`:
- Around line 47-59: Memoize the dashboardRows result by input.revision in
benchmarks/conformance/cases/121-active-bar-dashboard/recharts.ts:47-59 and
benchmarks/conformance/cases/121-active-bar-dashboard/view.tsx:63-67, so the
dependent hooks receive a stable rows reference. In recharts.ts, remove the
duplicate onMetricChange call from selectMetric while preserving the
effect-driven update.

In `@benchmarks/conformance/cases/121-active-bar-dashboard/tanstack.test.ts`:
- Around line 66-71: Ensure the test asserts that the queried `svg` element
exists before setting its motion state attribute. Update the test around
`settleChartMotion` and `settle()` so a missing `svg` fails the test rather than
allowing optional chaining to mask the issue, while preserving the existing
settled Promise assertions.

In `@benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx`:
- Line 19: Memoize the result of premiumKpisForRevision in the view component so
metrics remains referentially stable when input.revision has not changed. Update
the relevant useMemo dependency list around metrics and preserve the existing
KpiCard metric dependency behavior, preventing unnecessary premiumKpiDefinition
and Chart definition recalculation.
- Around line 233-364: Extract the duplicated KPI layout and styles into a
shared module: in
benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx:212-231 and
:233-364, move fullLayout, fullGap, and premiumKpiStyles into the new module and
import them; in plot.ts:280-299 and :301-432, remove the local fullLayout,
fullGap, and premiumKpiPlotStyles definitions and import the shared versions,
preserving identical behavior and styling.

In `@benchmarks/conformance/cases/123-active-donut-metric/chart.ts`:
- Around line 172-180: Update donutSummary to compute browserTotal(rows) once in
a local total variable, then reuse that variable for both the returned total and
share calculations.
- Around line 41-48: Update activeDonutDefinition so the active arc filter uses
selected.id instead of activeId, ensuring the fallback selected row also
produces its corresponding arc and preserves the expected geometry.

In `@benchmarks/conformance/cases/123-active-donut-metric/recharts.ts`:
- Around line 496-531: Extract svgPathPoint, radialPathPoint, and center from
benchmarks/conformance/cases/123-active-donut-metric/recharts.ts#L496-L531 into
a shared module under benchmarks/conformance/shared/, then import the shared
helpers in recharts.ts. In
benchmarks/conformance/cases/123-active-donut-metric/view.tsx#L258-L292, remove
the local svgPathPoint and center implementations and import the shared versions
so both renderers use the same sampling resolution and geometry logic.

In `@benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts`:
- Around line 84-138: Extend the active donut test around the existing legend
button assertions to click a legend button and read the driver state from each
mount. Compare the resulting readState() values, including activeId, focusedId,
and tooltip with matching keys, so both TanStack and Recharts implementations
satisfy the scenario contract before cleanup.

In `@benchmarks/conformance/cases/124-theme-palette-matrix/plot.ts`:
- Around line 119-134: Update the Object.assign call configuring panel.style to
omit preview-only properties when preview is true instead of assigning
undefined. Keep the existing non-preview gridTemplateColumns, border, and
borderRadius values, and apply those properties conditionally while preserving
all other style assignments.

In `@benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts`:
- Around line 69-105: Add coverage for the driver's resolveTarget behavior in
the existing test: assert that a valid palette:<id> anchor resolves to the
corresponding panel center, and that an unknown anchor returns null. Use the
mounted handle/driver and existing palette fixture symbols, without changing the
current rendering assertions.

In `@packages/charts-core/src/runtime.test.ts`:
- Around line 365-389: Add a browser-level assertion in the tooltip runtime test
that sets at least one --ts-chart-tooltip-* custom property on the chart
container and verifies the tooltip inherits and uses that value. Reuse the
existing tooltip setup and preserve the current inline var(...) fallback
assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ae25c56d-f701-4daf-97fe-97357e5139e3

📥 Commits

Reviewing files that changed from the base of the PR and between c17d677 and 54c7172.

⛔ Files ignored due to path filters (5)
  • benchmarks/conformance/previews/120-themed-interactive-area.svg is excluded by !**/*.svg
  • benchmarks/conformance/previews/121-active-bar-dashboard.svg is excluded by !**/*.svg
  • benchmarks/conformance/previews/122-premium-kpi-sparklines.svg is excluded by !**/*.svg
  • benchmarks/conformance/previews/123-active-donut-metric.svg is excluded by !**/*.svg
  • benchmarks/conformance/previews/124-theme-palette-matrix.svg is excluded by !**/*.svg
📒 Files selected for processing (72)
  • .changeset/polished-tooltips-theme.md
  • API-FRICTION.md
  • benchmarks/comparison/bundle-baseline.json
  • benchmarks/conformance/DEFINITION-COVERAGE-AUDIT.md
  • benchmarks/conformance/DEFINITION-COVERAGE-OVERVIEW.md
  • benchmarks/conformance/DEFINITION-COVERAGE-PLAN.md
  • benchmarks/conformance/cases/120-themed-interactive-area/animation.test.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/animation.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/case.json
  • benchmarks/conformance/cases/120-themed-interactive-area/chart.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/model.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/recharts.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/tanstack.test.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/tanstack.ts
  • benchmarks/conformance/cases/121-active-bar-dashboard/case.json
  • benchmarks/conformance/cases/121-active-bar-dashboard/chart.ts
  • benchmarks/conformance/cases/121-active-bar-dashboard/model.ts
  • benchmarks/conformance/cases/121-active-bar-dashboard/recharts.ts
  • benchmarks/conformance/cases/121-active-bar-dashboard/tanstack.test.ts
  • benchmarks/conformance/cases/121-active-bar-dashboard/tanstack.ts
  • benchmarks/conformance/cases/121-active-bar-dashboard/view.tsx
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/case.json
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/chart.ts
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/model.test.ts
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/model.ts
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/plot.test.ts
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/plot.ts
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/tanstack.test.ts
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/tanstack.ts
  • benchmarks/conformance/cases/122-premium-kpi-sparklines/view.tsx
  • benchmarks/conformance/cases/123-active-donut-metric/case.json
  • benchmarks/conformance/cases/123-active-donut-metric/chart.ts
  • benchmarks/conformance/cases/123-active-donut-metric/layout.ts
  • benchmarks/conformance/cases/123-active-donut-metric/model.ts
  • benchmarks/conformance/cases/123-active-donut-metric/recharts.ts
  • benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts
  • benchmarks/conformance/cases/123-active-donut-metric/tanstack.ts
  • benchmarks/conformance/cases/123-active-donut-metric/view.tsx
  • benchmarks/conformance/cases/124-theme-palette-matrix/case.json
  • benchmarks/conformance/cases/124-theme-palette-matrix/chart.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/model.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/plot.test.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/plot.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/view.tsx
  • benchmarks/conformance/catalog-index.json
  • benchmarks/conformance/definition-coverage-roadmap.json
  • benchmarks/conformance/definition-coverage-roadmap.test.ts
  • benchmarks/conformance/previews/manifest.json
  • docs/comparison.md
  • docs/config.json
  • docs/examples/index.md
  • docs/examples/themes-and-motion.md
  • docs/guides/dynamic-data-and-animation.md
  • docs/guides/themes-and-styling.md
  • docs/reference/focus-and-interaction.md
  • llms.txt
  • packages/charts-core/docs/comparison.md
  • packages/charts-core/docs/config.json
  • packages/charts-core/docs/examples/index.md
  • packages/charts-core/docs/examples/themes-and-motion.md
  • packages/charts-core/docs/guides/dynamic-data-and-animation.md
  • packages/charts-core/docs/guides/themes-and-styling.md
  • packages/charts-core/docs/reference/focus-and-interaction.md
  • packages/charts-core/llms.txt
  • packages/charts-core/src/runtime.test.ts
  • packages/charts-core/src/tooltip.ts
  • scripts/catalog-definition-shapes.test.mjs
  • scripts/catalog-preview.mjs
  • scripts/catalog-preview.test.mjs
  • scripts/measure-bundles.mjs

Comment thread benchmarks/conformance/cases/120-themed-interactive-area/tanstack.test.ts Outdated
Comment thread benchmarks/conformance/cases/123-active-donut-metric/recharts.ts Outdated
Comment thread benchmarks/conformance/cases/124-theme-palette-matrix/model.ts
Comment thread docs/reference/focus-and-interaction.md
Comment thread scripts/catalog-definition-shapes.test.mjs Outdated

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts`:
- Around line 84-101: Extend the test around sectorAngles to also inspect the
TanStack active overlay definition or mounted overlay using the same rows, and
assert its start and end angles against the native sectorAngles reference. Keep
the existing Recharts angle assertions, but ensure the test fails when TanStack
overlay angles regress.

In `@benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts`:
- Around line 113-134: Wrap the mount and panel assertions in a try/finally
within the test callback, and move handle.destroy() plus container.remove() into
the finally block. Ensure cleanup runs even when mounting or any expectation
fails.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c74e37-5722-434d-87a6-836dcd53d094

📥 Commits

Reviewing files that changed from the base of the PR and between 54c7172 and 1b837b1.

📒 Files selected for processing (15)
  • API-FRICTION.md
  • benchmarks/conformance/cases/120-themed-interactive-area/recharts.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/tanstack.test.ts
  • benchmarks/conformance/cases/123-active-donut-metric/recharts.ts
  • benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/model.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/plot.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/view.tsx
  • benchmarks/conformance/previews/manifest.json
  • docs/reference/focus-and-interaction.md
  • packages/charts-core/docs/reference/focus-and-interaction.md
  • scripts/catalog-definition-shapes.test.mjs
  • scripts/catalog-preview.mjs
  • scripts/catalog-preview.test.mjs
🚧 Files skipped from review as they are similar to previous changes (10)
  • packages/charts-core/docs/reference/focus-and-interaction.md
  • docs/reference/focus-and-interaction.md
  • benchmarks/conformance/previews/manifest.json
  • benchmarks/conformance/cases/124-theme-palette-matrix/view.tsx
  • benchmarks/conformance/cases/124-theme-palette-matrix/model.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/tanstack.test.ts
  • benchmarks/conformance/cases/123-active-donut-metric/recharts.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/plot.ts
  • benchmarks/conformance/cases/120-themed-interactive-area/recharts.ts
  • API-FRICTION.md

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@benchmarks/conformance/cases/123-active-donut-metric/chart.ts`:
- Around line 46-47: Compute the fallback-aware selected row before calling
activeDonutArcs, then pass selected.id instead of the original activeId so the
overlay matches the center text when the ID is unknown. Add a regression test
covering an unknown active ID and verifying the fallback row’s active wedge or
ring is rendered.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 90b0934a-696e-4d51-9903-7abea16e93f4

📥 Commits

Reviewing files that changed from the base of the PR and between 1b837b1 and dae1333.

📒 Files selected for processing (7)
  • API-FRICTION.md
  • benchmarks/conformance/cases/123-active-donut-metric/chart.ts
  • benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts
  • benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts
  • benchmarks/conformance/previews/manifest.json
  • scripts/catalog-preview.mjs
  • scripts/catalog-preview.test.mjs
🚧 Files skipped from review as they are similar to previous changes (6)
  • benchmarks/conformance/cases/124-theme-palette-matrix/tanstack.test.ts
  • benchmarks/conformance/previews/manifest.json
  • benchmarks/conformance/cases/123-active-donut-metric/tanstack.test.ts
  • API-FRICTION.md
  • scripts/catalog-preview.test.mjs
  • scripts/catalog-preview.mjs

Comment thread benchmarks/conformance/cases/123-active-donut-metric/chart.ts Outdated
@tannerlinsley
tannerlinsley merged commit 39242bd into main Aug 11, 2026
18 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 11, 2026
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.

1 participant