Repository navigation
KISS/DRY/YAGNI pass: shared navigation registry, hide tracker, press gates - #63
Merged
Merged
Conversation
…e copies Duplicate copies of the module forked the guard registry while sharing the one real session history, so a Back could be answered by every copy at once. The registry now anchors on a realm-global keyed by Symbol.for, like dom-overlay and dom-scroll-lock, and remembers the attached listener so only one is ever attached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he predicates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A fresh start of #55 on current main: the same simplicity pass over the DOM layer and the dialog substrates, plus the principles it was held to, written into
AGENTS.md. #55 is the reference; this PR replaces it.What changed
@dunky.dev/browser-navigation: fix (patch). The guard registry and thepopstatelistener now live on a realm-global keyed bySymbol.for, the same waydom-overlayanddom-scroll-lockalready work. Before, two copies of the module (monorepo, micro-frontend) each kept their own registry while sharing the one real session history, so a Back could close a layer in every copy at once. The store also remembers the attached listener, because each copy's function has its own identity and the browser's(type, listener)dedupe can't span copies.@dunky.dev/dom-dialog: press gates replace the predicates (minor). WithacceptsBackdropPress/acceptsViewportPress, React and Solid each wrote the sameonClickwrapper by hand.gateBackdropPress(id, bindings)/gateViewportPress(id, bindings)take the part's normalized bindings and return them with the press gated, so each substrate's Backdrop/Viewport is now onemergePropscall. The gating rules have not changed.@dunky.dev/dom-overlay+@dunky.dev/overlay: refactors, no behavior change.hideOutsideandhideExitingLayernow share one hide/undo tracker, so the author-hidden skip and the exact-restore undo can't drift apart.below(id)now slicesordered()instead of carrying a second copy of the depth/open-order ranking.AGENTS.md. A Principles table (KISS, DRY, YAGNI) at the top of the Code section.Different from #55
AGENTS.mdhas the three principles that DRY/YAGNI/KISS #55 ended with (POLA removed), and the intro text matches. The format check passes.Not changed, on purpose
The forward-reopen half of
closeOnBackis where most of the complexity is (parked guards, claim watchers, the consumption chain). Whether it is worth keeping is a product decision, so this PR leaves it as it is.Follow-up
The
vue-dialog-nextandsvelte-dialogbranches still useacceptsBackdropPress/acceptsViewportPressand will need thegate*API after this merges.Verification
typecheck, lint, and format:check pass. Tests: 297 vitest + 13 native pass.
🤖 Generated with Claude Code