Repository navigation
docs: catch a misplaced document from the response, not the request - #37
Merged
Merged
Conversation
The retargetNavigation and borrowedRegions recipes judged by the request target before Props ran. eos found both wrong in practice: a region's controls targeting by selector (closest tbody) got retargeted to body, and pages handling a borrowed id with t.Is, or actions answering for another page's region, were reported. Only the response tells. Replace them with eos's response-based checks: a test guard middleware (a whole document answering a request for a region) and the htmx 4 after:request listener, now confirmed in a real browser. Pin the guard in rendering_examples_test.go, including the cases eos hit. Show the t.Is replacement for a hand-written HX-Target comparison in lint.md. Claude-Session: https://claude.ai/code/session_01Dp3Jmu2ePyCME2yG9yd672
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
=======================================
Coverage 95.32% 95.32%
=======================================
Files 17 17
Lines 1754 1754
=======================================
Hits 1672 1672
Misses 49 49
Partials 33 33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Follow-up to v0.9.0 from eos's adoption feedback.
retargetNavigationandborrowedRegionsmiddleware recipes fromdocs/rendering.md. Both judged by the request target beforePropsran, and eos hit false results with each:hx-target:inherited="closest tbody") were retargeted tobody;t.Is, and actions answering for another page's region, were reported.pagetestguard), and the htmx 4htmx:after:requestlistener. eos confirmed the listener in a real-Chrome test.rendering_examples_test.gopins the guard verbatim. It flags a whole document answering a request for a region, and leaves alone: an own region, a borrowed id handled byIs, a selector target with a fragmentPage, an action answering for another page's region, andbody.docs/lint.mdshows thet.Is(Q.M)replacement for a hand-writtenHX-Targetcomparison.Docs and tests only; no release needed.
https://claude.ai/code/session_01Dp3Jmu2ePyCME2yG9yd672