Automattic / Automattic/jetpack
Sharing / likes / Related Posts: add them via block hooks
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
Now that likes & sharing functionalities are blocks, the next step would be figuring out how to make the experience "turn-key" and _magical_.
We've also introduced the first steps to "turn-key" the site into a subscription site and inject subscription blocks to templates automatically (See p1HpG7-rwo-p2):
We shouldn't require customers to add blocks manually to templates in the site editor. Instead, there should be a single switch that does everything for you, with excellent presets, just like with classic themes. Customers' WP and theme should also not affect the turn-key experience; the main toggle needs to be available consistently regardless of their theme (classic or block) or version of WP (with the latest block hook APIs or not).
We need to ensure these features are easily discovered and understood; consider using visuals instead of excessive copy like the above screenshot from production.
With classic themes, customers would need to change the appearance of blocks outside the block editor; with the block editor, we should link them to templates in the right places, where they can change the order of blocks and make changes to them:
WordPress and Jetpack can feel complicated, but we must make it easy and turn-key. Meanwhile, we shouldn't lose the power of allowing customizing _everything_ or having excellent support for all the 12K WP themes.
While each feature should feel great individually, they also all need to be tied together and work well:
- Turning the site into a subscription site
- Adding sharing & likes blocks
- Adding related posts block
- Enabling likes in comments
- Enabling subscribing via comments
- Enabling Jetpack commenting instead of WP core commenting
- Cookie banner block can also be injected with block hooks API
```[tasklist]
### Work at a high level for sharing & likes blocks:
- [ ] Allow inserting _sharing_ block with block hook (after posts, in archives, in blog post lists)
- [ ] Allow inserting _like_ block with block hook (after posts, in archives, in blog post lists)
- [ ] Add great defaults to the sharing block instead of leaving it empty in insertion, allowing editing in the block editor.
- [ ] Turn key toggles in Jetpack settings to add sharing and likes blocks to the site
- [ ] Ensure sharing, subscription, and likes blocks look cohesive together; position and spacing within the post together, button sizes, alignment, and customization features within blocks, dark mode for dark themes, etc.
- [ ] Explore migrating sites in block themes from older implementations to the block hooks implementation
- [ ] Explore aligning Likes showing for the blog across the blog, mobile apps, and the web Reader.
- [ ] Consolidate everything across Jetpack, WP.com and Jetpack Cloud; WP.com shouldn't have their custom settings pages but instead rely on Jetpack UX 100%.
- [ ] https://github.com/Automattic/jetpack/issues/39358
```
************
```[tasklist]
### Other related work:
- [ ] Support dark mode in sharing, likes and comments
- [ ] Allow inserting related posts block via block hooks
- [ ] Consolidate like & commenting settings together
- [ ] Allow inserting cookie banner via block hooks
```
***********
Internal discussion: p58i-ijO-p2
Contributor guide
Research direction
No source files, tests, or entry points are named. Start by reviewing the existing block-hook implementation and the related work in issue 39358, then trace how Jetpack settings inject subscription and other blocks. Done would require a scoped design and coordinated implementation for the listed features, with cohesive behavior across classic and block themes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php, react, wordpress
- Domain
- backend, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100