Skip to content

Fix the theme switch screenshot - #55

Open
Fivell wants to merge 1 commit into
activeadmin-plugins:masterfrom
yeti-switch:fix-switch-screenshot
Open

Fivell wants to merge 1 commit into
activeadmin-plugins:masterfrom
yeti-switch:fix-switch-screenshot

Conversation

@Fivell

@Fivell Fivell commented Oct 2, 2026

Copy link
Copy Markdown
Member

The sheet published with v3.0.0 shows the wrong icons: the light page carries the auto glyph, and the state row reads auto / auto / dark instead of auto / light / dark.

Only img/switch.png changes — no code.

The cause is in the screenshot harness rather than the theme. #49 made the script hold the chosen mode in memory, so that clearing localStorage from outside can no longer make the control a no-op where storage throws. The harness was clearing localStorage between scenarios to reset the switch, so the module kept the previous scenario's mode and the clicks counted from the wrong place. It now dispatches the storage event the module already listens for — the same way a second tab announces the change.

The light page carried the auto icon, the state row read auto/auto/dark
instead of auto/light/dark, and one hover frame showed the wrong glyph.

The script holds the chosen mode in memory now, so that clearing localStorage
from outside no longer makes the control a no-op where storage throws. The
screenshot harness was doing exactly that between scenarios, so the module
kept the previous scenario's mode and the clicks counted from the wrong place.
The harness now dispatches the storage event the module already listens for,
which is how a real second tab announces the same change.
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.

1 participant