Add a Bluesky column and a share action to the posts list - #248
Add a Bluesky column and a share action to the posts list#248pfefferle wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an admin-side recovery surface for posts that missed cross-posting to Bluesky (e.g., during a disconnect), by surfacing share status directly in list tables and providing a manual “Share to Bluesky” row action that re-queues the existing publish worker.
Changes:
- Introduces a new WP Admin
Post_Listcomponent that registers a “Bluesky” column, renders either an appview link / last failure message / em dash, and adds a nonced “Share to Bluesky” row action. - Refactors the REST-field publish-error shaping into
Atmosphere::get_publish_error()and makesAtmosphere::bsky_web_url_from_uri()public for reuse. - Adds PHPUnit coverage for list table rendering, capability gates, and the share handler/redirect behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
includes/wp-admin/class-post-list.php |
New WP Admin list-table integration (column rendering, row action, handler, notice). |
includes/class-atmosphere.php |
Wires list-table registration; extracts publish-error shaping helper; exposes appview URL builder. |
tests/phpunit/tests/wp-admin/class-test-post-list.php |
New test suite validating rendering states, per-post authorization, nonces, and scheduling/redirect behavior. |
.github/changelog/add-posts-list-bluesky-column |
Adds a minor “added” changelog entry describing the new UI surface. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jeherve
left a comment
There was a problem hiding this comment.
This is looking good, should be good to merge. I only have one minor, non-blocking comment, and a question below.
At first I was wondering if we should use "ATmosphere" all over that UI though, instead of "Bluesky". What do you think?
|
I went back and forth on that. I ended up with "Bluesky" on purpose: the column and the row action should name where the post goes, not which plugin sends it. Several plugins add a share action to that list, and "Share via ATmosphere" would leave the reader guessing at the destination. We also use "Bluesky" in all the other user facing text (the settings page, the editor panel, the reconnect notices), so this keeps it consistent. Happy to revisit if you feel strongly though. |
jeherve
left a comment
There was a problem hiding this comment.
should be good to me for now. 🚢
Fixes #247
Proposed changes:
Adds a "Bluesky" column to the posts list, and a "Share to Bluesky" row action next to it.
The reason is the two support reports linked from #247: the connection expires, a post gets published while the site is disconnected, and after reconnecting there is no way to push that one post. Sites on managed hosting have no WP-CLI, so the backfill command is not an option for them.
The column shows a link to the record when there is one, the failure reason when the last attempt failed, and an em dash otherwise. A site can carry years of posts from before the plugin was installed, and a column of "not shared" on all of them is noise.
The share action re-queues
atmosphere_publish_post, the worker that already runs on publish. It re-checks visibility, decides between a first publish and an update, logs failures and schedules retries, so there is no second publish path here.Two things I touched while in there:
Atmosphere::bsky_web_url_from_uri()was private and only fed the editor panel's REST field. It is public now so the column builds its links the same way, instead of a second builder.atmosphere_publish_errorREST closure body moved intoAtmosphere::get_publish_error(), so the editor panel and the column describe a failure identically, including the reconnect-class blanking.Both surfaces gate on
edit_postfor the specific post, not on a site-wide capability. The list table shows every author their colleagues' rows, so a column without that check would show a contributor the PDS failure text stored on someone else's post.The whole surface is gated on
is_auto_publish_enabled(), so it is absent rather than inert on a site that shares nothing, and it disappears in connection-only mode. The gate is also re-checked incan_share(), so a filter added later than the registration hook is still honoured.Other information:
28 tests. Worth calling out that the first round of tests passed while the authorization boundary was broken, so the capability tests now use two
author-role users and one another's posts, rather than administrator-versus-subscriber, which cannot tell a per-post check from a site-wide one.Testing instructions:
Connect a Bluesky account and make sure "Automatically share posts" is on.
The column
Sharing a post that did not make it
The gates
add_post_type_support( 'page', 'atmosphere' ), and the column and action show up on the Pages screen too, with the action redirecting back to Pages rather than Posts.