feat(events)!: void events — a per-gesture onVoid* family replacing *Missed#75
Draft
bigmistqke wants to merge 12 commits into
Draft
feat(events)!: void events — a per-gesture onVoid* family replacing *Missed#75bigmistqke wants to merge 12 commits into
bigmistqke wants to merge 12 commits into
Conversation
…ement-set missed phases
…n-aware, stop-silence, ray, payload
commit: |
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
Replaces the per-object
*Missedhandlers with a positive, canvas-levelonVoid*family —onVoidClick,onVoidDoubleClick,onVoidContextMenu,onVoidWheel,onVoidPointerDown,onVoidPointerUp. A void event fires when a gesture runs no handler on any object: the click (or wheel, or pointer press) that reaches nothing interactive.The model
A backdrop sits behind the scene, and
onVoidClickis itsonClick. A click runs anyonClickalong its path — the objects it intersects and their ancestors — and reaches the backdrop only when none has one. An empty-space click and a click on an object without anonClickare the same event: both reach the backdrop. (The backdrop is conceptual — the "no object handler ran" branch surfaced as a<Canvas>prop, not a real mesh.)Two properties follow:
onVoid*never both fire. A click that runs anonClickbubbles up to the canvas-levelonClick; a click that runs none firesonVoidClick; a click consumed bystopPropagationfires neither.onPointerMovebut noonClickis transparent to clicking, so clicking it is a void click.Engine
propagate()now reports whether any object-level handler fired, and each gesture caller owns its tail —canvasLevel(fire the canvas handler on!stopped) for hover and captured drags,finishVoidable(bubbled hit → canvas handler, otherwise →onVoid<Kind>) for the void family. The per-object complement-set dispatch and its re-raycast phases are removed; the engine is otherwise unchanged.Breaking changes
Removes
onClickMissed/onDoubleClickMissed/onContextMenuMissed(object- and canvas-level).Migration:
onVoidClick(direct swap).onClick, clear it on the canvasonVoidClick. To also clear when another object is clicked, put the clearing handler on the root andstopPropagation()on objects that shouldn't clear it.Tests
A dedicated
void eventsdescribe covers the matrix across all six gestures: firing on empty/hit, exclusivity (and silence understopPropagation), gesture-scoped transparency, chain-aware delivery (an ancestor's handler counts), the rayfiredOnObjectrule, and the void-event payload contract. 229 tests pass.Docs
README, the events API reference, and the Tour chapter are migrated, with a new
onVoidWheeldemo. TheCONTEXT.mdglossary's "Missed event" entry is replaced with "Void event" + "Backdrop".Closes #49
Refs #21