Skip to content

fix(#2286): scroll-lock gap + scrim outlier in trade modals - #2537

Merged
dcccrypto merged 1 commit into
playgroundfrom
fix/2286-modal-primitive
Sep 3, 2026
Merged

fix(#2286): scroll-lock gap + scrim outlier in trade modals#2537
dcccrypto merged 1 commit into
playgroundfrom
fix/2286-modal-primitive

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

Closes the two divergences that actually remain in #2286, and reports the ones that have already closed themselves since the issue was filed.

The inventory in #2286 is out of date

Measured across all five trade modals on origin/playground:

property state verdict
z-index all five z-[9999] converged (issue reports z-50, z-[60], z-[61])
portal all five createPortal converged
Escape-to-close all five converged
reduced motion all five converged
scroll lock 4 of 5 FundingExplainerModal missing — fixed here
scrim 4x bg-black/80, 1 outlier SendPositionNftModalfixed here
focus trap zero of five still open

What this changes

FundingExplainerModal had no scroll lock. The other four call useLockBodyScroll(); this one did not, so the page scrolled behind it. That is a real bug rather than an inconsistency, and it is one line.

SendPositionNftModal's scrim was bg-black/60 backdrop-blur-[2px] against bg-black/80 everywhere else. Normalised.

What this does NOT do, and why

The issue asks for a shared <Modal> primitive with all five migrated onto it. I did not ship that. Two reasons that compound:

  1. These five components have zero test coverage. No test file references any of them.
  2. PLAYGROUND.md requires clicking through the changed flow in a browser to call a UI change done, which I cannot do here. Its own wording is "Types don't prove UX."

TradeConfirmationModal and ClosePositionModal are the two modals that move money. Migrating them with no tests and no visual check, for a consistency refactor, is not a good trade. The primitive is still the right end state — it wants a browser, and it is now a much smaller job than when the issue was filed, since z-index and portal have already converged on their own.

Leaving #2286 open for the primitive + focus traps.

Correcting my own first measurement

My initial survey reported all five missing scroll lock and three having focus traps. Both were grep artifacts — my pattern did not match the useLockBodyScroll hook name, and the focus count was picking up Tailwind focus: classes. The table above matches on actual hook names.

Verification

  • npx tsc --noEmit clean
  • npx vitest run3149 passed / 16 skipped / 0 failed
  • Neither changed file has test coverage; both changes are single-token and were read in full context

🤖 Generated with Claude Code

https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D

…l open

The inventory in #2286 is substantially out of date, so this fixes what actually
diverges rather than what was reported.

MEASURED ACROSS ALL FIVE TRADE MODALS:

  z-index       all five z-[9999]        — CONVERGED (issue reported z-50, z-[60], z-[61])
  portal        all five createPortal    — CONVERGED
  Escape        all five                 — CONVERGED
  reduced motion all five                — CONVERGED
  scroll lock   4 of 5                   — FundingExplainerModal missing  <-- fixed
  scrim         4x bg-black/80, 1 outlier — SendPositionNftModal          <-- fixed
  focus trap    ZERO of five             — still open, see below

Two fixes:

  * FundingExplainerModal had no `useLockBodyScroll`, so the page scrolled behind
    it while the other four locked. That is a real bug, not just inconsistency.
  * SendPositionNftModal's `bg-black/60 backdrop-blur-[2px]` is now bg-black/80,
    matching the other four.

WHAT I DID NOT DO, and why.

The issue asks for a shared <Modal> primitive and a migration of all five. I did
not ship that, for two reasons that compound:

  1. These five components have ZERO test coverage — `grep -rl <name> __tests__`
     returns nothing for every one of them.
  2. PLAYGROUND.md's definition of done requires clicking through the changed
     flow in a browser, which I cannot do here. "Types don't prove UX" is its
     wording and it is right.

Migrating TradeConfirmationModal and ClosePositionModal — the two that move money
— blind, with no tests and no visual check, is not a trade worth making for a
consistency refactor. The primitive is still the correct end state; it wants a
browser.

ALSO CORRECTING MY OWN MEASUREMENT: my first pass reported all five as missing
scroll lock and three as having a focus trap. Both were grep artifacts —
`useLockBodyScroll` did not match my pattern, and `focus=7` was counting Tailwind
`focus:` classes. The numbers above are from matching the actual hook names.

Launch suite: 3149 passed / 16 skipped / 0 failed.

Refs: #2286

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
percolator-launch Ready Ready Preview Sep 3, 2026 9:31am UTC
percolator-mainnet Ready Ready Preview Sep 3, 2026 9:31am UTC
percolator-playground Ready Ready Preview Sep 3, 2026 9:31am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 3a64417c-4aa1-4227-a4d3-ae14222e84f3

📥 Commits

Reviewing files that changed from the base of the PR and between 5acfb07 and 22aee51.

📒 Files selected for processing (2)
  • app/components/trade/FundingExplainerModal.tsx
  • app/components/trade/SendPositionNftModal.tsx

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.

@dcccrypto
dcccrypto merged commit 1b84f96 into playground Sep 3, 2026
15 checks passed
@dcccrypto
dcccrypto deleted the fix/2286-modal-primitive branch September 3, 2026 09:32
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