refactor(ui): one Modal primitive behind the animated dialogs; drop headlessui - #383
Merged
Merged
Conversation
…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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Deploying yappr with
|
| Latest commit: |
ecce5af
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4c4e3f18.yappr.pages.dev |
| Branch Preview URL: | https://refactor-modal-primitive.yappr.pages.dev |
Deploying yappr-v2 with
|
| 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 |
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sharedtext-xl font-bold mb-2 flex items-center gap-2heading.max-h/overflowgo throughclassName; overlay/panel classes are otherwise identical to what each dialog had.components/ui/usernames-modal.tsxwas the one@headlessui/reactconsumer; it moves ontoModaland headlessui is removed frompackage.json.compose-modal(top-aligned scrolling overlay,onKeyDown/onPasteon the panel) andstorage-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 buildall green locally🤖 Generated with Claude Code