Skip to content
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

fix: add support for svg uris without viewbox #10247

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Jul 4, 2024

Description

We have ran into some SVG rendering issues with SVG URIs. This is due to some SVGs do not contain a view-box, thus can be much larger or smaller than the container it is trying to fit in.

For example:

  • This SVG does not have a viewbox, and does not "render correctly"
  • This SVG does have a viewbox and can be rendered correctly.
See Example Screenshot

Screenshot 2024-07-04 at 02 36 32

This adds an effect to use the SVG width/height for setting a view box if not set in the SVG.

Related issues

Known issue and temporary fix in react-native-svg:
software-mansion/react-native-svg#1202 (comment)

Manual testing steps

Screenshots/Recordings

Before

Before

Screenshot 2024-07-04 at 02 36 32

After

After

Screenshot 2024-07-04 at 12 32 35

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.

Copy link
Contributor

github-actions bot commented Jul 4, 2024

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-notifications Notifications team label Jul 4, 2024
@Prithpal-Sooriya Prithpal-Sooriya added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: c620aef
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/09a4e463-1363-45e2-b125-1ee0378d7e47

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

@Prithpal-Sooriya Prithpal-Sooriya force-pushed the fix-support-svg-uri-without-viewbox branch from c620aef to e6191a1 Compare July 4, 2024 12:39
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review July 4, 2024 12:39
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner July 4, 2024 12:39
@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: a0581b4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f917cecc-2409-4cd4-a53c-c01b3d144d9f

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

organize hooks into separate file inside the /hooks folder
@Prithpal-Sooriya Prithpal-Sooriya force-pushed the fix-support-svg-uri-without-viewbox branch from 5434249 to f91517e Compare July 4, 2024 16:33
Copy link

sonarcloud bot commented Jul 4, 2024

@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: f91517e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7126ccb9-4ff4-4c4c-8a62-2c2a23fb8246

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

Copy link
Contributor

@Jonathansoufer Jonathansoufer left a comment

Choose a reason for hiding this comment

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

LGTM! Well done!

@Jonathansoufer Jonathansoufer merged commit 9b695e4 into main Jul 4, 2024
37 of 38 checks passed
@Jonathansoufer Jonathansoufer deleted the fix-support-svg-uri-without-viewbox branch July 4, 2024 17:15
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2024
@metamaskbot metamaskbot added the release-7.27.1 Issue or pull request that will be included in release 7.27.1 label Jul 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.27.1 Issue or pull request that will be included in release 7.27.1 Run Smoke E2E Triggers smoke e2e on Bitrise team-notifications Notifications team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants