Skip to content

feat: brand account feed shortcode + block (closes #10)#40

Merged
payown merged 6 commits into
mainfrom
feat/issue-10-account-feed
Jun 16, 2026
Merged

feat: brand account feed shortcode + block (closes #10)#40
payown merged 6 commits into
mainfrom
feat/issue-10-account-feed

Conversation

@payown

@payown payown commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Phase 3, Part 2 of the source-account feature (#10). Rebased onto main after #9 (#38) merged; replaces auto-closed #39.

What

  • OUTPOST_Feed_Fetcher::get_account_posts() — resolves the brand account id and fetches original posts only (exclude_replies/exclude_reblogs), cached with stale-fallback; account id cached for a day.
  • Extracted the post-card markup into a shared render_posts_list() helper (no change to the hashtag feed output).
  • [outpost_account_feed limit="20"] shortcode and outpost/account-feed block (server-rendered via the shortcode).
  • Brand feed warmed on the hourly refresh cron.
  • README docs.

Accessibility

accessibility-lead reviewed the new feed (section/heading wiring + reused markup pass). Its one "critical" on the esc_html→wpautop→wp_kses_post chain was verified as a false positive (plain-text input renders correctly; removing esc_html would strip <word> content) and is pre-existing code moved verbatim — out of scope here.

Tests

22/22 unit tests pass.

Manual verification

  • Set a brand account in Settings; [outpost_account_feed] and the Mastodon Account Feed block show that account's original posts (no replies/boosts).
  • Clear the brand account → renders nothing.

Closes #10

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 16, 2026 15:03
@payown payown merged commit 0008cb0 into main Jun 16, 2026
@payown payown deleted the feat/issue-10-account-feed branch June 16, 2026 15:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds support for a site-wide “brand account” feed by fetching posts from a configured Mastodon account and exposing that feed via a new shortcode and a server-rendered Gutenberg block.

Changes:

  • Implement OUTPOST_Feed_Fetcher::get_account_posts() with account-id lookup, caching, and reply/boost exclusion.
  • Add [outpost_account_feed] shortcode plus outpost/account-feed block that renders via the shortcode.
  • Extract shared feed markup into render_posts_list() and document the new feature in the README.

Reviewed changes

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

Show a summary per file
File Description
includes/class-outpost-feed-fetcher.php Adds brand-account fetching, caching, and cron warm-up.
includes/class-outpost-shortcodes.php Registers the new shortcode and shares post-list rendering markup.
includes/class-outpost-blocks.php Registers the new account-feed block and render callback.
blocks/account-feed/editor.js Adds editor UI for the account-feed block (SSR preview + limit control).
blocks/account-feed/editor.asset.php Declares editor script dependencies/version (no build step).
blocks/account-feed/block.json Declares block metadata and the limit attribute.
tests/Unit/AccountPostsTest.php Adds unit tests for get_account_posts() early-return cases.
tests/Unit/AccountFeedBlockTest.php Adds unit tests for the account-feed block render callback.
README.md Documents configuring and displaying the account feed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return [];
}

$cache_key = 'outpost_account_feed';
Comment on lines +96 to +99
list( $username, $host ) = explode( '@', $handle, 2 );
if ( '' === $username || '' === $host ) {
return [];
}
Comment on lines +31 to +33
min: 1,
max: 50,
} )
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.

feat: display all posts from the configured source account

2 participants