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: og image for link (shared file) #778

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

zaCKoZAck0
Copy link

@zaCKoZAck0 zaCKoZAck0 commented Oct 11, 2024

Related to #629
[WIP]: add og images for file sharing url.

Draft:

  • Dynamically render og image
    • Add icon according to file type
    • Add metadata according to file
  • Add first page preview of file [Skipped]
  • Option to disable file preview. [Skipped]

Currently og image looks something like this:
image

Last updated 30-10-24

Copy link

vercel bot commented Oct 11, 2024

@zaCKoZAck0 is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

github-actions bot commented Oct 11, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mfts
Copy link
Owner

mfts commented Oct 12, 2024

@zaCKoZAck0 looks good for now. Let me know if you have any questions

@zaCKoZAck0
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@mfts
Copy link
Owner

mfts commented Oct 16, 2024

@zaCKoZAck0 are you still working on this issue?

@mfts mfts added revisit Currently not required but important in the future 🕹️ oss.gg labels Oct 16, 2024
@zaCKoZAck0
Copy link
Author

zaCKoZAck0 commented Oct 18, 2024

Hi @mfts ,
I was exploring on how to show the preview but og image has a few limitations.

  1. Can only render images and native JSX elements.
  2. We can't utilize any element that relies on client-side functionality or interactivity / custom React components that use hooks, state, or other advanced React features are not supported, so we can't use our existing methods or most of the external libraries.

Few workarounds:

  1. We can convert first page of our documents to image and then render it on the og.
    1.1. But issue with the above is we have to add multiple dependencies to convert each file type to an image.
    1.2. The fix would be to add preview of selected types for e.g. Image, PDFs etc. which would require minimum dependencies.
  2. We can ask users to upload a preview? But it won't be as intuitive as other methods.

What path should I take next?, I've updated the current state of OG preview in the PR description.

@mfts
Copy link
Owner

mfts commented Oct 19, 2024

@zaCKoZAck0 thanks for the transparency.

Perhaps you can then design a OG image that takes the name of the document, Papermark and then a standard papermark image. Something that we could swap out in the future as a standard image.

@mfts
Copy link
Owner

mfts commented Oct 22, 2024

@zaCKoZAck0 let me know if you'd like to proceed with this PR?

@zaCKoZAck0
Copy link
Author

zaCKoZAck0 commented Oct 22, 2024

Hi @mfts ,
Yes I would like to continue with the PR
I was just exploring some ideas for the placeholder image and office.com uses something like this which we can take inspiration from.

image

Here's from another office suite.
image

We can replace the grey area of the og image with a placeholder illustration image like this. That will let the user know what type of document it is.

@zaCKoZAck0
Copy link
Author

zaCKoZAck0 commented Oct 22, 2024

Placeholder Image for PDF, DOC, CAD and Notion
image

@zaCKoZAck0
Copy link
Author

zaCKoZAck0 commented Oct 22, 2024

For Sheet, Image, Slides, Dataroom and other files
image

@mfts please review the above placeholder images.

@mfts
Copy link
Owner

mfts commented Oct 29, 2024

@zaCKoZAck0 these placeholders aren't really professional looking. I'm thinking we need to go basic and minimalist.

something like cal.com
CleanShot 2024-10-29 at 12 25 18@2x

@zaCKoZAck0
Copy link
Author

zaCKoZAck0 commented Oct 30, 2024

Hi @mfts
I've created an OG (V2) that is minimal and according to papermark's design language. Let me know what you think.

If brand is present
image

If brand is not present
image

@zaCKoZAck0
Copy link
Author

zaCKoZAck0 commented Oct 30, 2024

@mfts this is a more minimal option V3
image

@zaCKoZAck0 zaCKoZAck0 marked this pull request as ready for review October 30, 2024 19:52
@zaCKoZAck0 zaCKoZAck0 requested a review from mfts as a code owner October 30, 2024 19:52
@zaCKoZAck0 zaCKoZAck0 changed the title [WIP] feat: og image (dynamic route) feat: og image (dynamic route) Oct 30, 2024
@zaCKoZAck0 zaCKoZAck0 changed the title feat: og image (dynamic route) feat: og image for link (shared file) Oct 30, 2024
@mfts
Copy link
Owner

mfts commented Oct 31, 2024

@zaCKoZAck0 I like this one this one the best (without the avatar)

CleanShot 2024-10-31 at 12 32 12@2x

@mfts mfts added ready-for-review and removed revisit Currently not required but important in the future iteration-2 labels Oct 31, 2024
@zaCKoZAck0
Copy link
Author

Thanks, I'll do the required changes.

@zaCKoZAck0
Copy link
Author

Hi @mfts

It's ready for review now.

Copy link
Owner

@mfts mfts left a comment

Choose a reason for hiding this comment

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

Looks super cool!

@mfts
Copy link
Owner

mfts commented Oct 31, 2024

Thanks for working with me to get this over the line!

May I ask where you go the tiled background from. I may want to reuse it in other places :)

Copy link

vercel bot commented Oct 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
papermark ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 10:57am

@zaCKoZAck0
Copy link
Author

Hi @mfts

Here's the background I used https://www.svgbackgrounds.com/set/free-svg-backgrounds-and-patterns/#pattern-randomized

Use stroke width around 0.1 0.2 to get that github like grid 😁

@mfts
Copy link
Owner

mfts commented Oct 31, 2024

/award 1500

awarding you and merging it later

Copy link

oss-gg bot commented Oct 31, 2024

Awarding zaCKoZAck0: 1500 points 🕹️ Well done! Check out your new contribution on oss.gg/zaCKoZAck0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants