Repository navigation
Forum: add topic feed with sorting and reaction points - #936
aXenDeveloper wants to merge 10 commits into
Conversation
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
React Doctor found 2 new issues in 2 files · 2 warnings · score 69 / 100 (Needs work) · 5 fixed · vs 2 warnings
Reviewed by React Doctor for commit |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1370a53a18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .orderBy(...order, desc(topics.id)) | ||
| .limit(FORUM_FEED_MAX_RANKED); |
There was a problem hiding this comment.
Apply readable-forum filtering before the ranking limit
When restricted forums occupy the first 1,000 ranked positions, the home feed can be empty even though readable public topics exist. The query limits the shared ranking before list-feed.route.ts filters it through readableForumIds, so those public topics never become pagination candidates and the response reports no next page. Apply the limit after access filtering, or retain enough ranked candidates to fill the viewer's readable feed.
Useful? React with 👍 / 👎.
|
|
||
| return ( | ||
| <ContentComments | ||
| anchorKey={comment => comment.slug} |
There was a problem hiding this comment.
Restore the guest sign-in prompt beneath topic comments
For signed-out readers, replacing the forum thread with ContentComments removes the comment section's sign-in prompt and return-to-topic link. ContentCommentsComposer returns null once the session resolves with canComment === false, and the shared comment cards also suppress reply controls for guests. The previous forum thread explicitly rendered a guest message and sign-in link, so this migration leaves visitors without the contextual path to join the discussion. Preserve that prompt in the forum wrapper or add guest handling to the shared section.
Useful? React with 👍 / 👎.
1370a53 to
b16a82b
Compare
…sorting - `/forum` is now a feed of topics from every readable forum, with the forum tree in a sidebar (forum chips on phones) - Forum pages use the same sortable feed instead of newest-first cursor pages - New `GET /forum/feed` route: ranks by reactions (negative-point reactions count down), comments and age; shared one-minute ranking cache, filtered per viewer's forum access - Topic cards show forum, author, age, excerpt, points and comments - Document sorting in the forum guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
…ment sorting
- Points are each reaction's count times its points from AdminCP → Reactions
(enabled reactions), the same sum the reaction pills show; the feed ranks
by them (Hot still adds comments)
- Feed cards get the reaction bar and a live points badge; the topic page and
every comment show the badge too
- Comments sort by Oldest (default), Newest or Most points; only top-level
comments move, replies stay under their parent
- New `GET /forum/topics/{id}/comments/order` route; branches are read through
the Content Engine's `/thread/branches`
- Document points and comment sorting in the forum guide
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
- `ContentComments` now draws the blog's design for every plugin: a card per conversation, replies inside it in writing order naming whom they answer, Quote, Share, an Author badge, a hidden-comment gate, sorting by Oldest, Newest or Most points and folding of long threads - New `history` option on `useContentComments`: an "edited" link opens the edit history and the before/after of each edit - New display options: `authorIds`, `shareTitle`, `points` - `ReactionPoints` and `reactionPoints` move to `@vitnode/core/tanstack/reactions` - Blog drops its own thread, Newsroom gets the new look, and forum topics use the shared section (live updates and edit history included); the forum's own thread, composer and comment-order route are gone - Docs: Comments API, Replies, Blog and Forum guides Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
…ary) Throwaway prototype at /proto/forum-home (?v=1-5): Baseline (current page), Board, Compact, Editorial and Channels, on real forum data. Nothing in production imports it. To be deleted, with its route, once a variant is picked and promoted into the forum plugin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
…y, Focus (temporary) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
…oft (temporary) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
…emporary) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
Every topic in the feed is its own card - forum icon, meta line, title, excerpt and a footer with points, reactions and comments - on /forum and every forum page. The /forum sidebar sticks and opens with the description, totals and the New topic button. The forum home prototype is removed; the decision and rejected directions are in plans/forum-home-layout.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFY7Jx5zhRmwMYfnFKU
b16a82b to
9a572ee
Compare
| <EmptyMedia variant="icon"> | ||
| <MessagesSquareIcon aria-hidden="true" /> | ||
| </EmptyMedia> | ||
| <EmptyTitle render={<h3 />}> |
There was a problem hiding this comment.
React Doctor · react-doctor/heading-has-content (warning)
Blind users can't use this heading to navigate because screen readers skip it empty, so add text, aria-label, or aria-labelledby.
Fix → Put readable text in every heading.
Description
What?
This PR adds a topic feed to the forum plugin with multiple sorting options and displays reaction points on topics and comments. Key changes include:
topic-feed.tsx): New feed view for topics with sorting controls (Hot, New, Active, Top) and paginationlist-feed.route.ts): Backend endpoint that ranks topics by engagement, recency, activity, or time windowfeed.ts): Implements hot decay algorithm and various sorting strategiesreaction-points.tsx): New component showing the sum of reaction points for topics and commentsContentCommentscomponent from core, removing forum-specific comment implementationsWhy?
Changes Summary
Removed:
thread.tsx- Forum-specific thread/comment page (replaced by sharedContentComments)comment-composer.tsx- Forum-specific comment composer (replaced by shared implementation)thread-data.ts- Forum-specific comment thread data fetchingpost-comments.tsxin blog - Replaced with sharedContentCommentscomponentAdded:
topic-feed.tsx- Feed component with sort navigation and paginationlist-feed.route.ts- API endpoint for ranked topic feedsfeed.ts- Feed ranking and sorting logicreaction-points.tsx- Component displaying reaction point totalstopic-comments.tsx- Forum comment thread configuration using shared APItopic-feed.tsxin forum pages - Feed display for forum home and forum pagesfeed-sorts.ts- Feed sorting type definitions and constantsModified:
content-comments.tsx- Integrated reaction points display and improved skeleton stylingcard-thread.tsx- Moved shared comment card logic from blog, addedContentCommentsDisplayinterfaceforums-page.tsx- Now displays topic feed instead of forum listforum-page.tsx- Integrated topic feed for individual forumsforum-queries.ts- Added feed query optionsforum-links.ts- Added feed URL helpersTest Plan
Existing tests pass. The feed ranking logic and API endpoint are covered by new unit tests in a separate session as noted in the implementation plan.