Skip to content

feat: Call initThemes from useBaseComponent for one-theme support - #4894

Merged
YueyingLu merged 1 commit into
mainfrom
init-theme
Aug 13, 2026
Merged

feat: Call initThemes from useBaseComponent for one-theme support#4894
YueyingLu merged 1 commit into
mainfrom
init-theme

Conversation

@YueyingLu

@YueyingLu YueyingLu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Description

Call initThemes in base components so it can support one-theme for vr-only artifact

Rest 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 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.

Test

Add unit test and will add integration test internally.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.66%. Comparing base (7f29935) to head (bd37642).

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.
📢 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 added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 4705254 Aug 13, 2026
57 checks passed
@YueyingLu
YueyingLu deleted the init-theme branch August 13, 2026 08:54
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