Skip to content

fix: modal widget width mobile#2799

Merged
mmioana merged 7 commits into
developfrom
fix/modal-widget-width-mobile
May 21, 2026
Merged

fix: modal widget width mobile#2799
mmioana merged 7 commits into
developfrom
fix/modal-widget-width-mobile

Conversation

@mmioana
Copy link
Copy Markdown
Contributor

@mmioana mmioana commented Apr 9, 2026

Which Jira task belongs to this PR?

Closes https://linear.app/lifi-linear/issue/JUM-785/depositwithdraw-squashed-modal-widget-on-mobile

Testing steps

  1. Go to /earn or an /earn/[slug] page
  2. Set the viewport width to mobile
  3. Open the deposit/withdraw widget modal
  4. Enter an amount and proceed
  5. Check the widget width stays the same as on the main screen

Why did I implement it this way?

Checklist before requesting a review

  • I have performed a self-review of my code
  • This pull request is as small as possible and only tackles one problem
  • I have added tests that cover the functionality / test the bug
  • If this changed the API, I have updated the documentation
  • I have provided QA instructions for the feature / fix implemented in this PR (if applicable)
  • I have provided instructions for any environment / deployment changes that this PR needs when merged

Summary by CodeRabbit

  • Style
    • Updated modal container styling in both Deposit and Withdraw modals to adjust responsive behavior. The minimum width constraint now evaluates viewport dimensions with a maximum cap, affecting how the modals display across different screen sizes. This change provides better layout consistency and improved visual presentation on devices with smaller viewports.

@mmioana mmioana self-assigned this Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Walkthrough

Both modal components update their container minimum width styling from full available width to a viewport-constrained value capped at 360px, improving responsive layout behavior on smaller screens.

Changes

Cohort / File(s) Summary
Modal Container Styling
src/components/composite/DepositModal/DepositModal.tsx, src/components/composite/WithdrawModal/WithdrawModal.tsx
Updated minWidth constraint from '100%' to 'min(100vw, 360px)' to cap modal width responsively instead of stretching to full available width.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • callMeTheQA
  • Kayanski
  • oktapodia

Poem

🐰 A pair of modals, dressed up neat,
With viewport bounds, now crisp and sweet,
No more stretching edge to edge,
Just 360 pixels—a tidy pledge! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing modal widget width on mobile devices, which directly aligns with the changeset that updates modal styling in both DepositModal and WithdrawModal components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/modal-widget-width-mobile

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 9, 2026

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

Project Deployment Actions Updated (UTC)
jumper-exchange Ready Ready Preview, Comment May 21, 2026 2:57pm
jumper-exchange-storybook Error Error May 21, 2026 2:57pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

✅ All snapshot tests passed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Playwright test results

passed  35 passed
flaky  3 flaky
skipped  19 skipped

Details

stats  57 tests across 17 suites
duration  13 minutes, 9 seconds
commit  b780491

Flaky tests

chromium › e2e/earnPage.spec.ts › Protocols filters on Earn page › Should be able to filter by Aave protocol (Qase ID: 39)
chromium › e2e/earnPage.spec.ts › Protocols filters on Earn page › Should be able to filter by morpho protocol (Qase ID: 38)
chromium › e2e/landingPage.spec.ts › Landing page and navigation › Should navigate to the homepage and change tabs (Qase ID: 2)

Skipped tests

chromium › e2e/earnPage.spec.ts › Chains filters on Earn page › Should be able to navigate to the earn page (Qase ID: 40)
chromium › e2e/earnPage.spec.ts › Chains filters on Earn page › Should be able to filter by base chain (Qase ID: 41)
chromium › e2e/earnPage.spec.ts › Chains filters on Earn page › Should be able to filter by arbitrum chain (Qase ID: 42)
chromium › e2e/earnPage.spec.ts › Chains filters on Earn page › Should be able to filter by ethereum chain (Qase ID: 43)
chromium › e2e/earnPage.spec.ts › Tags filters on Earn page › Filter by tag returns only cards that have that tag (Qase ID: 208)
chromium › e2e/earnPage.spec.ts › Should be able to navigate to the "Your Positions" tab › Should be able to navigate to the "Your Positions" tab (Qase ID: 56)
chromium › e2e/mainMenu.spec.ts › Main Menu flows › Should be able to navigate to Link3 (Qase ID: 19)
chromium › e2e/portfolioPage.spec.ts › Portfolio page › verify portfolio page elements and filters on Tokens and DeFi Protocols tabs (Qase ID: 53)
chromium › e2e/portfolioPage.spec.ts › Portfolio page › verify value filter is cleared when clicking clear filter button (Qase ID: 57)
chromium › e2e/portfolioPage.spec.ts › Portfolio page › verify main total value equals sum of individual values (Qase ID: 206)
chromium › e2e/portfolioPage.spec.ts › Portfolio page › verify that deposit and withdraw buttons are visible on DeFI positions tab (Qase ID: 207)
chromium › e2e/swapActions.spec.ts › On chain swaps [Viewport: Mobile] › Hyperliquid chain swap pairs (Qase ID: 25)
chromium › e2e/swapActions.spec.ts › On chain swaps [Viewport: Desktop] › Hyperliquid chain swap pairs (Qase ID: 28)
chromium › e2e/themeManipulation.spec.ts › Switch theme — partner themes › Partner theme should appear in theme menu and apply background color (Qase ID: 49)
chromium › e2e/walletMissionVerify.spec.ts › Mission wallet verification › Verify wallet on a mission via real signature (Qase ID: 203)
chromium › e2e/walletSignPerkClaim.spec.ts › Perk claim — sign and submit › Claim a perk with a real signature (Qase ID: 200)
chromium › e2e/walletSignPerkClaimReject.spec.ts › Perk claim — reject signature › Reject the perk claim signature (Qase ID: 201)
chromium › e2e/walletSwapExecute.spec.ts › Wallet swap — execute on Arbitrum › Execute a USDC → USDT swap on Arbitrum end-to-end (Qase ID: 205)
chromium › e2e/walletSwitchNetwork.spec.ts › Switch network from Jumper widget › Switch chain via Jumper triggers MetaMask popup (Qase ID: 202)

📋 View Detailed Qase Report

@mmioana mmioana requested a review from callMeTheQA April 9, 2026 14:11
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/composite/WithdrawModal/WithdrawModal.tsx (1)

38-49: Consider centralizing the modal container sizing config.

This style block is duplicated with DepositModal; extracting it will reduce future drift when responsive sizing is adjusted again.

Optional refactor sketch
+// shared helper (example): src/components/composite/EarnModal/buildModalContainerTheme.ts
+export const buildEarnModalContainerTheme = (theme: Theme) => ({
+  maxHeight: 'calc(100vh - 6rem)',
+  minWidth: 'min(100vw, 360px)',
+  maxWidth: 400,
+  borderRadius: `${theme.shape.cardBorderRadiusLarge}px`,
+  [theme.breakpoints.up('sm')]: { minWidth: 400 },
+});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/composite/WithdrawModal/WithdrawModal.tsx` around lines 38 -
49, The modal container sizing object inside WithdrawModal's useMemo (the ctx ->
theme -> container with maxHeight, minWidth, maxWidth, borderRadius and the
[theme.breakpoints.up('sm')] override) is duplicated in DepositModal; extract
this object into a single exported constant or helper (e.g., modalContainerStyle
or getModalContainer(theme)) and import it into both WithdrawModal and
DepositModal, replacing the inline container block in the ctx memo so both
components reuse the same responsive sizing config and avoid future drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/composite/WithdrawModal/WithdrawModal.tsx`:
- Around line 38-49: The modal container sizing object inside WithdrawModal's
useMemo (the ctx -> theme -> container with maxHeight, minWidth, maxWidth,
borderRadius and the [theme.breakpoints.up('sm')] override) is duplicated in
DepositModal; extract this object into a single exported constant or helper
(e.g., modalContainerStyle or getModalContainer(theme)) and import it into both
WithdrawModal and DepositModal, replacing the inline container block in the ctx
memo so both components reuse the same responsive sizing config and avoid future
drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5bfcc25e-a4b6-452a-8ced-aeabbf2fdaca

📥 Commits

Reviewing files that changed from the base of the PR and between 34ba2a0 and 41d2296.

📒 Files selected for processing (2)
  • src/components/composite/DepositModal/DepositModal.tsx
  • src/components/composite/WithdrawModal/WithdrawModal.tsx

@yordanove
Copy link
Copy Markdown
Contributor

yordanove commented May 21, 2026

css-fix-demo-375 Verified at the bundle layer + with a synthetic CSS reproduction at iPhone SE viewport (375×667).

Code diff is live where expected:

Layer Prod (jumper.xyz) Preview (jumper-exchange-git-fix-modal-widget-wid-d71797…vercel.app)
Deployed chunk has minWidth:"100%" minWidth:"min(100vw, 360px)"
Source chunk 0l-kycscho18l.js 0g3toi0pdt7h0.js
Both DepositModal + WithdrawModal patched n/a ✅ ×2 occurrences (one each)

Synthetic CSS reproduction at 375×667 — same minWidth rule each side, placed inside a 240px-wide parent to simulate the narrow-parent scenario the route-details view triggers:

  • Prod CSS → modal squashed to 222px (constrained to parent)
  • Preview CSS → modal renders at 360px (decoupled from parent, follows viewport rule)
  • Delta: 138px wider with the fix

Real-world visual on preview at iPhone 14 Pro Max (430×932): Quick deposit modal centered at ~360px wide, not squashed.

[screenshot: quick-deposit-preview-430.png]

✅ Visually + bundle confirmed. Width math at iPhone 14 Pro Max (430) / iPhone SE (375): min(100vw, 360px) = 360px → modal stays 360-400px wide regardless of parent container narrowing in the route-details view.

@mmioana mmioana merged commit 6efe44b into develop May 21, 2026
18 of 19 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.

2 participants