Skip to content

Forum: add topic feed with sorting and reaction points - #936

Open
aXenDeveloper wants to merge 10 commits into
canaryfrom
claude/festive-mccarthy-dy8jjt
Open

aXenDeveloper wants to merge 10 commits into
canaryfrom
claude/festive-mccarthy-dy8jjt

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

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 Component (topic-feed.tsx): New feed view for topics with sorting controls (Hot, New, Active, Top) and pagination
  • Feed API Route (list-feed.route.ts): Backend endpoint that ranks topics by engagement, recency, activity, or time window
  • Feed Ranking Logic (feed.ts): Implements hot decay algorithm and various sorting strategies
  • Reaction Points Display (reaction-points.tsx): New component showing the sum of reaction points for topics and comments
  • Unified Comments Section: Migrated forum comments to use the shared ContentComments component from core, removing forum-specific comment implementations
  • Forum Home Layout: Updated forums page to display the topic feed instead of a simple list

Why?

  • Provides better content discovery through multiple sorting options (similar to Reddit's hot/new/top)
  • Shows engagement metrics (reaction points) to help readers identify popular content
  • Consolidates comment handling across blog and forum plugins using the shared Content Engine API
  • Improves UX with a modern card-based feed layout on the forum home and individual forum pages

Changes Summary

Removed:

  • thread.tsx - Forum-specific thread/comment page (replaced by shared ContentComments)
  • comment-composer.tsx - Forum-specific comment composer (replaced by shared implementation)
  • thread-data.ts - Forum-specific comment thread data fetching
  • post-comments.tsx in blog - Replaced with shared ContentComments component

Added:

  • topic-feed.tsx - Feed component with sort navigation and pagination
  • list-feed.route.ts - API endpoint for ranked topic feeds
  • feed.ts - Feed ranking and sorting logic
  • reaction-points.tsx - Component displaying reaction point totals
  • topic-comments.tsx - Forum comment thread configuration using shared API
  • topic-feed.tsx in forum pages - Feed display for forum home and forum pages
  • feed-sorts.ts - Feed sorting type definitions and constants

Modified:

  • content-comments.tsx - Integrated reaction points display and improved skeleton styling
  • card-thread.tsx - Moved shared comment card logic from blog, added ContentCommentsDisplay interface
  • forums-page.tsx - Now displays topic feed instead of forum list
  • forum-page.tsx - Integrated topic feed for individual forums
  • forum-queries.ts - Added feed query options
  • forum-links.ts - Added feed URL helpers
  • Localization files - Added feed-related strings

Test 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.

@github-actions

Copy link
Copy Markdown

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:

Unknown release type "Forum" found in pull request title "Forum: add topic feed with sorting and reaction points".

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T21:06:53.977336Z 9a572ee New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

React Doctor found 2 new issues in 2 files · 2 warnings · score 69 / 100 (Needs work) · 5 fixed · vs canary

2 warnings

src/pages/topic-feed.tsx

  • ⚠️ L259 Heading has no content heading-has-content

src/tanstack/comments/card-thread.tsx

  • ⚠️ L614 React function has high control-flow complexity no-high-complexity-react-function

Reviewed by React Doctor for commit 9a572ee. See inline comments for fixes.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment on lines +148 to +149
.orderBy(...order, desc(topics.id))
.limit(FORUM_FEED_MAX_RANKED);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +178 to +181

return (
<ContentComments
anchorKey={comment => comment.slug}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@aXenDeveloper
aXenDeveloper force-pushed the claude/festive-mccarthy-dy8jjt branch from 1370a53 to b16a82b Compare November 29, 2026 14:23
…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
…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
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
@aXenDeveloper
aXenDeveloper force-pushed the claude/festive-mccarthy-dy8jjt branch from b16a82b to 9a572ee Compare November 30, 2026 21:04
<EmptyMedia variant="icon">
<MessagesSquareIcon aria-hidden="true" />
</EmptyMedia>
<EmptyTitle render={<h3 />}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Docs

This branch has not been deployed

No deployments
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.

2 participants