Skip to content

Add Bluesky provider to FOSSE admin UI#34

Open
RCowles wants to merge 4 commits intotrunkfrom
add/bluesky-provider
Open

Add Bluesky provider to FOSSE admin UI#34
RCowles wants to merge 4 commits intotrunkfrom
add/bluesky-provider

Conversation

@RCowles
Copy link
Copy Markdown
Contributor

@RCowles RCowles commented Apr 25, 2026

Summary

Adds the FOSSE-side Bluesky_Provider that plugs Bluesky connection management into the existing provider-based Setup and Status pages introduced in #27.

  • FOSSE-owned Bluesky provider — registers through the existing Connection_Provider architecture and renders its own Setup section + Status card
  • Setup page connect/disconnect flow — disconnected state shows a handle form and Connect action; connected state shows handle, DID, PDS, auto-publish, token health, and Disconnect action
  • FOSSE-owned OAuth wrapper flowadmin_post handlers for connect/disconnect plus callback handling on the FOSSE Setup page
  • Local OAuth redirect override — uses Atmosphere’s atmosphere_oauth_redirect_uri filter so FOSSE-initiated auth returns to admin.php?page=fosse during both authorize and callback/token exchange, without changing Atmosphere’s own settings page behavior
  • FOSSE-owned disconnect nonce — disconnect is now fully namespaced to the FOSSE action rather than depending on Atmosphere’s admin nonce name
  • SDD plan status update — adds ## Progress and per-task status markers to sdd/onboarding-setup-ux/plan.md

Test coverage

  • PHPUnit — covers provider registration, status derivation, connected/disconnected rendering, connect/disconnect handler behavior, callback no-op behavior, and redirect URI handling
  • Playwright — covers disconnected and mocked-connected Bluesky UI states in Playground
  • Test helper — adds a test-only REST helper to seed atmosphere_connection in Playground so E2E can exercise the connected state deterministically

What's not in this PR

  • Real OAuth E2E coverage — the Playwright test does not perform a live Bluesky OAuth round-trip; it seeds connection state via a test-only helper
  • Wizard integration — the onboarding wizard remains in Add first-run onboarding wizard #33
  • Full SDD doc sync — this updates plan.md status tracking only, not the rest of the onboarding SDD docs

Test plan

  • composer run-script test-php passes
  • composer run-script lint-php passes
  • pnpm run format:check passes
  • pnpm run lint passes
  • pnpm exec playwright test tests/e2e/bluesky-provider.spec.ts passes
  • Manual: open wp-admin/admin.php?page=fosse with no Atmosphere connection and confirm Bluesky shows the disconnected state
  • Manual: complete a real Bluesky connect flow and confirm the callback returns to admin.php?page=fosse
  • Manual: after connect, confirm handle / DID / PDS / auto-publish render correctly on Setup and Status pages
  • Manual: disconnect Bluesky and confirm the connection is cleared and the success notice renders on the FOSSE Setup page

Copilot AI review requested due to automatic review settings April 25, 2026 18:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a FOSSE-owned Bluesky provider that wraps the bundled Atmosphere plugin so Bluesky connection status and connect/disconnect flows live in FOSSE’s existing provider-based Setup and Status admin pages.

Changes:

  • Introduce Bluesky_Provider implementing the Connection_Provider interface, including OAuth connect/disconnect + callback handling.
  • Add PHPUnit + Playwright coverage for disconnected/connected UI states, plus an E2E REST helper to deterministically seed Atmosphere connection state.
  • Update the onboarding SDD plan with a progress checklist and per-task status markers.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
fosse.php Boots the new provider alongside existing providers.
src/Admin/class-bluesky-provider.php Implements Bluesky provider UI, status derivation, and OAuth connect/disconnect/callback handlers.
tests/php/Admin/Bluesky_ProviderTest.php PHPUnit coverage for registration, status, rendering, redirect override, and handler behavior.
tests/e2e/mu-plugins/fosse-bsky-capture.php Adds a test-only REST endpoint to seed/clear Atmosphere connection state for E2E runs.
tests/e2e/bluesky-provider.spec.ts Playwright spec validating Setup/Status UI in disconnected and mocked-connected states.
sdd/onboarding-setup-ux/plan.md Adds progress/status tracking metadata for the onboarding SDD plan.

- **Depends on**: Task 6

### Task 8: Write tests
- **Status**: In progress
Comment on lines +21 to 22
- **Status**: ✅ Done
- **Files**: `src/Admin/Connection_Provider.php`, `src/Admin/Connection_Provider_Registry.php`
Comment on lines +252 to +257
$handle = sanitize_text_field( wp_unslash( $_POST['bluesky_handle'] ?? '' ) );

if ( empty( $handle ) ) {
$this->redirect_with_notice( __( 'Enter a Bluesky handle to continue.', 'fosse' ), 'error' );
return; // redirect_with_notice exits, but guard against future changes.
}
Comment on lines +62 to +64
public function is_available(): bool {
return class_exists( '\Atmosphere\Atmosphere' );
}
Comment on lines +153 to +158
<?php if ( $status['token_error'] ) : ?>
<tr>
<th scope="row"><?php esc_html_e( 'Token Health', 'fosse' ); ?></th>
<td><?php echo esc_html( $status['token_error'] ); ?></td>
</tr>
<?php endif; ?>
- **Depends on**: none

### Task 5: Create Bluesky_Provider
- **Status**: In progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants