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

Implement Offline Commenting #87

Closed
4 of 7 tasks
alcurrie opened this issue Oct 15, 2018 · 8 comments · Fixed by #92
Closed
4 of 7 tasks

Implement Offline Commenting #87

alcurrie opened this issue Oct 15, 2018 · 8 comments · Fixed by #92
Assignees
Labels
Milestone

Comments

@alcurrie
Copy link

alcurrie commented Oct 15, 2018

As as WordPress developer, I would like to be able to allow site visitors and admin users add comments to posts even when offline

  • AC 1: Build comment offline sync functionality into PWA plugin. When viewing a page or post with commenting enabled, a user will be able to make a comment and have that comment saved and posted once the user is back online

  • AC 2: The user interface for offline commenting will be easy to use and include appropriate messaging. By default the plugin should show an offline page where submitting a comment when offline, with a message like “you are offline, but we will post your comment will be posted when your device comes back online.” This should integrate with the offline template to show custom messages similar to how the 500 page can show custom messages. (See related issue in the twentyseventeen-weston repo, Issue 4 Optimize the design of the Offline/500 page to be more engaging for the user)

  • AC 3: A theme must be able to override the offline template and messaging for commenting failures.

  • AC 4: Site on Using our AMP and PWA plugins, enable this offline commenting support via a theme declaration.

  • AC 5: Intercept the amp-form action-xhr request (to submit the form) and when failed return a custom success message to be shown below the form

Offline Routing and messaging

  • AC 6: If AMP is enabled, The amp-live-list should continue to update in real time, showing the new comment when background sync happens or if the comment was submitted successfully right away. The error message should probably appear in the context of the posted comment.
  • AC 7: If AMP is not enabled, route the user to the site's offline page and allow a theme developer to serve the offline message from AC2/AC3. Make sure the the ability for service worker to populate content of the offline template is added.

For reference, here was the original PR from the AMP plugin:
ampproject/amp-wp#1028

@westonruter
Copy link
Collaborator

See changes to Workbox background sync in v4: GoogleChrome/workbox#1710

@postphotos
Copy link

Hi @westonruter @alcurrie - I've updated the ACs above based on our meeting today.

@alcurrie
Copy link
Author

@miina / @jwold - I added a link to the new - design of the Offline template story to this ticket as I think it makes sense to make sure that the design/functionality for the offline template work together with the user interface for the offline templating in AC-2 above.

@miina what's the status of that part of the functionality. Do you already have clarity on how that interface will work and link to the Offline template, or would it make sense to AC-2 be broken out to follow-up up on how that interface and user message would appear?

@miina
Copy link
Contributor

miina commented Oct 19, 2018

@alcurrie Thanks for adding the link. To add some background information for AC2: the AC2 in this ticket is for the PWA Plugin and will be part of what will be proposed to merge to WordPress Core. It will leverage the already existing Offline templating system and already existing default design and won't be influenced by the linked ticket for design of the Offline template story, however, the linked ticket will be based on what we're building within this ticket and is dependent on AC2.

On status of the functionality part: yes, it's clear how to implement the ticket, no need to break AC-2 to follow-up, thank you for asking. Most of it is already built previously. What we're adding now is the comments-specific messaging for the users and possibility to override it -- overriding will be done by developers only and won't have any user interface.

This is how the offline page template for comments is looking like by default -- within the child theme we're going to override this template to show a custom version of it:
screen shot 2018-10-19 at 1 26 29 pm

@alcurrie
Copy link
Author

@miina Thanks so much for clarifying and for providing the background and context. It's great to have the details, and the screen shot example. So based on that it sounds like this issue will affect the 'AC2' and the Offline template story not the other way around. I'll update that issue with these details. cc. @jwold

@alcurrie
Copy link
Author

@miina - I just wanted to flag that @westonruter 's note from #90 (comment) re using the offline page could also to list out the URLs that have been cached for offline access.

@alcurrie alcurrie reopened this Oct 24, 2018
@miina
Copy link
Contributor

miina commented Oct 24, 2018

@alcurrie Thanks for bringing that out. Probably we could add listing out URLs as an optional addition if we have time, not as a requirement.

Also, this seems to be more generally related to the offline page, not necessarily offline commenting. Or did you mean this specifically related to offline commenting, @westonruter?

@westonruter
Copy link
Collaborator

westonruter commented Oct 24, 2018

Right, my #90 (comment) is an optional addition, not a requirement. It's not directly related to offline commenting.

@westonruter westonruter added this to the 0.2 milestone Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants