feat: implement Url Bar Button Updates#25418
Conversation
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The
While the testID ( Selected tags cover all test categories that use browser functionality:
Performance Test Selection: |
|
| ); | ||
|
|
||
| const backButton = screen.getByTestId('browser-tab-close-button'); | ||
| expect(backButton).toBeTruthy(); |
There was a problem hiding this comment.
Test uses weak matcher instead of toBeOnTheScreen()
Low Severity · Bugbot Rules
The new test asserts element presence using toBeTruthy(), which is explicitly prohibited by the unit testing guidelines. The rules state: "Do not use weak matchers like toBeDefined or toBeTruthy to assert element presence. Use toBeOnTheScreen()." The assertion expect(backButton).toBeTruthy() does not properly verify that the element is rendered on screen.





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:
showCloseButtonwas true)This created a confusing user experience where multiple identical-looking buttons performed different actions.
Solution
Xto<(ArrowLeft) and hidden when URL input is focusedshowCloseButtonprop that was causing the Cancel button to show an X icon in certain flowsButton Behavior Summary
<button (left) + Tabs + AccountChangelog
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
Screenshots/Recordings
Before
After
UrlDesignUpdate.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Files Changed
BrowserTab.tsxBrowserUrlBar.tsxshowCloseButtonprop, simplifiedrenderRightButtonBrowserUrlBar.types.tsshowCloseButtonprop typeBrowserUrlBar.styles.tscancelButtonTextto use default text color with medium weightBrowserUrlBar.test.tsxshowCloseButtonfunctionalityBrowserTab/index.test.tsxRemoteImage/index.test.tsxNote
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.
BrowserUrlBarno longer supportsshowCloseButton; 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.
BrowserTabswaps the top-left close icon toArrowLeftand hides it while the URL bar is focused to avoid multiple “X” actions.Tests/snapshots are updated accordingly, and
RemoteImagetests now properly restore theDimensions.getspy to reduce flakiness.Written by Cursor Bugbot for commit 5acd94c. This will update automatically on new commits. Configure here.