Skip to content

feat: source account config + per-hashtag filter (closes #9)#38

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

feat: source account config + per-hashtag filter (closes #9)#38
payown merged 6 commits into
mainfrom
feat/issue-9-source-account

Conversation

@payown

@payown payown commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Phase 3, Part 1 of the source-account feature. Implements #9 per docs/superpowers/specs/2026-06-15-source-account-design.md.

What

  • DB: account_filter column on outpost_hashtags; OUTPOST_Activator::maybe_upgrade() runs dbDelta for existing installs and bumps outpost_db_version to 1.1.0.
  • OUTPOST_Hashtag_Manager::normalize_handle() and post_matches_filter() (unit-tested).
  • Per-hashtag filtering applied in OUTPOST_Feed_Fetcher::get_posts() (so feed and digest both respect it); blank filter = current behavior.
  • Global outpost_brand_account option + OUTPOST_Settings::get_brand_account(), saved normalized, removed on uninstall.
  • Admin fields: account filter on hashtag add/edit; brand account in Settings. accessibility-lead reviewed (ship, no required fixes).

Tests

18/18 unit tests pass (handle normalization + filter match rule added).

Manual verification

  • Activate on an existing install → account_filter column added, outpost_db_version = 1.1.0, no fatals.
  • Set an account filter on a hashtag → its feed and digest show only that account; blank shows all.
  • Save a brand account in Settings → persists normalized (lowercased, leading @ stripped).

Closes #9

🤖 Generated with Claude Code

Michael Babcock and others added 6 commits June 16, 2026 06:27
accessibility-lead reviewed the new form fields: ship, no required fixes
(label/id associations, scope=row, heading structure all consistent).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI review requested due to automatic review settings June 16, 2026 13:59

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

Implements Phase 3 (Part 1) of the “source account” feature by adding per-hashtag account filtering, a global “brand account” setting, and an on-load DB schema upgrade path so existing installs gain the new account_filter column.

Changes:

  • Add account_filter storage + normalization/matching helpers, and apply the filter when building hashtag feeds/digests.
  • Add global outpost_brand_account option (admin UI + settings save + uninstall cleanup).
  • Introduce OUTPOST_Activator::maybe_upgrade() and bump outpost_db_version to 1.1.0 to run dbDelta() upgrades on already-installed sites.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uninstall.php Deletes the new outpost_brand_account option on uninstall.
tests/Unit/HandleNormalizationTest.php Adds unit coverage for handle normalization behavior.
tests/Unit/AccountFilterMatchTest.php Adds unit coverage for account-filter matching rules.
outpost.php Runs schema upgrade checks on plugins_loaded.
includes/class-outpost-settings.php Adds getter + save-path for outpost_brand_account (normalized on save).
includes/class-outpost-hashtag-manager.php Adds account_filter persistence; introduces normalize_handle() + post_matches_filter().
includes/class-outpost-feed-fetcher.php Applies per-hashtag account filtering to fetched/cached posts before slicing.
includes/class-outpost-activator.php Adds account_filter column to schema; bumps DB version; adds maybe_upgrade().
admin/views/settings.php Adds “Brand account” settings field.
admin/views/hashtags.php Adds per-hashtag “Account filter” add/edit fields.
admin/class-outpost-admin.php Wires new form fields into OUTPOST_Hashtag_Manager::add/update() and settings save.

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

Comment on lines +198 to +203
/**
* Normalize a Mastodon account handle: trim, strip one leading @, lowercase.
*
* @param string $handle
* @return string
*/
@payown payown merged commit 9546705 into main Jun 16, 2026
1 check passed
@payown payown deleted the feat/issue-9-source-account branch June 16, 2026 14:27
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: allow site admin to configure a source Mastodon account

2 participants