Skip to content

chore(runway): cherry-pick feat: implement Url Bar Button Updates#25459

Merged
joaoloureirop merged 1 commit intorelease/7.64.0from
runway-cherry-pick-7.64.0-1769798253
Jan 30, 2026
Merged

chore(runway): cherry-pick feat: implement Url Bar Button Updates#25459
joaoloureirop merged 1 commit intorelease/7.64.0from
runway-cherry-pick-7.64.0-1769798253

Conversation

@runway-github
Copy link
Contributor

@runway-github runway-github bot commented Jan 30, 2026

Description

This PR updates the WebBrowser URL bar button interactions to match the
new design specifications and fix the "3 X buttons" issue.

Jira Ticket: https://consensyssoftware.atlassian.net/browse/MCWP-310

Problem

Previously, the URL bar could display up to 3 "X" buttons
simultaneously:

  1. Top-left back button (always an X)
  2. Clear input button (CircleX inside input)
  3. Cancel button (could be X when showCloseButton was true)

This created a confusing user experience where multiple
identical-looking buttons performed different actions.

Solution

  • Back Button: Changed icon from X to < (ArrowLeft) and hidden
    when URL input is focused
  • Cancel Button: Now always displays "Cancel" text (never an X
    icon), styled to match the Explore search bar
  • Clear Button: Unchanged - CircleX inside input to clear text
    (already correct)
  • Removed the showCloseButton prop that was causing the Cancel button
    to show an X icon in certain flows

Button Behavior Summary

State Before After
Not focused X button (left) + Tabs + Account < button (left)
  • Tabs + Account |
    | Focused | X button (left) + Clear (X) + Cancel (X or text) | Clear
    (X) + Cancel (text) |

Changelog

CHANGELOG entry: Updated browser URL bar buttons - back button now shows
chevron icon and hides when typing, cancel button always shows text
instead of X icon

Related issues

Fixes:

Manual testing steps

Feature: Browser URL Bar Button Interactions

  Scenario: User sees back button when browsing
    Given the user has opened a website in the browser
    And the URL bar is not focused

    When user views the browser top bar
    Then the back button should display a "<" chevron icon on the left
    And the tabs button and account button should be visible on the right

  Scenario: User focuses on URL bar to search
    Given the user has opened a website in the browser
    And the URL bar is not focused

    When user taps on the URL bar
    Then the back button should be hidden
    And the "Cancel" text button should appear on the right
    And the clear (X) button should appear inside the input field

  Scenario: User clears search input
    Given the user has focused on the URL bar
    And has typed some text

    When user taps the clear (X) button inside the input
    Then the text should be cleared
    And the URL bar should remain focused

  Scenario: User cancels search
    Given the user has focused on the URL bar

    When user taps the "Cancel" button
    Then the URL bar should lose focus
    And the back button "<" should reappear
    And the current page URL should be restored

  Scenario: User navigates back to Explore
    Given the user has opened a website in the browser
    And the URL bar is not focused

    When user taps the back button "<"
    Then user should be navigated back to the Explore/Trending page

Screenshots/Recordings

Before

Screenshot 2026-01-29 at 16 22 49

  • Back button showed "X" icon
  • Cancel button could show "X" icon (when opened from Trending)
  • 3 X buttons could be visible simultaneously when URL bar was focused

After

  • Back button shows "<" chevron icon
  • Back button hides when URL bar is focused
  • Cancel button always shows "Cancel" text
  • Only the clear button (inside input) shows an X when focused
UrlDesignUpdate.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.

Files Changed

File Change
BrowserTab.tsx Changed back button icon to ArrowLeft, hide when
URL bar focused
BrowserUrlBar.tsx Removed showCloseButton prop, simplified
renderRightButton
BrowserUrlBar.types.ts Removed showCloseButton prop type
BrowserUrlBar.styles.ts Updated cancelButtonText to use default
text color with medium weight
BrowserUrlBar.test.tsx Updated tests for removed showCloseButton
functionality
BrowserTab/index.test.tsx Added test for back button visibility
RemoteImage/index.test.tsx Fixed flaky test by properly cleaning
up Dimensions mock

Note

Low Risk
Low risk UI behavior/styling changes in the in-app browser header plus test updates; main risk is minor UX regressions around focus state and navigation affordances.

Overview
Browser URL bar button behavior is simplified to match new designs. BrowserUrlBar no longer supports showCloseButton; when focused it always shows a text Cancel button (with updated styling) instead of sometimes rendering a close icon.

Browser header navigation icon is updated. BrowserTab replaces the left-side close icon with an ArrowLeft button and hides it while the URL bar is focused.

Tests and snapshots are updated accordingly, and RemoteImage tests now properly restore the Dimensions.get spy to reduce test flakiness.

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

6471fcd

…5418)

## **Description**

This PR updates the WebBrowser URL bar button interactions to match the
new design specifications and fix the "3 X buttons" issue.

**Jira Ticket:** https://consensyssoftware.atlassian.net/browse/MCWP-310

### Problem
Previously, the URL bar could display up to 3 "X" buttons
simultaneously:
1. Top-left back button (always an X)
2. Clear input button (CircleX inside input)
3. Cancel button (could be X when `showCloseButton` was true)

This created a confusing user experience where multiple
identical-looking buttons performed different actions.

### Solution
- **Back Button**: Changed icon from `X` to `<` (ArrowLeft) and hidden
when URL input is focused
- **Cancel Button**: Now always displays "Cancel" text (never an X
icon), styled to match the Explore search bar
- **Clear Button**: Unchanged - CircleX inside input to clear text
(already correct)
- Removed the `showCloseButton` prop that was causing the Cancel button
to show an X icon in certain flows

### Button Behavior Summary

| State | Before | After |
|-------|--------|-------|
| **Not focused** | X button (left) + Tabs + Account | `<` button (left)
+ Tabs + Account |
| **Focused** | X button (left) + Clear (X) + Cancel (X or text) | Clear
(X) + Cancel (text) |

## **Changelog**

CHANGELOG entry: Updated browser URL bar buttons - back button now shows
chevron icon and hides when typing, cancel button always shows text
instead of X icon

## **Related issues**

Fixes: <!-- Add issue number if applicable -->

## **Manual testing steps**

```gherkin
Feature: Browser URL Bar Button Interactions

  Scenario: User sees back button when browsing
    Given the user has opened a website in the browser
    And the URL bar is not focused

    When user views the browser top bar
    Then the back button should display a "<" chevron icon on the left
    And the tabs button and account button should be visible on the right

  Scenario: User focuses on URL bar to search
    Given the user has opened a website in the browser
    And the URL bar is not focused

    When user taps on the URL bar
    Then the back button should be hidden
    And the "Cancel" text button should appear on the right
    And the clear (X) button should appear inside the input field

  Scenario: User clears search input
    Given the user has focused on the URL bar
    And has typed some text

    When user taps the clear (X) button inside the input
    Then the text should be cleared
    And the URL bar should remain focused

  Scenario: User cancels search
    Given the user has focused on the URL bar

    When user taps the "Cancel" button
    Then the URL bar should lose focus
    And the back button "<" should reappear
    And the current page URL should be restored

  Scenario: User navigates back to Explore
    Given the user has opened a website in the browser
    And the URL bar is not focused

    When user taps the back button "<"
    Then user should be navigated back to the Explore/Trending page
```

## **Screenshots/Recordings**

### **Before**

<img width="450" height="316" alt="Screenshot 2026-01-29 at 16 22 49"
src="https://github.com/user-attachments/assets/3dba6e1b-9f3f-4dae-8f9c-17512524bf87"
/>

- Back button showed "X" icon
- Cancel button could show "X" icon (when opened from Trending)
- 3 X buttons could be visible simultaneously when URL bar was focused

### **After**

- Back button shows "<" chevron icon
- Back button hides when URL bar is focused
- Cancel button always shows "Cancel" text
- Only the clear button (inside input) shows an X when focused



https://github.com/user-attachments/assets/68be1901-f419-4d1e-891f-6d976709a610

<!-- Add actual screenshots/recordings here -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.

---

## Files Changed

| File | Change |
|------|--------|
| `BrowserTab.tsx` | Changed back button icon to ArrowLeft, hide when
URL bar focused |
| `BrowserUrlBar.tsx` | Removed `showCloseButton` prop, simplified
`renderRightButton` |
| `BrowserUrlBar.types.ts` | Removed `showCloseButton` prop type |
| `BrowserUrlBar.styles.ts` | Updated `cancelButtonText` to use default
text color with medium weight |
| `BrowserUrlBar.test.tsx` | Updated tests for removed `showCloseButton`
functionality |
| `BrowserTab/index.test.tsx` | Added test for back button visibility |
| `RemoteImage/index.test.tsx` | Fixed flaky test by properly cleaning
up Dimensions mock |


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes browser navigation/UI behavior (back button visibility/icon
and URL bar cancel behavior), which could affect in-app browser
usability and edge-case flows (e.g., focus/blur and navigation). No
security- or data-sensitive logic is touched.
> 
> **Overview**
> **Browser URL bar button behavior is simplified and aligned with new
designs.** `BrowserUrlBar` no longer supports `showCloseButton`; when
focused it always shows a text **Cancel** button (with updated styling),
and when not focused it keeps the account button.
> 
> **Browser tab header navigation is updated.** `BrowserTab` swaps the
top-left close icon to `ArrowLeft` and hides it while the URL bar is
focused to avoid multiple “X” actions.
> 
> Tests/snapshots are updated accordingly, and `RemoteImage` tests now
properly restore the `Dimensions.get` spy to reduce flakiness.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5acd94c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github bot requested a review from a team as a code owner January 30, 2026 18:37
@github-actions
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-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Jan 30, 2026
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.64.0)

All E2E tests pre-selected.

View GitHub Actions results

Copy link

@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 2 potential issues.

);

const backButton = screen.getByTestId('browser-tab-close-button');
expect(backButton).toBeTruthy();
Copy link

Choose a reason for hiding this comment

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

Test uses weak matcher instead of toBeOnTheScreen

Low Severity · Bugbot Rules

The newly added test uses expect(backButton).toBeTruthy() to assert element presence. This violates the BUGBOT rule: "Do not use weak matchers like toBeDefined or toBeTruthy to assert element presence. Use toBeOnTheScreen()." The assertion at line 117 needs to use toBeOnTheScreen() instead of toBeTruthy() for proper element presence verification.

Fix in Cursor Fix in Web

const onCancelMock = jest.fn();
const props = { ...defaultProps, onCancel: onCancelMock };

const { getByTestId } = renderWithProvider(
Copy link

Choose a reason for hiding this comment

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

Duplicate test for Cancel button rendering when focused

Low Severity

The test 'always renders Cancel text button when URL bar is focused' at line 569 is redundant with the test 'renders Cancel button with text' at line 524. Both tests render BrowserUrlBar with defaultProps (which has isUrlBarFocused: true) and verify the Cancel button text is present. The first test already covers this case with more thorough assertions (checking both testID and text), making the second test unnecessary.

Additional Locations (1)

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link

@joaoloureirop joaoloureirop enabled auto-merge (squash) January 30, 2026 19:52
@joaoloureirop joaoloureirop merged commit a86c788 into release/7.64.0 Jan 30, 2026
97 of 98 checks passed
@joaoloureirop joaoloureirop deleted the runway-cherry-pick-7.64.0-1769798253 branch January 30, 2026 19:52
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
@metamaskbot metamaskbot added the release-7.64.0 Issue or pull request that will be included in release 7.64.0 label Feb 3, 2026
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.64.0 on PR, as PR was cherry-picked in branch 7.64.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.64.0 Issue or pull request that will be included in release 7.64.0 size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants