Skip to content

fix(NotchGrid): guarantee distinct panels never overlap at gap=0#325

Merged
I-am-nothing merged 4 commits into
mainfrom
fix/notch-grid-min-seam
Jul 1, 2026
Merged

fix(NotchGrid): guarantee distinct panels never overlap at gap=0#325
I-am-nothing merged 4 commits into
mainfrom
fix/notch-grid-min-seam

Conversation

@I-am-nothing

Copy link
Copy Markdown
Contributor

Summary

  • NotchGrid distinct components (different keys, no shared groupKey, different themes) placed on touching cells used to render with their outlines overlapping by 2·panelBleed px — the later-painted panel visually cutting into the one above it — since panelBleed dilates every outline outward and gap=0 applies no counter-erosion.
  • Fixed via a position nudge: each component gets pushed apart from a touching distinct neighbor by enough to cancel that dilation plus a guaranteed quarter-cell (MIN_COMPONENT_SEP_FRACTION) seam, along whichever axis the pair touches on. Every component's own outline shape (gap/panelBleed) is left exactly as configured — only its position shifts.
  • Version bumped 0.5.16 → 0.6.0 (minor — the fix changes resolved geometry for any component touching a distinct neighbor, not just an edge case).

Supersedes #323 (closed — that branch picked up an unrelated commit from a concurrent session that now conflicts with main; this branch is a clean cherry-pick of just the NotchGrid + version-bump commits off current main).

Test plan

  • New regression test in NotchGrid.test.tsx: two distinct-key, distinct-theme, ungrouped panels stacked flush at gap=0+panelBleed=4 — asserts (a) two separate chromes, (b) a real >= 0.25*block seam (not just non-overlapping), (c) each panel's own outline dimensions are unchanged (proving the fix is position-only, not a shape change)
  • Full suite: 787/787 passing
  • tsc --noEmit clean
  • eslint clean on touched files
  • Verified live against a real consumer (web-applications' app-overview dashboard) via a local pnpm link-style swap — confirmed the overlap is visually gone

🤖 Generated with Claude Code

I-am-nothing and others added 4 commits July 1, 2026 17:05
Two unrelated components (different keys, no shared groupKey, different
themes) placed on touching cells rendered with their outlines overlapping
by 2*panelBleed px — the later-painted panel cutting up into the one above
— because panelBleed dilates every outline outward and gap=0 applies no
counter-erosion. Grouping was correct (they stayed two separate chromes);
the defect was purely in outline geometry (grid-outline erosion = gap/2 -
bleed going negative with no inter-component protection).

NotchGrid now caps each component's outward bleed at half the empty space
to its nearest distinct neighbour and forces a small seam when a neighbour
is flush, so distinct components always stay visually separated regardless
of the gap prop. Well-separated layouts keep the full panelBleed unchanged.

Bump 0.5.17; add regression test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…t a fixed px

MIN_COMPONENT_SEP was a flat 2px, imperceptible at typical block sizes and not
what "leave a gap between distinct panels" actually needs. Replaced with
MIN_COMPONENT_SEP_FRACTION (0.25 of one cell), so the guaranteed seam scales
with the grid's live block size the same way callers already reason about
spacing in cell/tile units.
Replace the per-component bleed-capping/eroding approach (computeComponentOutlines)
with a position nudge (computeComponentNudges): distinct touching components get
pushed apart by enough to cancel their bleed's outward dilation plus the desired
MIN_COMPONENT_SEP_FRACTION seam, applied to where each component renders (its
wrapper's left/top, the same mechanism already used for drag offsets) rather than
varying its gap/panelBleed. Every component's own outline shape is now identical
regardless of its neighbors — only its position shifts.

Strengthened the regression test to also assert each panel's own outline
dimensions are unchanged (proving the fix is position-only), and fixed the nudge
magnitude to account for panelBleed's full outward reach (previously only offset
by half the target seam, which undershot when panelBleed was nonzero).
Reflects the NotchGrid position-nudge fix (gap=0 + panelBleed distinct-panel
overlap) as a minor rather than patch — the fix changed the resolved geometry
of any component that touches a distinct neighbor, not just an edge case.
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Storybook Preview: https://mirrorstack-ai.github.io/web-ui-kit/pr/325/

github-actions Bot added a commit that referenced this pull request Jul 1, 2026
@I-am-nothing I-am-nothing merged commit 36579e7 into main Jul 1, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in MirrorStack Platform Jul 1, 2026
github-actions Bot added a commit that referenced this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Trigger a version bump on merge

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant