Add declarative IsHitTestVisible(bool) common element modifier#810
Open
nsreehari wants to merge 1 commit into
Open
Add declarative IsHitTestVisible(bool) common element modifier#810nsreehari wants to merge 1 commit into
nsreehari wants to merge 1 commit into
Conversation
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
Adds a declarative
IsHitTestVisible(bool)modifier to the common element surface, filling the last gap among the sibling boolean/visual state modifiers (IsEnabled,IsTabStop,IsVisible,Opacity). Until now, opting an element out of pointer hit-testing required the imperative.Set(c => c.IsHitTestVisible = false)escape hatch.Fixes #809.
Motivation
Reactor.Community.ReactorFlow's MiniMap renders pointer-transparent overlay layers (viewport rectangle, node thumbnails) that must not intercept pointer input destined for the interactive canvas underneath. Its last remaining.Set(...)escape hatch is aNonInteractivehelper whose entire body iselement.Set(c => c.IsHitTestVisible = false). A declarative modifier lets that helper be dropped and the property composed like any other element state.What changed
Plumbing mirrors
IsTabStopexactly:src/Reactor/Core/Element.cs— addedbool? IsHitTestVisibletoElementModifiers, folded intoModifiersEqualandMerge.src/Reactor/Elements/ElementExtensions.cs— addedpublic static T IsHitTestVisible<T>(this T el, bool isHitTestVisible = true) where T : Elementnext toIsTabStop, with matching XML-doc style.src/Reactor/Core/Reconciler.cs— appliesfe.IsHitTestVisible = valueonly when set and changed, next to whereIsTabStopis applied.tests/Reactor.Tests/ElementExtensionsCoverageTests.cs— addedIsHitTestVisible_Sets_Modifier, mirroringIsEnabled_Sets_Modifier.skills/reactor.api.txt+plugins/reactor/skills/reactor-dsl/references/reactor.api.txt— regenerated API index (UPDATE_API_INDEX=1).Additive and back-compat: new optional modifier defaulting to
true(the WinUI default); no existing signature or behavior changes. Recycle-safety is already covered —ElementPoolclearsUIElement.IsHitTestVisiblePropertyon release (issue #162), so a recycled control cannot strand a stalefalse.Validation
Built and tested on win-x64:
Build succeeded with 0 errors.