Skip to content

Support negative margins and deterministic overlap hit testing#55

Merged
RtlZeroMemory merged 2 commits into
mainfrom
epic-03-negative-margins-overlap-hit-testing
Feb 13, 2026
Merged

Support negative margins and deterministic overlap hit testing#55
RtlZeroMemory merged 2 commits into
mainfrom
epic-03-negative-margins-overlap-hit-testing

Conversation

@RtlZeroMemory

Copy link
Copy Markdown
Owner

Summary

  • allow signed int32 margins (m/mx/my/mt/mr/mb/ml) while keeping padding, pad, and gap non-negative
  • add deterministic negative-margin layout fixtures and invariant checks (w/h >= 0) for overlap scenarios
  • define and test deterministic overlap hit-testing rules:
    • widget tree ties resolve by stable depth-first tree order (later sibling wins)
    • layer ties resolve by zIndex, then registration order for equal zIndex
  • document negative-margin behavior, constraints, overlap routing rules, examples, and gotchas in the layout guide

Why

Terminal UIs rely on overlap effects for practical composition. This update enables negative margins safely while preserving deterministic routing and non-negative size invariants.

Validation

  • npm run lint
  • npm run typecheck
  • npm run build
  • npm test
  • npm run test:e2e
  • npm run test:e2e:reduced
  • npm run test:native:smoke

@RtlZeroMemory
RtlZeroMemory force-pushed the epic-03-negative-margins-overlap-hit-testing branch from 087b254 to a2d4d5f Compare February 13, 2026 16:08
@RtlZeroMemory
RtlZeroMemory merged commit ac2af53 into main Feb 13, 2026
16 checks passed
@RtlZeroMemory
RtlZeroMemory deleted the epic-03-negative-margins-overlap-hit-testing branch February 13, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant