Commit 87b4499
authored
refactor: modify trending browser navigators (#23598)
## **Description**
Fixes issue where custom trending browser uses a different design
compared to the original.
This PR removes our custom browser wrapper in favour of the original
browser + behaviour -- the mobile platform team will spearhead the IAB
changes.
For visibility:
Navigation Structure Before:
```
(TAB) REMOVED Browser Tab -- removing this caused issues for areas using old browser navigation
(TAB) Trending Tab (ExploreFlow)
(STACK) Trending
(STACK) Trending
- TRENDING_FEED
- EXPLORE_SEARCH
- Custom Browser
```
Navigation Structure After:
```
(TAB) Browser Tab (BrowserFlow) -- Keeping original browser tab, but it is hidden - existing navigations will still work
- BROWSER.VIEW
- BROWSER.ASSET_LOADER
- BROWSER.ASSET_VIEW
(TAB) Trending Tab (ExploreFlow)
- TRENDING_FEED
- EXPLORE_SEARCH
- Dedicated BrowserFlow screen -- Allows trending page to use existing browser (no custom browser), and retains trending navigation back behaviour (search queries and navigation stack is retained)
```
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: refactor: modify trending/explore page navigation
stacks
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
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**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
https://www.loom.com/share/bb1343b7a7ed4b1abb841f8c6d1284f3
## **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**
- [ ] 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Refactors Explore/Trending to use the main Browser flow (with a hidden
Browser tab), adds `TRENDING_FEED`, and enhances TabBar to support
custom selection/hidden states, updating routes and tests accordingly.
>
> - **Navigation / Explore-Trending**:
> - Replace custom Trending browser with existing `BrowserFlow`; remove
`BrowserWrapper` and related screens.
> - Introduce `ExploreHome` stack with `Routes.TRENDING_FEED`,
`Routes.EXPLORE_SEARCH`, `Routes.SITES_FULL_VIEW`, and nested
`Routes.BROWSER.HOME`.
> - Keep `Routes.BROWSER.HOME` as a hidden tab when trending is enabled;
Trending tab considers both `TRENDING_VIEW` and `BROWSER.HOME` as
selected.
> - Update `BrowserTab` back behavior to return to `TRENDING_VIEW ->
TRENDING_FEED` when not launched from Trending.
> - Add `Routes.TRENDING_FEED`.
> - **TabBar**:
> - Add `options.isSelected(rootScreenName)` and `options.isHidden` to
`ExtendedBottomTabDescriptor`.
> - Change Trending tab press to `navigation.reset({ routes: [{ name:
Routes.TRENDING_VIEW }] })`.
> - **Sites/Explore interactions**:
> - `SiteRowItemWrapper` and `SitesSearchFooter` now navigate to
`Routes.BROWSER.HOME` with `screen: Routes.BROWSER.VIEW` and `{
fromTrending: true, newTabUrl, timestamp }`.
> - **Tests / Snapshots**:
> - Update unit tests and snapshots for new navigation targets and
removal of deprecated screens (`TrendingBrowser`, `BrowserWrapper`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ec05612. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 6f907f4 commit 87b4499
File tree
14 files changed
+193
-260
lines changed- app
- components
- UI/Sites/components
- SiteRowItemWrapper
- Views
- BrowserTab
- TrendingView
- components/BrowserWrapper
14 files changed
+193
-260
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
105 | 114 | | |
106 | 115 | | |
107 | 116 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | 281 | | |
301 | 282 | | |
302 | 283 | | |
| |||
324 | 305 | | |
325 | 306 | | |
326 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
327 | 365 | | |
328 | 366 | | |
329 | 367 | | |
| |||
642 | 680 | | |
643 | 681 | | |
644 | 682 | | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
649 | 689 | | |
650 | 690 | | |
651 | 691 | | |
| |||
669 | 709 | | |
670 | 710 | | |
671 | 711 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
678 | 735 | | |
679 | 736 | | |
680 | 737 | | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
| 738 | + | |
687 | 739 | | |
688 | 740 | | |
689 | 741 | | |
| |||
950 | 1002 | | |
951 | 1003 | | |
952 | 1004 | | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | 1005 | | |
974 | 1006 | | |
975 | 1007 | | |
| |||
1033 | 1065 | | |
1034 | 1066 | | |
1035 | 1067 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
| 1068 | + | |
1055 | 1069 | | |
1056 | 1070 | | |
1057 | 1071 | | |
| |||
Lines changed: 0 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 41 | | |
53 | 42 | | |
54 | 43 | | |
| |||
97 | 86 | | |
98 | 87 | | |
99 | 88 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 89 | | |
111 | 90 | | |
112 | 91 | | |
| |||
0 commit comments