Skip to content

Fix transition animation flicker through ColourSchemeButton#251

Open
zoharma wants to merge 2 commits into
mainfrom
zma/fix-ColourSchemeButton-mode-flash
Open

Fix transition animation flicker through ColourSchemeButton#251
zoharma wants to merge 2 commits into
mainfrom
zma/fix-ColourSchemeButton-mode-flash

Conversation

@zoharma

@zoharma zoharma commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Switching between light and dark mode caused a noticeable flicker as components transitioned before the new colour scheme had fully applied. This happened in internal components such as Chips and external ones such as Material React Table.

This fix adds a temporary ds-mode-changing class during colour scheme changes to suppress CSS transitions and animations until the new theme has been applied, reducing flicker during mode switching.

The CSS and the class were added to the ColourSchemeButton directly.

@zoharma zoharma changed the title Fix transition animation through ColourSchemeButton Fix transition animation flicker through ColourSchemeButton Jul 3, 2026
@zoharma zoharma marked this pull request as ready for review July 3, 2026 11:13
@zoharma zoharma added the v0.6.1 label Jul 7, 2026
@zoharma zoharma requested review from douglaswinter and gfrn July 7, 2026 15:04
@NKatti2011 NKatti2011 self-requested a review July 10, 2026 13:11

@NKatti2011 NKatti2011 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure we should have the "temporary" solution that may affect other components unintentionally, or pause unrelated animations, since you're setting a global style rule through a component. This change should live at the theme provider / colour scheme context level instead. Please add debounce for double-click instances, and clear timeout on rapid clicks. The 250ms timeout is arbitrary and may cause intermittent issues in other apps depending on tree size.

@zoharma zoharma force-pushed the zma/fix-ColourSchemeButton-mode-flash branch from cafc2c9 to 38dc4aa Compare July 10, 2026 17:45
@zoharma zoharma force-pushed the zma/fix-ColourSchemeButton-mode-flash branch from 38dc4aa to cb1ad58 Compare July 10, 2026 17:46
@zoharma zoharma force-pushed the zma/fix-ColourSchemeButton-mode-flash branch from cb1ad58 to 18efe94 Compare July 10, 2026 17:52
@zoharma zoharma requested a review from NKatti2011 July 10, 2026 17:54
@zoharma

zoharma commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@NKatti2011 Have moved the colour scheme transition suppression to ThemeProvider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants