Repository navigation
Combined topic views: /topics/business,saas,crypto (0.3.0) - #267
Merged
Merged
Conversation
A comma in a topic URL now means a list (up to 10; %2C and spaces accepted, slugs normalised and deduped). The view is the union of the topics: every feed filed under any of them, each once. Order: tagged by its publisher under any listed topic first, then strength summed across the topics. Works on every topic surface: /topics/a,b and /topics/a,b/<group>, the JSON API /api/topics/a,b (same shape, plus `topics` and `unknown`), the feeds and playlists (/topics/a,b.rss, /topics/a,b/<group>.json, /api/topics/.../feed/*), the player pages and add-all queue, and the MCP get_topic / topic_posts tools. A single topic takes exactly the old code path and SQL. Unknown topics in a list are named and the known ones shown; nothing known is a 404, more than 10 a 400. Combined pages canonicalise to themselves and are noindex; sitemaps are unchanged. Each query is one statement with `slug in (...)`; the river picks each topic's strongest feeds (max(50, 2*200/n) per topic) so one large topic cannot crowd the others out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
/topics/business,saas,crypto(and every other topic surface) now takes a comma list: the union of the topics, every feed filed under any of them, each feed once./topics/a,b,c,/topics/a,b,c/blogs(title "a, b, c", a link to each topic, unknown ones named)/api/topics/a,b,c?group=&limit=&offset=(same shape; addstopics,unknown, per-feedtopics)/topics/a,b,c.rss,/topics/a,b,c/blogs.json,/api/topics/[keyword]/feed/[format],[group]/feed/[format](one river, newest first)/topics/a,b/play,/topics/a,b/podcasts/play, add-all queueget_topic,topic_postsaccept"business, saas, crypto"Rules
/api/topics/businessidentical to live).,/%2C/ spaces accepted; slugs normalised and deduped; max 10 (400 beyond). Nothing known: 404. Partly known: show the known ones and name the unknown. A list that collapses to one topic (business,Business) is that topic.slug in (...)(the housekindFilter-style placeholders). The river picks each topic's strongestmax(50, 2*200/n)feeds so one big topic cannot crowd out the rest. Timed against prod (warm): union listing 68 ms, kind counts 80-106 ms (count(distinct); thein (subquery)version was 0.3-2 s), river 169 ms, 10 large topics 0.4-0.6 s.noindex, follow, like the player pages. Sitemaps unchanged. Follow/webring buttons hidden on combined views (they are keyed on one slug).Tests
packages/db/test/multi-topic.test.js: single-element list equals single topic, union dedupe/order/paging/filter, counts, river, media.apps/web/test/topic-set.test.js: parsing, API shape for one vs many, 404/400, feed route, MCP tools.bun run testall green;bun run buildgreen.🤖 Generated with Claude Code