fix(wallet-drawer): outside-click close + register speed up modal in stack#12357
Conversation
…stack The wallet drawer registers via `useModalRegistration` and renders at z-index ~1411. `SpeedUpModal` rendered a bare Chakra Modal at the default z-index ~1400 — behind the drawer, making Confirm unreachable. Independently, Chakra's internal `onOverlayClick` gates close on its own `modalManager.isTopModal()` check (see node_modules/@chakra-ui/ react/dist/esm/modal/use-modal.mjs:69), so the drawer's overlay click became a no-op when SpeedUp was registered in Chakra's stack but not in `ModalStackProvider`. `SpeedUpModal` now calls `useModalRegistration` (same pattern as `CancelLimitOrder.tsx`) so it stacks at z=1422 above the drawer and handles its own overlay click. As a defensive backstop, the drawer wires an explicit `onClick` on its dialog container (gated on target===currentTarget so panel-internal clicks remain interactive) — clicking outside reliably closes the drawer even if a future child modal forgets to register. Closes shapeshift#12356 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSpeedUpModal component integrates centralized modal registration by importing ChangesModal Registration Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…wallet-drawer-modal-overlap
Registering SpeedUpModal in the modal stack (the other half of this PR) already restores outside-click close on the drawer via Chakra's native mechanism. The container-level onClick was belt-and-suspenders for any future modal that might forget to register; verified unnecessary by manual testing and removed for surgical scope. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Description
Fix the right-side wallet drawer so the Speed Up Transaction modal triggered from the Activity tab renders in front of the drawer (Confirm reachable), and the drawer reliably closes on outside click.
Two surgical changes:
1.
src/components/Layout/Header/ActionCenter/components/SpeedUpModal.tsxSpeedUpModalrendered a bare Chakra<Modal>at the default modal z-index (~1400), so it sat behind the wallet drawer (z-index~1411viauseModalRegistration). Apply the same pattern used byCancelLimitOrder.tsx: calluseModalRegistration({ isOpen, onClose })and spreadmodalProps/overlayProps/modalContentPropsonto<Modal>/<ModalOverlay>/<ModalContent>. SpeedUp now stacks atz=1422, above the drawer, with properpointerEventshandoff to lower-stack modals.2.
src/components/Layout/Header/NavBar/DrawerWallet.tsxChakra's internal
onOverlayClickgates close on its ownmodalManager.isTopModal()(node_modules/@chakra-ui/react/dist/esm/modal/use-modal.mjs:69), independent ofModalStackProvider. If any future child modal opens without registering in our stack, that gate fires andcloseOnOverlayClick: truesilently becomes a no-op. A defensiveonClickis wired onto the dialog container viacontainerProps, gated onevent.target === event.currentTargetso panel-internal clicks remain interactive. This is redundant with Chakra's mechanism in the registered-modal case but guarantees the drawer can always be dismissed by clicking outside.Issue (if applicable)
closes #12356
Risk
LOW.
mutationFnbody ofspeedUpMutationis untouched). No new dependencies. No state schema changes.<Modal>props change so it participates inModalStackProvider.None — purely UI behavior on the wallet drawer + Speed Up modal wrapper. BTC RBF signing & broadcast logic in
SpeedUpModal(lines 507-697) is unchanged.Testing
Engineering
pnpm install && pnpm run devtarget === currentTargetexcludes child clicks).Operations
QA recipe: any wallet, open the drawer, do Engineering steps A–E above. Behavior should match the descriptions.
Screenshots (if applicable)
Post-fix demo (Speed Up modal now in front, Confirm reachable, drawer dismisses correctly): https://jam.dev/c/a783dff9-2a6a-4ef2-87ba-8e66f1da5c26
🤖 Generated with Claude Code
Summary by CodeRabbit