feat: Call initThemes from useBaseComponent for one-theme support - #4894
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4894 +/- ##
=======================================
Coverage 97.66% 97.66%
=======================================
Files 958 958
Lines 31308 31314 +6
Branches 11563 11564 +1
=======================================
+ Hits 30576 30582 +6
Misses 725 725
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
YueyingLu
marked this pull request as ready for review
August 13, 2026 07:20
YueyingLu
enabled auto-merge
August 13, 2026 07:22
YueyingLu
disabled auto-merge
August 13, 2026 07:22
YueyingLu
enabled auto-merge
August 13, 2026 08:17
mxschll
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Call
initThemesin base components so it can support one-theme for vr-only artifactRest context Copied from cloudscape-design/component-toolkit#246 This PR has dependency on cloudscape-design/component-toolkit#246.
Problem
The vr-only artifact (setting ALWAYS_VISUAL_REFRESH=true) short-circuits
useVisualRefresh to () => true, so useRuntimeVisualRefresh and initThemes() never run. This means theawsui-one-themebody class is never applied even when the global flag is set.Solution
initThemes()now accepts an optional{ skipVisualRefresh?: boolean }parameter. When true, it skips addingawsui-visual-refreshbut 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.
Test
Add unit test and will add integration test internally.