Add per-app AP social UI for blog, market, and events
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m27s

Lightweight social pages (search, follow/unfollow, followers, following,
actor timeline) auto-registered for AP-enabled apps via shared blueprint.
Federation keeps the full social hub. Followers scoped per app_domain;
post cards show "View on Hub" link instead of interaction buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-25 08:45:59 +00:00
parent 8680ec37d6
commit 99ab363cfd
15 changed files with 646 additions and 4 deletions

View File

@@ -403,6 +403,7 @@ class SqlFederationService:
async def get_followers_paginated(
self, session: AsyncSession, username: str,
page: int = 1, per_page: int = 20,
app_domain: str | None = None,
) -> tuple[list[RemoteActorDTO], int]:
actor = (
await session.execute(
@@ -412,11 +413,13 @@ class SqlFederationService:
if actor is None:
return [], 0
filters = [APFollower.actor_profile_id == actor.id]
if app_domain is not None:
filters.append(APFollower.app_domain == app_domain)
total = (
await session.execute(
select(func.count(APFollower.id)).where(
APFollower.actor_profile_id == actor.id,
)
select(func.count(APFollower.id)).where(*filters)
)
).scalar() or 0
@@ -424,7 +427,7 @@ class SqlFederationService:
followers = (
await session.execute(
select(APFollower)
.where(APFollower.actor_profile_id == actor.id)
.where(*filters)
.order_by(APFollower.created_at.desc())
.limit(per_page)
.offset(offset)

View File

@@ -28,5 +28,15 @@ class StubFederationService:
async def count_activities_for_source(self, session, source_type, source_id, *, activity_type):
return 0
async def get_followers_paginated(self, session, username,
page=1, per_page=20, app_domain=None):
return [], 0
async def get_following(self, session, username, page=1, per_page=20):
return [], 0
async def search_actors(self, session, query, page=1, limit=20):
return [], 0
async def get_stats(self, session):
return {"actors": 0, "activities": 0, "followers": 0}