Skip to content

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

Closed
payown wants to merge 6 commits into
feat/issue-9-source-accountfrom
feat/issue-10-account-feed
Closed

feat: brand account feed shortcode + block (closes #10)#39
payown wants to merge 6 commits into
feat/issue-9-source-accountfrom
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. Implements #10 per docs/superpowers/specs/2026-06-15-source-account-design.md.

Stacked on #38 (#9) — base is feat/issue-9-source-account so this PR's diff shows only #10's changes. After #9 merges I'll retarget/rebase this to main.

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 and reused markup pass. It raised a "critical" on the esc_html→wpautop→wp_kses_post chain in the shared helper; I verified it's a false positive (plain-text input renders correctly; removing esc_html would strip <word> content) and it's pre-existing code moved verbatim, so out of scope here.

Tests

22/22 unit tests pass (added get_account_posts fallbacks + account-feed block render callback).

Manual verification

  • Set a brand account in Settings; add [outpost_account_feed] to a page → shows that account's original posts (no replies/boosts).
  • Add the Mastodon Account Feed block → live preview renders.
  • Clear the brand account → the feed renders nothing.

Closes #10

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 16, 2026 14:24
@payown payown deleted the branch feat/issue-9-source-account June 16, 2026 14:27
@payown payown closed this Jun 16, 2026

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 a “brand account” feed surface to Outpost by introducing an account-status fetch path in the feed fetcher and exposing it via a new [outpost_account_feed] shortcode and a server-rendered outpost/account-feed block.

Changes:

  • Implement OUTPOST_Feed_Fetcher::get_account_posts() with account-id lookup, caching, and stale-cache fallback; warm it via the hourly refresh cron.
  • Extract shared post-list markup into OUTPOST_Shortcodes::render_posts_list() and reuse it for both hashtag and account feeds.
  • Add the outpost/account-feed block (editor UI + render callback), new shortcode wiring, tests, and README documentation.

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
tests/Unit/AccountPostsTest.php Adds unit coverage for get_account_posts() empty-return fallbacks.
tests/Unit/AccountFeedBlockTest.php Verifies the new block render callback builds the correct shortcode.
README.md Documents how to display the new account feed via block/shortcode.
includes/class-outpost-shortcodes.php Registers [outpost_account_feed], adds render_account_feed(), and extracts shared render_posts_list().
includes/class-outpost-feed-fetcher.php Adds account feed fetch + account-id resolution + shared JSON request helper; warms cache on cron.
includes/class-outpost-blocks.php Registers outpost/account-feed and adds its server-side render callback.
blocks/account-feed/editor.js Implements the block editor UI + server-side preview for account feed.
blocks/account-feed/editor.asset.php Declares editor script dependencies/version for the new block (no build step).
blocks/account-feed/block.json Defines the new outpost/account-feed block metadata + attributes.

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

return [];
}

$cache_key = 'outpost_account_feed';
Comment on lines +167 to +170
$response = wp_remote_get( $url, [
'timeout' => 15,
'user-agent' => 'MastodonHashtagDigest/' . OUTPOST_VERSION . ' WordPress/' . get_bloginfo( 'version' ),
] );
Comment on lines +89 to +92
$handle = OUTPOST_Settings::get_brand_account();
if ( '' === $handle ) {
return '';
}
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