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 feature #462

Merged
merged 116 commits into from
Sep 13, 2024
Merged

Inline images feature #462

merged 116 commits into from
Sep 13, 2024

Conversation

Skalakid
Copy link
Collaborator

@Skalakid Skalakid commented Aug 30, 2024

Details

This PR adds the ✨ inline image preview feature ✨ to the Live Markdown Input on the web.

inline.images.mov

Change log:

  • added inline image previews when inline image tags are present in the input
  • added support for style and resolution customization
  • added loading indicator spinners that appear when the image previews are being loaded
  • added block element wrappers, that wraps the inline image markdown and text that is before it. Thanks to this structure change, the image preview appears as a block below the markdown

Related Issues

GH_LINK

Manual Tests

  1. Insert inline image markdown text into the input. I.e
![demo image](https://picsum.photos/200/300)
  1. Verify cursor positioning and text alignment while writing text around the image preview
  2. Verify image loading spinner animation and behavior
  3. Verify inline image styles, and try changing the styles passed to the component. Especially the max-height and maxWidth of the preview
  4. Verify if text after the preview can be removed on Backspace press
  5. Verify if the Live Markdown Input behaves normally in other situations that come to your mind

Linked PRs

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.

Code looks good, I'm going to test it now 👀

WebExample/__tests__/styles.spec.ts Show resolved Hide resolved
parser/index.ts Outdated Show resolved Hide resolved
src/styleUtils.ts Outdated Show resolved Hide resolved
@Skalakid Skalakid requested a review from tomekzaw September 10, 2024 15:08
BartoszGrajdek
BartoszGrajdek previously approved these changes Sep 11, 2024
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

@Skalakid Skalakid merged commit e4bb45b into main Sep 13, 2024
5 checks passed
@Skalakid Skalakid deleted the @Skalakid/inline-images-feature branch September 13, 2024 06:12
@nandorojo
Copy link
Contributor

so cool


return text.replaceAll('\r\n', '\n');
// Force letter removal if the input value haven't changed but input type is 'delete'
if (text === target.value && inputType.includes('delete')) {

Choose a reason for hiding this comment

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

Coming from Expensify/App#51466, since inputType can be undefined it caused an issue here when trying to call includes on an undefined value.

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.

5 participants