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

feat: use ordinal thumbnails (ENG-2296) #494

Conversation

victorkirov
Copy link
Member

@victorkirov victorkirov commented Jun 30, 2023

πŸ”˜ PR Type

What kind of change does this PR introduce?

  • Enhancement

πŸ“œ Background

Currently, we don't display HTML ordinals due to security risks, and SVG recursive ordinals don't work in the extension.

We want to display a thumbnail jpg preview of such ordinals.

Issue Link: ENG-2296

πŸ”„ Changes

  • HTML and recursive SVG ordinals are displayed as a thumbnail in the form of a JPG created by the new ordinal viewer service.
  • Some styling was fixed in the ordinal gallery within the popup and the gallery view, so BRC-20 token images are now centered regardless of where you are viewing them, and images scale while keeping their aspect ratio of 1:1
  • Fixed styling of HTML ordinals
  • Changed external ordinal view link to point to our ordinal viewer page instead of ord.io

πŸ–Ό Screenshot / πŸ“Ή Video

image

A before shot for reference:
image

This is the button on ordinals that takes you to the new ordinal viewer:
image

βœ… Review checklist

Please ensure the following are true before merging:

  • Code Style is consistent with the project guidelines.
  • Code is readable and well-commented.
  • No unnecessary or debugging code has been added.
  • Security considerations have been taken into account.
  • The change has been manually tested and works as expected.
  • Breaking changes and their impacts have been considered and documented.
  • Code does not introduce new technical debt or issues.

@linear
Copy link

linear bot commented Jun 30, 2023

ENG-2296 Display the preview of a recursive ordinal

  1. /This is the preview URL for recursive ordinals on ordinals.com: https://ordinals.com/preview/61fcea08830580206771ddd5d012521b9b2b35ef0741d3c6d0a966598f923169i0

    it actually just has some javascript that loads content and renders it

  2. looks like it loads the full thing: https://ordinals.com/preview/d0460b1203e7f2496ba8ea9d532ed93b7e2b004cfdae808c841effe4ebe39ca4i0?&Recursion&APE&https://twitter.com/FML0072&5fc30fa66699e9938bdd4c14f3d7a0724247ece435fcba4af4618d22c2860d99i0&iframe

3. I was thinking if we can run some sort of script that takes a screenshot of the iframe and then caches it on the server side and the wallet can call it for the preview image without security issues

@victorkirov
Copy link
Member Author

A side note: The ordinal thumbnail service extracts thumbnails in 450x450px resolution. If the HTML being rendered is a fixed size or it doesn't scale nicely, you often end up with a white border :/

@victorkirov victorkirov changed the title feat: use ordinal thumbnails feat: use ordinal thumbnails (ENG-2296) Jul 3, 2023
@DuskaT021
Copy link
Contributor

@yknl as soon as this tx gets confirmed we can merge (send the recursive ordinal)
https://mempool.space/tx/d6aa1f935aa750f1356d935270ebe5056bc40d36f8d98eaf47fec05757ce12a8

@DuskaT021 DuskaT021 merged commit d5a371b into develop Jul 4, 2023
1 check passed
@victorkirov victorkirov deleted the victor/eng-2296-display-the-preview-of-a-recursive-ordinal branch July 4, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants