Skip to content

feat(php-transformer): generate canonical theme toggles - #1553

Merged
chubes4 merged 6 commits into
trunkfrom
feat/1538-canonical-theme-toggle-v2
Sep 3, 2026
Merged

feat(php-transformer): generate canonical theme toggles#1553
chubes4 merged 6 commits into
trunkfrom
feat/1538-canonical-theme-toggle-v2

Conversation

@chubes4

@chubes4 chubes4 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Closes #1538

Summary

  • recognize static theme controls only from corroborating identity, accessible-name, icon, root-state, and CSS evidence
  • generate editable blocks-engine/theme-toggle companion blocks backed by the WordPress Interactivity API
  • preserve captured classes, hidden label carrier, sanitized icon content, default theme, root class, color scheme, and storage key
  • swap equal-sized accessible sun/moon states and persist the selected preference
  • leave ambiguous and ordinary buttons on existing conversion paths

Verification

  • php tests/unit/theme-toggle-block.php
  • php tests/contract/run.php
  • composer test (292 parity fixtures plus package-install proof)
  • production-shaped import: zero fallbacks and browser-verified 44x36px geometry in dark, toggled light, and reloaded light states
  • browser-verified icon swap, root class/color-scheme update, localStorage.theme persistence, and zero console/page errors
  • git diff --check origin/trunk...HEAD

AI assistance

OpenAI GPT-5.6 Sol via OpenCode traced the static theme contract, implemented the generic canonical block and runtime, added safety and persistence coverage, and ran the focused, full, package, import, and browser verification under Chris Huber's direction.

@chubes4
chubes4 merged commit 1ca7fdc into trunk Sep 3, 2026
10 checks passed
@chubes4
chubes4 deleted the feat/1538-canonical-theme-toggle-v2 branch September 3, 2026 18:36
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.

Carry static theme toggles as interactive WordPress blocks

1 participant