Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(runway): cherry-pick fix: cp-12.13.0 fixes drag and drop in network list menu modal #30442

Closed

Conversation

runway-github[bot]
Copy link

@runway-github runway-github bot commented Feb 19, 2025

Description

This PR fixes an issue with the drag-and-drop functionality in the
network list menu by isolating the modal animation to only use opacity
instead of transform. The transform animation was interfering with the
react-beautiful-dnd library's positioning calculations, causing the
draggable items to behave incorrectly.

The solution introduces a custom network-menu-fade animation in the
index.scss file for the network menu modal, which only animates
opacity and removes the transform property. This ensures the
drag-and-drop functionality works as expected while maintaining a smooth
fade-in animation.

Key Changes:

  • Added a custom network-menu-fade animation in index.scss.
  • Removed transform from the modal to fix drag-and-drop behavior.
  • Isolated the animation to the network menu component to avoid
    affecting other modals.

Open in GitHub Codespaces

Related issues

Fixes: #30436

Manual testing steps

  1. Open the MetaMask extension.
  2. Click on the network selector in the top left corner.
  3. Try to drag and reorder any of the enabled networks.
  4. Verify that the drag-and-drop functionality works smoothly and the
    modal fades in correctly.

Screenshots/Recordings

Before

  • Dragging network items was inconsistent or broken due to transform
    interference.
modal.slideup.720.mov

After

  • Network items can be dragged and reordered smoothly.
  • The modal fades in without any transform-related issues.
network.modal.fix720.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots. f28216f

…work list menu modal (#30437)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR fixes an issue with the drag-and-drop functionality in the
network list menu by isolating the modal animation to only use opacity
instead of transform. The transform animation was interfering with the
`react-beautiful-dnd` library's positioning calculations, causing the
draggable items to behave incorrectly.

The solution introduces a custom `network-menu-fade` animation in the
`index.scss` file for the network menu modal, which only animates
opacity and removes the `transform` property. This ensures the
drag-and-drop functionality works as expected while maintaining a smooth
fade-in animation.

### Key Changes:
- Added a custom `network-menu-fade` animation in `index.scss`.
- Removed `transform` from the modal to fix drag-and-drop behavior.
- Isolated the animation to the network menu component to avoid
affecting other modals.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/30437?quickstart=1)

## **Related issues**

Fixes: #30436

## **Manual testing steps**

1. Open the MetaMask extension.
2. Click on the network selector in the top left corner.
3. Try to drag and reorder any of the enabled networks.
4. Verify that the drag-and-drop functionality works smoothly and the
modal fades in correctly.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->
- Dragging network items was inconsistent or broken due to transform
interference.


https://github.com/user-attachments/assets/e26cf959-c064-4f12-bad7-6c2308caf50c

### **After**

<!-- [screenshots/recordings] -->
- Network items can be dragged and reordered smoothly.
- The modal fades in without any transform-related issues.


https://github.com/user-attachments/assets/9052359d-98f6-4267-8d60-92cdef44388b

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability.
- [x] I’ve included tests if applicable.
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable.
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@runway-github runway-github bot force-pushed the runway-cherry-pick-12.13.0-1739993072 branch from d11a301 to 69535c0 Compare February 19, 2025 19:24
@runway-github runway-github bot requested a review from a team as a code owner February 19, 2025 19:24
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-runway-bot Runway bot team (for Runway Bot) label Feb 19, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [69535c0]
Page Load Metrics (1705 ± 89 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14802430170519192
domContentLoaded14692347168117986
load14782401170518689
domInteractive25142543517
backgroundConnect96827199
firstReactRender1472342412
getState419832
initialActions00000
loadScripts10151733122814771
setupStore759212010
uiStartup16842613194019292

@georgewrmarshall
Copy link
Contributor

Closing this PR since I just realized this is a Sev2, which doesn’t warrant being cherry-picked into the release branch.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team-runway-bot Runway bot team (for Runway Bot)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants