Skip to content

fix: keep keypad state on flip and close it when dest token input is pressed#26068

Merged
GeorgeGkas merged 1 commit intomainfrom
swaps-4124
Feb 13, 2026
Merged

fix: keep keypad state on flip and close it when dest token input is pressed#26068
GeorgeGkas merged 1 commit intomainfrom
swaps-4124

Conversation

@GeorgeGkas
Copy link
Copy Markdown
Contributor

@GeorgeGkas GeorgeGkas commented Feb 13, 2026

Description

keep keypad state on flip and close it when dest token input is pressed

Changelog

CHANGELOG entry: keep keypad state on flip and close it when dest token input is pressed

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4124

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

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.

Note

Low Risk
UI interaction change limited to keypad open/close behavior plus test-only mocks and snapshot updates; minimal impact outside the Bridge screen.

Overview
Updates BridgeView keypad interactions: flipping source/destination tokens now calls handleSwitchTokens directly (no forced refocus or keypadRef.open()), and pressing the destination amount input explicitly closes the keypad.

Strengthens test coverage by mocking BottomSheetDialog to make close behavior synchronous in JSDOM, adding a regression test for closing the keypad via destination input, and updating the flip test to assert the keypad open/closed state is preserved; snapshots are updated to match UI output changes.

Written by Cursor Bugbot for commit f228f63. This will update automatically on new commits. Configure here.

@GeorgeGkas GeorgeGkas requested a review from a team as a code owner February 13, 2026 12:53
@github-actions
Copy link
Copy Markdown
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-swaps-and-bridge Swaps and Bridge team label Feb 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are focused on the BridgeView component with two specific UI/UX improvements:

  1. Flip button simplification: Removed the onFlipButtonPress wrapper function and now directly calls handleSwitchTokens(destTokenAmount). This removes the automatic keypad focus/open behavior after flipping tokens, preserving the keypad state instead.

  2. Destination token input keypad close: Added onInputPress={() => keypadRef.current?.close()} to close the keypad when the user taps on the destination token input area.

These are minor UI interaction improvements that affect the Bridge feature. The changes are well-covered by new unit tests that verify:

  • Keypad closes when pressing destination token input
  • Keypad state is preserved when clicking the flip/arrow button

Tag Selection Rationale:

  • SmokeTrade: Required because the changes directly affect the Bridge functionality, which is part of the trade/swap features. The E2E test bridge-action-smoke.spec.ts is tagged with SmokeTrade and tests the bridge flow.
  • SmokeConfirmations: Required per tag guidance - "When selecting SmokeTrade for swap or bridge flows, also select SmokeConfirmations" since transaction confirmations are part of the bridge flow.

The risk is low because:

  • Changes are localized to a single view component
  • No changes to controllers, Engine, or state management
  • Well-tested with unit tests
  • No changes to critical paths or security-sensitive code

Performance Test Selection:
The changes are minor UI interaction improvements (keypad open/close behavior on button press). There are no changes that would impact rendering performance, data loading, state management, or app startup. The modifications simply change when the keypad opens/closes during user interaction with the bridge view - this doesn't warrant performance testing.

View GitHub Actions results

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@sonarqubecloud
Copy link
Copy Markdown

@GeorgeGkas GeorgeGkas added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit 87d3e36 Feb 13, 2026
116 checks passed
@GeorgeGkas GeorgeGkas deleted the swaps-4124 branch February 13, 2026 13:46
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
@metamaskbot metamaskbot added the release-7.67.0 Issue or pull request that will be included in release 7.67.0 label Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.67.0 Issue or pull request that will be included in release 7.67.0 size-S team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants