Skip to content

feat: Start browser tab in token discovery mode #15061

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

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

ziad-saab
Copy link
Contributor

@ziad-saab ziad-saab commented May 1, 2025

Description

⚠️ NOTE: I added the skip-sonar-cloud label due to missing test coverage in BrowserTab. A lot of effort was spent to increase the test coverage of BrowserTab – previously almost zero. At this point I'm out of ideas for continuing to increase test coverage, as it would involve mocking components with a useImperativeHandle and other contortions.


Start the browser in token discovery mode. This PR is only a chunk of the work, so the feature was put behind an environment variable flag.

Related issues

Fixes: MMPD-1588

Manual testing steps

  1. Set TOKEN_DISCOVERY_BROWSER_ENABLED to "true" in your .js.env file
  2. Reload the app
  3. Open the mobile browser
  4. Create a new tab
  5. Observe that instead of getting sent to portfolio.metamask, you get a screen that says "Token Discovery placeholder"

Screenshots/Recordings

Before

before.mp4

After (with environment variable flag turned on)

after.mp4

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.

@ziad-saab ziad-saab requested a review from a team as a code owner May 1, 2025 19:54
Copy link
Contributor

github-actions bot commented May 1, 2025

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.

@ziad-saab ziad-saab changed the title wip feat: Start browser tab in token discovery mode May 6, 2025
@ziad-saab ziad-saab added QA Passed QA testing has been completed and passed Run Smoke E2E Requires smoke E2E testing labels May 6, 2025
Copy link
Contributor

github-actions bot commented May 6, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 47b7531
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4d42b212-9316-48e1-b072-edee6fcbdc07

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@ziad-saab ziad-saab added skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. and removed skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. labels May 7, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 7d3f718
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0089f1e2-4c11-4572-920a-170604304d81

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@ziad-saab ziad-saab removed the Run Smoke E2E Requires smoke E2E testing label May 14, 2025
@ziad-saab ziad-saab added the Run Smoke E2E Requires smoke E2E testing label May 14, 2025
Copy link
Contributor

github-actions bot commented May 14, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 939ada4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8d0e85d2-2583-41fe-822f-4d2f909b9ebf

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@ziad-saab ziad-saab added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 14, 2025
@ziad-saab ziad-saab added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 14, 2025
Copy link
Contributor

github-actions bot commented May 14, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e5d0fba
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ce6099e9-6a32-4a54-a694-c8f62872d037

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@ziad-saab ziad-saab added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 14, 2025
Copy link
Contributor

github-actions bot commented May 14, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 53ee7a8
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/84d5515c-94de-4641-8a3d-2a865272eccc

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@ziad-saab ziad-saab added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 14, 2025
@ziad-saab ziad-saab self-assigned this May 14, 2025
@ziad-saab ziad-saab added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 14, 2025
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

Left a comment, will follow up for a pair review

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to redefine, we can use AppConstants instead

navigation.navigate(Routes.BROWSER.ASSET_LOADER, {
chainId: item.chainId,
address: item.address,
});
} else {
// Unfocus the url bar and hide the autocomplete results
urlBarRef.current?.hide();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can call hideAutocomplete()

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
70.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@ziad-saab ziad-saab marked this pull request as draft May 22, 2025 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA Passed QA testing has been completed and passed Run Smoke E2E Requires smoke E2E testing skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-portfolio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants