Skip to content

feat(react-charts): add high contrast#12419

Open
mcoker wants to merge 8 commits intopatternfly:mainfrom
mcoker:hc-charts
Open

feat(react-charts): add high contrast#12419
mcoker wants to merge 8 commits intopatternfly:mainfrom
mcoker:hc-charts

Conversation

@mcoker
Copy link
Copy Markdown
Contributor

@mcoker mcoker commented May 8, 2026

Relies on patternfly/patternfly#8379 as the core dependency to work

Updates charts with high contrast styles - it's the react half of patternfly/patternfly#7949

Has some hero component changes to pass the build that will need to be removed before merging.

Ran visual regressions for charts in light/dark/hc

Light theme - backstop-light.pdf
Dark theme - backstop-dark.pdf
High contrast - backstop-hc.pdf
High contrast dark - backstop-dark-hc.pdf

If you want to see the actual reports so you can open the images and hwhat-not, here's a zip. Just open the "index.html" files in the "html_report" directories - https://drive.google.com/file/d/1Hu9toF55uln05UzqXi2wvLyxP8DcSFRa/view?usp=sharing

Summary by CodeRabbit

  • Chores

    • Updated PatternFly dependency to 6.5.0-prerelease.86 across packages for compatibility and stability.
  • Chart Improvements

    • Chart themes updated to use CSS variable tokens for more consistent styling (including stroke and stroke width).
    • Legend styling refined to remove unwanted outlines.
    • Skeleton color scales adjusted for improved visual consistency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR updates Victory and ECharts chart themes to use CSS variable tokens for stroke color and strokeWidth (and some fillOpacity) across area, bar, legend, pie, bullet, and donut components; switches skeleton color scales to chart_skeleton tokens; and bumps @patternfly/patternfly dev/dependencies from 6.5.0-prerelease.82 to 6.5.0-prerelease.86.

Changes

Chart Theme Token Styling

Layer / File(s) Summary
Token Imports
packages/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts
Imports chart_legend_data_stroke_Color, chart_legend_data_stroke_Width, chart_donut_pie_data_stroke_Color, chart_donut_pie_data_stroke_Width, chart_bullet_bar_stroke_Color, and chart_bullet_bar_stroke_Width.
Base Theme Style Updates
packages/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts
Area, bar, legend, and pie styles switch from token .value to .var for fillOpacity and strokeWidth; legend style adds stroke and strokeWidth sourced from legend tokens.
Component Theme Styling
packages/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts
BulletPrimaryDotMeasure scatter and BulletPrimarySegmentedMeasure bar styles add stroke and strokeWidth; donut variants (donut, donutThresholdDynamic, donutThresholdStatic, donutUtilization) add pie stroke styling via donut tokens.
Skeleton Color Scale & Legend Data
packages/react-charts/src/echarts/components/themes/colors/skeleton-theme.ts, packages/react-charts/src/victory/components/ChartTheme/themes/colors/skeleton-theme.ts, packages/react-charts/src/victory/components/ChartTheme/themes/skeleton-theme.ts
ECharts and Victory skeleton color scales replace bullet qualitative range tokens with chart_skeleton tokens; Victory ColorTheme legend data style sets stroke: 'transparent' and strokeWidth: 0.

Dependency Updates

Layer / File(s) Summary
PatternFly Dependency Bump
packages/react-core/package.json, packages/react-docs/package.json, packages/react-icons/package.json, packages/react-styles/package.json, packages/react-tokens/package.json
@patternfly/patternfly dependency updated from 6.5.0-prerelease.82 to 6.5.0-prerelease.86 across listed packages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • thatblindgeye
  • nicolethoen
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'feat(react-charts): add high contrast' is too vague and does not accurately reflect the specific changes shown in the raw summary, which focus on updating theme styling to use CSS variable tokens and skeleton theme colors rather than 'adding high contrast'. Revise the title to more specifically describe the changes, such as 'feat(react-charts): update theme tokens to use CSS variables' or 'feat(react-charts): migrate skeleton themes to token-based styling' to accurately represent the main code modifications.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented May 8, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts (2)

175-178: 💤 Low value

area.style.data.strokeWidth not migrated to .var

Within the same data block, fillOpacity was migrated to .var for high-contrast CSS-variable support, but strokeWidth on line 178 still uses .value. Since stroke is intentionally commented out, this has no current visual impact, but it leaves the token unable to respond to CSS variable overrides if stroke is re-enabled later.

🔧 Proposed fix
-        strokeWidth: chart_area_stroke_Width.value
+        strokeWidth: chart_area_stroke_Width.var
🤖 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/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts`
around lines 175 - 178, The area style's data block uses
chart_area_stroke_Width.value for strokeWidth while fillOpacity was migrated to
chart_area_Opacity.var; update the area.style.data property named strokeWidth to
use chart_area_stroke_Width.var instead of .value so the token responds to
CSS-variable overrides (check the area.style.data object and replace the .value
usage on strokeWidth with .var).

522-528: ⚡ Quick win

Donut variants should use variant-specific stroke tokens to match the per-variant naming convention

Lines 525–526, 539–540, and 553–554 in donutThresholdDynamic, donutThresholdStatic, and donutUtilization all reference the base chart_donut_pie_data_stroke_Color and chart_donut_pie_data_stroke_Width tokens. However, each variant already imports its own dimensional tokens (chart_donut_threshold_dynamic_pie_Height, chart_donut_threshold_static_pie_Width, etc.), establishing a per-variant naming convention. The stroke tokens should follow the same pattern to allow independent customization per variant—for example, chart_donut_threshold_dynamic_pie_data_stroke_Color for donutThresholdDynamic.

🤖 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/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts`
around lines 522 - 528, The donut variants (donutThresholdDynamic,
donutThresholdStatic, donutUtilization) are incorrectly using the generic
chart_donut_pie_data_stroke_Color and chart_donut_pie_data_stroke_Width tokens;
update each variant to use its own per-variant stroke tokens (e.g., replace
chart_donut_pie_data_stroke_Color and chart_donut_pie_data_stroke_Width in
donutThresholdDynamic with chart_donut_threshold_dynamic_pie_data_stroke_Color
and chart_donut_threshold_dynamic_pie_data_stroke_Width respectively) and make
analogous replacements in donutThresholdStatic and donutUtilization to use
chart_donut_threshold_static_pie_data_stroke_* and
chart_donut_utilization_pie_data_stroke_* tokens so each variant can be
customized independently.
🤖 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
`@packages/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts`:
- Around line 60-61: The imports for six missing token modules
(chart_legend_data_stroke_Color, chart_legend_data_stroke_Width,
chart_donut_pie_data_stroke_Color, chart_donut_pie_data_stroke_Width,
chart_bullet_bar_stroke_Color, chart_bullet_bar_stroke_Width) are invalid and
will break the build; either add corresponding token files to
`@patternfly/react-tokens` exporting these symbols, or remove/replace their
imports in base-theme.ts: update the import list to stop importing those six
identifiers and adjust any usages in ChartTheme (e.g., where
chart_legend_data_stroke_Color / _Width, chart_donut_pie_data_stroke_*,
chart_bullet_bar_stroke_*) to use existing tokens or explicit values so no
unresolved module paths remain.

In `@packages/react-core/src/components/Hero/Hero.tsx`:
- Line 38: The Hero component removed the hasNoGlass prop from the
typed/destructured props but still spreads ...props onto the outer <div>,
causing hasNoGlass to leak to the DOM and breaking the public API; restore
support by re-introducing hasNoGlass into the component props (and its
TypeScript interface) and destructure it out of props (e.g. function Hero({
hasNoGlass, ...props }) or the existing props interface) so you can consume it
internally and not pass it through the ...props spread, or if you intend to
deprecate it, explicitly handle it and strip it before spreading while marking
it deprecated in the props type/comment; update references to hasNoGlass inside
Hero accordingly (and ensure tests/types reflect the restored prop).

---

Nitpick comments:
In
`@packages/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts`:
- Around line 175-178: The area style's data block uses
chart_area_stroke_Width.value for strokeWidth while fillOpacity was migrated to
chart_area_Opacity.var; update the area.style.data property named strokeWidth to
use chart_area_stroke_Width.var instead of .value so the token responds to
CSS-variable overrides (check the area.style.data object and replace the .value
usage on strokeWidth with .var).
- Around line 522-528: The donut variants (donutThresholdDynamic,
donutThresholdStatic, donutUtilization) are incorrectly using the generic
chart_donut_pie_data_stroke_Color and chart_donut_pie_data_stroke_Width tokens;
update each variant to use its own per-variant stroke tokens (e.g., replace
chart_donut_pie_data_stroke_Color and chart_donut_pie_data_stroke_Width in
donutThresholdDynamic with chart_donut_threshold_dynamic_pie_data_stroke_Color
and chart_donut_threshold_dynamic_pie_data_stroke_Width respectively) and make
analogous replacements in donutThresholdStatic and donutUtilization to use
chart_donut_threshold_static_pie_data_stroke_* and
chart_donut_utilization_pie_data_stroke_* tokens so each variant can be
customized independently.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2d0d264f-f37a-47f3-b01f-f84bbf4bd76c

📥 Commits

Reviewing files that changed from the base of the PR and between 4656548 and 4289820.

📒 Files selected for processing (2)
  • packages/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts
  • packages/react-core/src/components/Hero/Hero.tsx

Comment on lines +60 to +61
import chart_legend_data_stroke_Color from '@patternfly/react-tokens/dist/esm/chart_legend_data_stroke_Color';
import chart_legend_data_stroke_Width from '@patternfly/react-tokens/dist/esm/chart_legend_data_stroke_Width';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify the 6 new `@patternfly/react-tokens` ESM token files exist in the monorepo.
NEW_TOKENS=(
  "chart_legend_data_stroke_Color"
  "chart_legend_data_stroke_Width"
  "chart_donut_pie_data_stroke_Color"
  "chart_donut_pie_data_stroke_Width"
  "chart_bullet_bar_stroke_Color"
  "chart_bullet_bar_stroke_Width"
)
for token in "${NEW_TOKENS[@]}"; do
  result=$(fd --type f "${token}" --extension js --extension ts)
  if [ -z "$result" ]; then
    echo "MISSING: $token"
  else
    echo "FOUND: $result"
  fi
done

Repository: patternfly/patternfly-react

Length of output: 315


Add missing token files to @patternfly/react-tokens or remove their imports.

All six token imports at lines 60–61, 104–105, and 120–121 reference non-existent token module files in the monorepo:

  • chart_legend_data_stroke_Color
  • chart_legend_data_stroke_Width
  • chart_donut_pie_data_stroke_Color
  • chart_donut_pie_data_stroke_Width
  • chart_bullet_bar_stroke_Color
  • chart_bullet_bar_stroke_Width

These missing imports will cause build failures when resolving the module paths. Either add the token files to the @patternfly/react-tokens package or remove these imports from the theme file.

🤖 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/react-charts/src/victory/components/ChartTheme/themes/base-theme.ts`
around lines 60 - 61, The imports for six missing token modules
(chart_legend_data_stroke_Color, chart_legend_data_stroke_Width,
chart_donut_pie_data_stroke_Color, chart_donut_pie_data_stroke_Width,
chart_bullet_bar_stroke_Color, chart_bullet_bar_stroke_Width) are invalid and
will break the build; either add corresponding token files to
`@patternfly/react-tokens` exporting these symbols, or remove/replace their
imports in base-theme.ts: update the import list to stop importing those six
identifiers and adjust any usages in ChartTheme (e.g., where
chart_legend_data_stroke_Color / _Width, chart_donut_pie_data_stroke_*,
chart_bullet_bar_stroke_*) to use existing tokens or explicit values so no
unresolved module paths remain.

Comment thread packages/react-core/src/components/Hero/Hero.tsx Outdated
@mcoker mcoker requested a review from lboehling May 8, 2026 06:15
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.

2 participants