Skip to content

feat(DropdownMenu): expose notch radius/stroke props + fix Notch border containment#314

Merged
I-am-nothing merged 1 commit into
mainfrom
feat/dropdown-notch-radius
Jun 19, 2026
Merged

feat(DropdownMenu): expose notch radius/stroke props + fix Notch border containment#314
I-am-nothing merged 1 commit into
mainfrom
feat/dropdown-notch-radius

Conversation

@I-am-nothing

@I-am-nothing I-am-nothing commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

Notch-dropdown fixes prompted by trying to wrap the DropdownMenu notch tightly around a small (32px / 8px-radius) icon button in the marketing nav:

  1. Expose the notch head's geometry on DropdownMenunotchRadius, notchInverseRadius, and notchStrokeWidth. The component hardcoded the corner radius (16/10) and border width (1.5) and only exposed notchWidth/notchHeight, so a notch sized down to a small trigger still rendered an over-rounded "bulbous" head with a fixed border that couldn't match the trigger.
  2. Fix Notch stroke containment. The SVG element was sized strokeWidth larger than the content box and pinned top-left, so the centered stroke on the right and bottom edges rendered outside the box (left/top happened to fall just inside). Sizing the element to the content box — while keeping the -pad viewBox so the stroke isn't clipped — puts the border fully inside on all four edges.

How

  • DropdownMenu: new optional notchRadius / notchInverseRadius / notchStrokeWidth props, defaulting to the existing 16 / 10 / 1.5 — fully backward-compatible, no behaviour change for existing callers — passed through to <Notch radius=… inverseRadius=… strokeWidth=… />.
  • Notch: both SVGs now use width={svgW} / height={svgH} (the content box) instead of …+ strokeWidth; the padded viewBox is unchanged, so the centered stroke scales to sit fully inside the box. Verified against the raw path geometry (right/bottom strokes move from outside → inside the content box; left/top unaffected) and the Notch.test.tsx dimension specs updated accordingly (+ new viewBox assertions that lock in the containment).
  • Adds a TightHead story showing a notch tuned to a small size="sm" icon button.

Versioning

  • Patch bump 0.5.10 → 0.5.11 (pre-1.0 patch-only), release label applied so the release workflow publishes on merge.

Risk / review

  • Notch is a shared primitive (also used by NotchGrid, grid-outline). The change only affects where the stroke lands (now inside the box on every edge) and shrinks the SVG element by strokeWidth; NotchGrid tests pass unchanged — please still eyeball it in Storybook. CI runs typecheck + tests + build.

Adoption

  • Follow-up: bump web-landing to @mirrorstack-ai/web-ui-kit@0.5.11 and pass notchRadius={8} notchInverseRadius={6} on the nav DropdownMenu to match the icon button.

🤖 Generated with Claude Code

@I-am-nothing I-am-nothing added the release Trigger a version bump on merge label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

github-actions Bot added a commit that referenced this pull request Jun 19, 2026
@I-am-nothing I-am-nothing force-pushed the feat/dropdown-notch-radius branch from 32d3f00 to c36ce89 Compare June 19, 2026 17:39
github-actions Bot added a commit that referenced this pull request Jun 19, 2026
…er containment

DropdownMenu hardcoded the notch corner radius (16/10) and stroke width (1.5),
so a notch wrapping a small trigger (e.g. an 8px icon button) always rendered an
over-rounded head with a fixed border. Expose `notchRadius`,
`notchInverseRadius`, and `notchStrokeWidth` — all defaulting to the existing
values, so there's no behaviour change — and pass them through to the Notch.

Also fix Notch stroke containment: the SVG element was sized `strokeWidth`
larger than the content box and pinned top-left, so the centered stroke on the
right and bottom edges rendered OUTSIDE the box. Size the element to the content
box (keeping the padded viewBox) so the border sits fully inside on every edge.

Adds a TightHead story demoing a notch tuned to a small icon button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@I-am-nothing I-am-nothing force-pushed the feat/dropdown-notch-radius branch from c36ce89 to a2a50ff Compare June 19, 2026 17:40
@I-am-nothing I-am-nothing changed the title feat(DropdownMenu): expose notch radius props + fix Notch border containment feat(DropdownMenu): expose notch radius/stroke props + fix Notch border containment Jun 19, 2026
github-actions Bot added a commit that referenced this pull request Jun 19, 2026
@I-am-nothing I-am-nothing merged commit 2c47f6f into main Jun 19, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in MirrorStack Platform Jun 19, 2026
github-actions Bot added a commit that referenced this pull request Jun 19, 2026
@I-am-nothing I-am-nothing deleted the feat/dropdown-notch-radius branch June 19, 2026 17:43
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