Add profile navigation from feed cards and thread detail - #66
Merged
Conversation
- Add author?: { id, username } to BasePostFeedItem in shared types
- Bulk-fetch usernames in enrichOrganicItemsWithAuthors after scoring; omit field when unresolvable
- Extend organicPostBaseSchema and postResponseSchema with required author sub-object
- Enrich GET /api/v1/posts/:postId response with author via maybeSingle users lookup
- Stop ExploreToggleButton and ReportModal clicks propagating to card navigation - Wrap feed card avatar in profile Link with stopPropagation when username available - Link thread detail author handle and avatar to /profile/[username] when enriched - Add 11 new tests covering propagation, avatar linking, and thread header profile link
- Reconcile follows in GET /me from user_follows when user_signal_counts is stale (best-effort, non-fatal) - Detect and patch follows shortfall in incrementSignalCounts when RPC succeeds but silently skips p_follows - Add recordBehaviorEvents mock and follow-route behavior event tests to users.test.ts - Add ingest.test.ts coverage for follow shortfall detection path - Remove spurious Content-Type header from followUser fetch (no request body)
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.
TRB-049: Feed Profile Navigation
Clicking an author avatar or handle anywhere in the feed now navigates to
/profile/[username]. This required enriching the feed and post API responses with author username data.Changes
API
enrichOrganicItemsWithAuthors()added to feed generation — bulk-fetches usernames in a single round-trip and attachesauthor: { id, username }to each feed itemGET /api/v1/feed) and thread detail (GET /api/v1/posts/:id) now includeauthor.usernamein the responsepackages/sharedfeed types extended with optionalauthorfieldWeb
FeedPostavatar and handle are wrapped in a conditional<Link href="/profile/[username]">withstopPropagationto prevent card-level click conflictsFeedPostDetailPage(thread detail) author header similarly linkedExploreToggleButtonandReportModaldestructuring cleaned up to prevent line-length lint failuresBug fixes
followUserinapps/web/src/lib/api/users.tswas sendingContent-Type: application/jsonwith no body, causing Fastify to return400 FST_ERR_CTP_EMPTY_JSON_BODY. Removed the redundant header.GET /menow reconcilesfollowsfromuser_followswhenuser_signal_countsis stale;incrementSignalCountsdetects and patches a silent RPC shortfall forp_follows.Test coverage
recordBehaviorEventsmock + 3 follow-route behavior event assertions added tousers.test.tsingest.test.tsextended with follow-shortfall detection coverage