Skip to content

refactor(ui): one Modal primitive behind the animated dialogs; drop headlessui - #383

Merged
PastaPastaPasta merged 1 commit into
stagingfrom
refactor/modal-primitive
Sep 7, 2026
Merged

PastaPastaPasta merged 1 commit into
stagingfrom
refactor/modal-primitive

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Summary

  • components/ui/modal.tsx: Modal (Radix root + AnimatePresence + forceMount portal + fading overlay + animated panel + stopPropagation guard), two variants:
    • card: padded panel over a plain overlay, fade + scale (the confirm/tip/delete/key-entry family).
    • sheet: unpadded panel over a blurred overlay (blur off in potato mode), fade + scale + slide (saved-address, review).
    • ModalTitle: the shared text-xl font-bold mb-2 flex items-center gap-2 heading.
  • 13 dialogs rebuilt on it. Widths and any max-h/overflow go through className; overlay/panel classes are otherwise identical to what each dialog had.
  • components/ui/usernames-modal.tsx was the one @headlessui/react consumer; it moves onto Modal and headlessui is removed from package.json.
  • Left as is: compose-modal (top-aligned scrolling overlay, onKeyDown/onPaste on the panel) and storage-provider-modal (z-[60] above compose). Both would need extra props for no gain right now. The five plain non-animated Radix dialogs (blog, embed, likes, contacts, add-key inner) are also untouched.

Part of the anti-slop cleanup series (after #370#382).

Test plan

  • npm run lint (zero warnings), tsc --noEmit, npm run test, npx knip, npm run build all green locally
  • CI
  • Manual: delete-post confirm, tip flow, buy-YAPP, encryption-key prompt (and its nested lost-key dialog), reset private feed, saved address + order review sheets, "also known as" usernames modal; Escape and overlay click close each; potato mode removes the sheet blur

🤖 Generated with Claude Code

…eadlessui

Thirteen dialogs each copied the same Radix root, AnimatePresence, forceMount portal, fading overlay and scaling panel with a stopPropagation click guard. components/ui/modal.tsx holds it once, with a card variant (padded panel, plain overlay) and a sheet variant (unpadded, slide-up, blurred overlay unless potato mode) that covers the multi-step flows. ModalTitle is the shared heading style.

The usernames modal was the only headlessui user; it moves onto Modal and @headlessui/react leaves package.json. Compose and storage-provider keep their own frames for now: compose top-aligns its overlay and owns key and paste handlers on the panel.
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: ba9afbce-e22b-4f19-b3ea-77edf2ac1a3d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying yappr with  Cloudflare Pages  Cloudflare Pages

Latest commit: ecce5af
Status: ✅  Deploy successful!
Preview URL: https://4c4e3f18.yappr.pages.dev
Branch Preview URL: https://refactor-modal-primitive.yappr.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying yappr-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: ecce5af
Status: ✅  Deploy successful!
Preview URL: https://9fd17e93.yappr-v2.pages.dev
Branch Preview URL: https://refactor-modal-primitive.yappr-v2.pages.dev

View logs

@PastaPastaPasta
PastaPastaPasta merged commit 15947fa into staging Sep 7, 2026
10 checks passed
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