Repository navigation
Conversation
…stead of baking the initial state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3044 in CapturedChoiceGroupConverter. Conversion resolved the initial state's .on/.off classes into inline color/background-color on each core/button and left the state classes on the static wrappers, so the runtime's class swap never showed. The converter now resolves each choice's presentation in every captured state (it swaps in a copy of the group with that state's bindings applied, then restores the original and clears selector caches). It emits !important rules for only the properties that differ between states, scoped by a group class and keyed on data-blocks-engine-choice-active (or a new data-blocks-engine-choice-selected-index for patterns that are not just selected/unselected), and drops state-bound class tokens from the static choice block markup. Confirmed in headless Chrome: after clicking Two, Two is rgb(18,42,77) and the wrappers are transparent; before the fix Two stayed white.
What changed
How to test
cd php-transformer && composer install --no-interaction --prefer-dist --no-progress && composer test:canonical; expect passes as recorded by Cook's deterministic gate.Compatibility
Additive. The new converter constructor arguments are optional; groups whose states have no bindings or no differing presentation produce the same output as before. The initial render is unchanged (the source state stays baked) until the runtime marks a selection. All 513 unit tests and the contract tests pass; phpstan is clean.
Evidence
cd php-transformer && composer install --no-interaction --prefer-dist --no-progress && composer test:canonical: status=succeeded; candidate commit8a84f961068c7c6d92e093f7ff5ab00481de2b3b, treeb8c9f2faae32804a6315eaf0070803c14868d123, fingerprint46124c864198cc0a844a0904a95d5b8711a779ba2fafdb1b13e0dc6b7b909db3; durable gategate-1AI assistance