feat: brand account feed shortcode + block (closes #10)#39
Closed
payown wants to merge 6 commits into
Closed
Conversation
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
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-feedblock (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 ''; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-accountso this PR's diff shows only #10's changes. After #9 merges I'll retarget/rebase this tomain.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.render_posts_list()helper (no change to the hashtag feed output).[outpost_account_feed limit="20"]shortcode andoutpost/account-feedblock (server-rendered via the shortcode).Accessibility
accessibility-leadreviewed the new feed: section/heading wiring and reused markup pass. It raised a "critical" on theesc_html→wpautop→wp_kses_postchain 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_postsfallbacks + account-feed block render callback).Manual verification
[outpost_account_feed]to a page → shows that account's original posts (no replies/boosts).Closes #10
🤖 Generated with Claude Code