Skip to content

Retire the topic pages and the topic browser - #1174

Merged
yattias merged 5 commits into
mainfrom
retire/6-topic-pages
Oct 12, 2026
Merged

yattias merged 5 commits into
mainfrom
retire/6-topic-pages

Conversation

@yattias

@yattias yattias commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Sixth chunk of the dead-code removal plan (docs/dead-code-report.md, kept local), following #1171, and the first page retirement: hub/topic pages are no longer part of the product.

Redirects

/topic/:path* and /browse now redirect permanently to the homepage. The old /journal/:slug redirect pointed at /topic/:slug, so it goes straight to / as well. Verified on the dev server: all four forms answer 308 with Location: /.

What goes

  • app/topic/** and app/browse/**, with everything only they reached: TopicFeed and its sort/filter bar, TopicList, ManageTopics, the topic list skeleton, TopicSearch, ButtonGroup, useHub, the topic emoji table, the topic-following UI (FollowTopicButton, FollowContext and its provider in ClientProviders, follow.service, types/follow), HubService's followHub / unfollowHub / getHubBySlug / getPrimaryHubs (only suggestTopics has callers left, in the moderator editor form and the hub selector), the topic-page title rule and the browse rule in the top bar, getBrowsePageMetadata, buildTopicUrl, and the topic sitemap chunk (the remaining chunks are renumbered 0–3).
  • Search never requested the hub index outside TopicSearch, so the TopicSuggestion type, its transformer case and the hub branches in both search handlers were unreachable and go too.

Topic badges are gone, not plain text (third commit)

After review the call was to drop topics entirely rather than keep them as inert text. FeedItemTopicBadges is replaced by FeedItemJournalBadge, which only shows the journal hashtag on paper cards (the one badge that was never a topic; the ResearchHub Journal keeps its /journal link). Post and bounty cards had nothing but topics in that row, so it goes. The work page's Topics section, the related-work card's topic row, the skeleton row that mirrored the badges and the excluded-topic-slugs constant are deleted. With no topic badge left to click, the topic click plumbing goes too: the onTopicClick props, the peer-review page's topic filter event in useBounties, and ClickContext itself, whose only consumer that was. useFeedSource and the analytics FeedSource type no longer know a 'topic' source.

Second commit: SonarCloud's duplication gate

The gate measures duplicated lines among the lines a change adds. Two more redirect object literals in next.config.js read as a copy of the existing list, and the journal badge's two <Image> blocks, re-indented into the new badge constant, read as copies of each other. The redirects are now one generated entry (...['/topic/:path*', '/browse'].map(...)), the badge picks its image source once (logo || journal.imageUrl, the same precedence as before), and HashtagBadge shares its styling between the link and the plain span. Redirects re-verified on the dev server after a restart.

Checks

  • npm run lint: 0 errors (2 pre-existing warnings in untouched files)
  • npm run type-check: clean
  • knip run twice: no unused files, no new unused exports or dependencies
  • Dev server on the branch: all main routes return 200, /browse lands on /, no /topic link or hashtag row remains on the home feed, the RFP feed, a proposal page or a registered report, and the report's journal badge still links to /journal.

Next

Chunk 7 (retire/7-paper-pages) follows once this is merged. It needs the call on whether the backend or the frontend drops paper entries from feeds and search first.

🤖 Generated with Claude Code

Sixth chunk of the dead-code plan and the first page retirement: hub/topic
pages are no longer part of the product.

- /topic/:path* and /browse redirect permanently to the homepage, and the
  old /journal/:slug redirect, which pointed at /topic/:slug, now goes
  straight to / as well.
- app/topic and app/browse go, with everything only they reached:
  TopicFeed and its sort/filter bar, TopicList, ManageTopics, the topic list
  skeleton, TopicSearch, ButtonGroup, useHub, the topic emoji table, the
  topic-following UI (FollowTopicButton, FollowContext and its provider,
  follow.service, types/follow), HubService's follow/unfollow/getHubBySlug/
  getPrimaryHubs methods, the topic-page title rule and the browse rule in
  the top bar, the browse page metadata, buildTopicUrl, and the topic
  sitemap chunk (the remaining chunks are renumbered).
- Topic badges stay visible but stop linking anywhere: HashtagBadge renders
  a plain span when it has no href, and FeedItemTopicBadges, the work page's
  Topics section and RelatedWorkCard no longer pass one. The journal badge
  keeps its link only for the ResearchHub Journal (/journal); other
  journals and preprint servers show as plain badges too.
- Search never requested the hub index outside TopicSearch, so the hub
  suggestion type, its transformer case and the hub branches in the search
  handlers were unreachable and go with it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@yattias
yattias requested a review from a team as a code owner October 11, 2026 21:39
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
web Ready Ready Preview Oct 12, 2026 12:25am UTC

Request Review

The quality gate measures duplicated lines among the lines a change adds.
Two more redirect object literals in next.config.js read as a copy of the
existing list, and the journal badge's two <Image> blocks, re-indented into
the new `badge` constant, read as copies of each other. The redirects are
now one generated entry, the badge picks its image source once, and
HashtagBadge shares its styling between the link and the plain span.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Topics are off the product, so the hashtag rows stop rendering rather than
lingering as inert text:

- FeedItemTopicBadges is replaced by FeedItemJournalBadge, which only shows
  the journal hashtag on paper cards (the one badge that was never a topic);
  post and bounty cards had nothing but topics in that row, so it goes.
- The work page's Topics section, the related-work card's topic row, the
  skeleton row that mirrored the badges, and the excluded-topic-slugs
  constant are deleted.
- With no topic badge to click, the topic click plumbing goes too: the
  onTopicClick props, the peer-review page's topic filter event in
  useBounties, and ClickContext itself, whose only consumer that was.
- useFeedSource and the analytics FeedSource type no longer know a 'topic'
  source.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
# Conflicts:
#	app/layouts/topbar/pageRoutes.tsx
#	components/Paper/RelatedWorkCard.tsx
#	components/providers/ClientProviders.tsx
#	hooks/useBounties.ts
@yattias
yattias merged commit a2861a7 into main Oct 12, 2026
1 of 3 checks passed
@yattias
yattias deleted the retire/6-topic-pages branch October 12, 2026 00:24
@sonarqubecloud

Copy link
Copy Markdown

@yattias yattias mentioned this pull request Oct 12, 2026

This branch was successfully deployed

1 active deployment
Preview — 0b30a13e Deployed Oct 12, 2026 by vercel[bot]
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.

1 participant