Repository navigation
fix: retire data-lavash-visible auto-injection — subtree derives own :if - #135
Merged
Merged
Conversation
…:if (closes #127) Pattern 3 injected data-lavash-visible from :if={@Bool} — but those blocks already ride subtree derives, which re-render client-side in BOTH directions. A class-based directive can't show an element :if removed from the DOM, so the injected attr only ever duplicated the hide direction: dead weight, and the third instance of a specific mechanism shadowing the general one. Proven by experiment: with the injection deleted, the :if e2e toggles both directions unchanged. This also retires the last Tailwind assumption ('hidden' class) from the auto-injected surface. data-lavash-visible stays as a manual annotation for non-lavash templates (JS unchanged); docs updated to state the split: :if -> subtree derives, hidden-class idiom -> attribute derives, visible= -> manual only.
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.
Closes #127 — the final audit item.
Resolved by experiment, not by parameterizing
The issue asked what to do about the hardcoded
"hidden"class. The answer turned out to be the specific-shadowing-general pattern a third time::if={@bool}blocks over optimistic fields already ride subtree derives, which re-render client-side in BOTH directions — a class-based directive can't show an element:ifremoved from the DOM, so the injecteddata-lavash-visibleonly ever duplicated the hide direction. Deleting the injection and running the e2e proved it: the:ifblock still toggles both ways, unchanged.What changed
data-lavash-visiblestays as a manual annotation for non-lavash templates (JS unchanged) — same playbook astoggle:if→ subtree derives, hidden-class idiom → attribute derives,visible=→ manual onlyWith this, all ten audit issues (#109–#118, #123–#129) are resolved. 922 root (incl. e2e) + 83 demo green; hook chain passed.
(For the record: landing this took eight hook runs — laptop suspend, a locked screen killing the focus tests deterministically, and CPU contention from parallel sessions. The flaky-under-load umbrella remains #42.)
🤖 Generated with Claude Code