Page MenuHomePhabricator

Add share widgets to live blog posts
AbandonedPublic

Authored by chad on Dec 22 2016, 10:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 4, 4:27 PM
Unknown Object (File)
Tue, Mar 26, 7:36 PM
Unknown Object (File)
Tue, Mar 26, 7:36 PM
Unknown Object (File)
Mar 6 2024, 6:07 AM
Unknown Object (File)
Dec 27 2023, 12:06 AM
Unknown Object (File)
Dec 26 2023, 7:38 PM
Unknown Object (File)
Dec 26 2023, 3:10 PM
Unknown Object (File)
Dec 23 2023, 8:30 PM
Subscribers

Details

Reviewers
epriestley
Summary

Basic share buttons for Phame, adds Twitter and Facebook.

Test Plan

Click on each and post to my FB/Twitter.

Diff Detail

Repository
rP Phabricator
Branch
social-sharing (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15025
Build 19710: Run Core Tests
Build 19709: arc lint + arc unit

Event Timeline

epriestley edited edge metadata.

Technical stuff:

  • The links should use https, not http.
  • The parameters need to be URL-encoded. To reproduce the issue this causes:
    • Create a post named My Favorite Symbols & Punctuation #blessed.
    • Try to share it on Twitter.
    • I believe the title and URL will be mangled in the share.
    • To fix this, use urisprintf() or PhutilURI to build the URI so that parameters are encoded properly.
  • These links do not work if the blog does not have a domain. To reproduce the issue this causes:
    • View a post on a blog which has no "Full Domain URI".
    • The share links generate with a relative URI, like /phame/path/to/thing/.
      • Twitter prompts the user to tweet just the blog title.
      • Facebook shows a completely blank page (with some error information in the URL?), and I think the window tries to close itself immediately.

Product/UX stuff:

  • Both of these UIs feel pretty weird to me when accessed as standalone pages and have tons and tons of whitespace -- are they meant to be opened in popup windows? Why not make them popups?
    • The Twitter completion state is a little weird -- there's no way to go back that I can see -- but at least you can continue to the tweet.
    • The Facebook completion state is a blank page for me. I think the window is trying to close itself, but I'm just completely dead-ended. As a user, I think this would feel like a bug. Did you see something else when you tested this?
  • This will put social sharing links on private posts. At best, these links won't work. At worst, they might imply to users that it's OK to share internal information on Twitter, and leak the post title ("We're Being Acquired...") in the tweet. I think we should populate social sharing options ONLY if the post is "Public".
  • These links are active on live previews of posts (that is: view a draft post, then select "Preview"). They should not be, since the links won't work. Ideally, they should tell the user why ("This post is still a draft. You can not share it on Twitter until you publish it.").
  • These links aren't visible on the non-live versions of posts, but I think they could be -- just have it share the live version? Maybe it's confusing to have "Share" share a slightly different URL than the page you're on, but having the buttons appear sometimes and not other times might be more confusing. My gut feeling is that it would be clearer to show "Share" always, and then add an interstitial prompt ("You're in edit mode, do you want to share the live version of this post? [ Cancel ] [ Share Live Version ]") if that turns out to be confusing.
  • The Twitter version doesn't seem to scrape, at least for me? So we're prompting users to tweet just the post title, which may not make any sense without more context. For example, if I tweet "Revamping the Lightbox <link>" as an individual user, it doesn't make any sense. I'm not sure what the best way to address this is, but maybe pre-filling with something like "Blog Title · Post Title" would be better? Then you'd at least get "Phacility Blog · Revamping the Lightbox" and the default text would make a little more sense. It's also possible that essentially everyone edits this text; if so, maybe it would actually be better not to send any text at all.

Planning stuff:

The value/motivation for this isn't immediately clear to me. I don't recall users ever asking for it and I don't see any context in the revision summary, so I assume we're mostly just building it for us. Is that right? What are you hoping/expecting to get out of it?

I don't really like that this might essentially be a Phacility-only feature in disguise (unless I'm missing some context), and hard-codes Twitter and Facebook in a way that can not be configured or extended. At least some of our users might not want these links (perhaps they compete with these companies, or have philosophical objections because they believe Facebook sells user data to aliens or whatever else). If we think this is worth building, I'd prefer to see this built using the extension pattern (so users can extend these share widgets to include Tumblr, LinkedIn, etc) and support for turning these on/off (maybe at the Blog level?).

This revision now requires changes to proceed.Dec 23 2016, 5:34 PM

I've had a version of this in my local sandbox for about 9 months, I wanted to ship it last version. The expectation is these are only displayed on live && external sites (public) and nothing else. I can fix that up if I missed a test case. I can also make these per blog optional if that's a concern.

I plan on following up with open graph meta tags for additional sharing information. They were in the previous blog templates and Phacility site, but don't exist in CORGI.