We should use https://github.com/jonschlinkert/parse-github-url to intelligently unfurl GitHub urls into attachments that render inline in messages.
This would be done similarly to what we are doing for thread URLs in message/view.js:
Would need to fetch additional information from the GitHub public API somehow, and then render a nice card like we do for the Spectrum threads.
Yup. In reality we should just build on top of the existing urls regex we have for adding embeds to threads. Eg. you link to a youtube video in chat and we unfurl the video.
As of #4827 the thread embeds are moved to the automatic embed system, so this feature should be implemented in shared/draft-utils/add-embeds-to-draft-js.js!
@brianlovin Do we have mocks or an example of how the github attachments/embeds should look like? I want to work on this feature. Thanks
@segmentationfaulter I don't have mocks, but I think if you re-used the current thread attachments, we could remove the avatar, then swap out the title and subtitle content. Maybe if we started with just issue + pull request links, we could do:
Issue
title: Issue title · #${issue number} (${issue open/closed status})
subtitle: ${issue org}/${issue repo} · ${issue author full name}
PR
title: PR title · #${PR number} (${pr open/merged/closed status})
subtitle: ${pr org}/${pr repo} · ${pr opener full name}
Here's how they current thread attachments look:

So we'd remove the user avatar, and instead of having the like/comment counts, we'd just have subtext for the above.
Does this seem okay to you?
Hmm if not done yet, can i take it ? @brianlovin if anything else i'd like to contribute there too :D
hehe sorry if its a weird question but does :+1: mean i can go ahead and do it? :sweat_smile: @brianlovin
Of course, open to ideas here too!
@mahaveer0496 Just wondering if this is still being worked on? Would be happy to take over, or assist where possible!
@johnletey I'm actually trying, just having a hard time making sense of code 😓
If I don't finish by this week, can I ping you?
@johnletey I'm actually trying, just having a hard time making sense of code 😓
Let me know if you need any help!
If I don't finish by this week, can I ping you?
@mahaveer0496 Of course you can!
@johnletey sorry man i couldn't finish, i need more training before contributing to open source..... please go ahead and take it.
@mahaveer0496 Sounds good ... I will start working on this now!
@johnletey Any update?
Can I pick this up? ✋
Is this still up for grabs?
Most helpful comment
@johnletey sorry man i couldn't finish, i need more training before contributing to open source..... please go ahead and take it.