Skip to content

fix(theme): prevent preview theme CSS from leaking after quick hover exit (@PlutoDog95)#7877

Draft
PlutoDog95 wants to merge 1 commit intomonkeytypegame:masterfrom
PlutoDog95:fix-theme-preview-leak
Draft

fix(theme): prevent preview theme CSS from leaking after quick hover exit (@PlutoDog95)#7877
PlutoDog95 wants to merge 1 commit intomonkeytypegame:masterfrom
PlutoDog95:fix-theme-preview-leak

Conversation

@PlutoDog95
Copy link
Copy Markdown

Summary

Fixes theme preview CSS leaking when hovering over a theme and quickly closing the theme menu without selecting it.

Root Cause

Theme preview is triggered from the theme command hover handler using ThemeController.preview(theme.name).

This uses a debounced preview function before applying the preview theme.

When the user exits the menu quickly, clearPreview() resets the preview state, but the pending debounced preview can still execute afterward and apply preview styles after cleanup.

This causes parts of the preview theme CSS to remain visible, matching issue #7875.

Fix

Cancel the pending debounced preview inside clearPreview() before restoring the original theme:

debouncedPreview.cancel();

This ensures delayed preview application cannot happen after cleanup.

Closes #7875

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Apr 28, 2026
@PlutoDog95 PlutoDog95 changed the title fix(theme): prevent preview theme CSS from leaking after quick hover exit fix(theme): prevent preview theme CSS from leaking after quick hover exit (@PlutoDog95) Apr 28, 2026
@fehmer
Copy link
Copy Markdown
Member

fehmer commented Apr 28, 2026

#7876 already fixes this issue. thanks

@PlutoDog95
Copy link
Copy Markdown
Author

Thanks for checking! I appreciate it. I’ll take a look at #7876.

@fehmer fehmer marked this pull request as draft April 28, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme CSS Leaking

3 participants