# Debug layout and input

A button can exist in the view tree and still be invisible, clipped, or outside the active hit-test region. Investigate geometry before adding more input handlers.

## Follow the space

Inspect the parent constraints, the child's measured size, and its arranged frame. A scrolling container needs a finite viewport in the scrolling direction; an unconstrained stack may simply grow instead of producing useful scrolling.

Check margins and padding separately. Margin reserves space outside a child; padding reserves space inside a container. Verify the available content size after both. If a custom view draws from a local origin, translate by `Frame.X` and `Frame.Y` consistently instead of applying that offset twice.

## Follow the point

Use `GlobalToLocal` and `LocalToGlobal` when crossing coordinate spaces. An ancestor may scroll or transform the child, so `Frame.Center` alone is not necessarily a window-coordinate click target. The test harness view-target overloads account for the hierarchy.

Inspect clips, overlays, and pointer capture. A popup may intentionally intercept a click. A drag owner may continue receiving movement after the pointer leaves its frame. Cancellation and lost capture must release local gesture state.

## Follow the update

If state changes but pixels do not, check invalidation. Color or selection changes usually need rendering; changed text or geometry may need layout. If a child appears only after resizing the window, a setter likely forgot to request the appropriate work.

If a view draws continuously while idle, inspect repeated animation requests. A finite transition should stop requesting frames once it reaches its final value.

## Make a small reproduction

Reduce the tree to the smallest parent and child that still fail. Record viewport size, device mode, input sequence, and expected result. Run the same case in a deterministic test to separate shared layout/routing behavior from native runtime translation. Use [live inspection](../inspect-app/index.md) when the failure only occurs in an OS window.

A useful regression asserts the failure's cause: the child remains inside its viewport, the intended target receives the action, or the model changes exactly once. A screenshot alone often misses that distinction.
