Skip to content

feat: Add skipVisualRefresh option in initThemes - #246

Merged
YueyingLu merged 1 commit into
mainfrom
add-skipVisualRefresh-initThemes
Aug 12, 2026
Merged

feat: Add skipVisualRefresh option in initThemes#246
YueyingLu merged 1 commit into
mainfrom
add-skipVisualRefresh-initThemes

Conversation

@YueyingLu

@YueyingLu YueyingLu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Description of changes:

Add skipVisualRefresh option to initThemes() to support one-theme in the vr-only artifact.

Problem

The vr-only artifact (setting ALWAYS_VISUAL_REFRESH=true) short-circuits useVisualRefresh to () => true, so useRuntimeVisualRefresh and initThemes() never run. This means the awsui-one-theme body class is never applied even when the global flag is set.

Solution

initThemes() now accepts an optional { skipVisualRefresh?: boolean } parameter. When true, it skips adding awsui-visual-refresh but still applies other theme.

The components package will call initThemes({ skipVisualRefresh: ALWAYS_VISUAL_REFRESH }) from useBaseComponent to ensure theme classes are applied regardless of the ALWAYS_VISUAL_REFRESH flag. See this PR cloudscape-design/components#4894

Test

Add unit test and will add integration test internally.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (27ee76f) to head (fe3e9de).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #246   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files          56       56           
  Lines        1784     1787    +3     
  Branches      519      517    -2     
=======================================
+ Hits         1750     1753    +3     
  Misses         33       33           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@YueyingLu
YueyingLu marked this pull request as ready for review August 11, 2026 23:02
@YueyingLu
YueyingLu requested a review from a team as a code owner August 11, 2026 23:02
@YueyingLu
YueyingLu requested review from ernst-dev and removed request for a team August 11, 2026 23:02
@YueyingLu
YueyingLu added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit d7cc26a Aug 12, 2026
81 of 82 checks passed
@YueyingLu
YueyingLu deleted the add-skipVisualRefresh-initThemes branch August 12, 2026 07:37
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