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

Inline images preview follow ups #500

Merged
merged 7 commits into from
Sep 20, 2024

Conversation

Skalakid
Copy link
Collaborator

@Skalakid Skalakid commented Sep 19, 2024

Details

This PR:

  • add support for offline patterns and enable image reloading when the app becomes online again
  • fix image styles after the app becomes online and input refreshes
  • fix async image preview loading while the user is typing. Previously, the image was loaded infinitely until the user stopped writing
  • fix image preview markdown layout when it's nested in the h1 tag

Related Issues

Expensify/App#49250

Manual Tests

Offline support

  1. Open an example app
  2. Turn off internet connection on your device
  3. Change the example image URL to something else. for example: https://picsum.photos/id/167/200/300
  4. Turn on internet connection
  5. Verify if the image has been loaded
  6. Verify image styles and size

H1 tag nesting

  1. Open an example app
  2. Put "#" before the inline images markdown tag
  3. Verify the styles of the new structure

Async image loading while typing

  1. Open the example app
  2. Replace content with the following content:
![demo image](https://images.unsplash.com/photo-1597431793715-b4b71ddb5670?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=800&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTcNDQ3OTI3Nw&ixlib=rb-4.0.3&q=80&utm_campaign=api-credit&utmmedium=referral&utm_source=unsplash_source&W=191234512)
  1. While this image is being loaded, start typing any text until the image is being loaded
  2. Verify if the image was loaded

Linked PRs

@Skalakid Skalakid self-assigned this Sep 19, 2024
@Skalakid Skalakid marked this pull request as ready for review September 19, 2024 11:40
@Skalakid Skalakid marked this pull request as draft September 19, 2024 11:42
@Skalakid Skalakid marked this pull request as ready for review September 19, 2024 12:11
Copy link
Collaborator

@BartoszGrajdek BartoszGrajdek left a comment

Choose a reason for hiding this comment

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

LGTM, works great!

@Skalakid Skalakid merged commit 8a1459e into main Sep 20, 2024
5 checks passed
@Skalakid Skalakid deleted the @Skalakid/fix-offline-inline-images-preview branch September 20, 2024 13:18
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.

2 participants