feat(explore): list articles carrying the tag, not only posts - #148
Merged
Conversation
A tag is not a post-only idea. GET /articles?tag= narrows articles the
same way GET /posts?tag= narrows posts, but /explore?tag=nodejs only ever
asked for posts, so an author who tagged an article nodejs never saw it
under #nodejs.
The tag view now carries the same Posts / Articles strip the profile does,
and each list fetches only while its own tab is showing. Which tab is open
lives in the query string beside the tag, so /explore?tag=nodejs&tab=articles
is a link someone can send; posts is the default and stays out of the URL,
leaving the plain /explore?tag=nodejs already shared around unchanged.
Switching replaces the entry rather than pushing one, because Back here is
for leaving the tag.
Both lists also get the pagination they already supported: the tag view was
passing hasMore={false} and an empty onLoadMore, so a tag stopped at its
first page however many pages the endpoint had.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MyKUa9kaZDJbC7D1j7w2Fs
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tdn-client | f7f1b1b | Commit Preview URL Branch Preview URL |
Aug 30 2026, 04:53 AM |
11 tasks
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.
Summary
A tag is not a post-only idea.
GET /articles?tag=nodejs&page=1&limit=10narrows articles the same wayGET /posts?tag=narrows posts — but/explore?tag=nodejsonly ever asked for posts, so an author who tagged an articlenodejsnever saw it under #nodejs.The tag view now carries the same Posts / Articles strip the profile does, and each list fetches only while its own tab is showing, so opening Articles does not refetch the posts behind it.
articleApi.getArticlesalready tooktag— no API-layer change was needed.Which tab is open lives in the query string beside the tag, so
/explore?tag=nodejs&tab=articlesis a link someone can send.postsis the default and is left out of the URL, so the plain/explore?tag=nodejsalready shared around still opens on posts, and an unknown slug falls back to Posts rather than an empty page. Switching replaces the entry rather than pushing one — Back here is for leaving the tag, not for walking back through which of its two lists was looked at last.Also fixed along the way: the tag view was passing
hasMore={false}and an emptyonLoadMoretoPostList, so a tag stopped at its first page however many pages the endpoint had. Both lists now get the pagination the hooks already provided.New i18n key
explore.articlesTaggedSubtitle(en + tr) so the subtitle says which of the two it is counting.Type of change
How was this tested?
pnpm exec tsc -bpnpm lintpnpm testexplore-tags.spec+articles.spec+profile.specNew coverage:
src/pages/ExplorePage.test.tsx(9 tests, the page had none) — the tab the URL names, the fallback for an unknown slug,fetchArticles({ tag })on the Articles tab with no second posts fetch behind it, the default tab dropping back out of the URL,REPLACErather than a pushed entry, the subtitle switching, and the trending view fetching nothing.e2e/explore-tags.spec.ts— a real round trip provingtag=nodejsreaches/articles, that?tab=articlesopens on articles without fetching posts at all, and that Back leaves the tag rather than the tab.docs/QA.mdupdated with theExplorePagesection and both new specs.Screenshots (if applicable)
The strip is the profile's markup unchanged (
flex-1buttons, 2px underline on the active one), sitting under the#tagheader inside the existing sticky bar.Checklist
pnpm lintpassespnpm exec tsc -bpasses (no type errors)flex-1, same as the profile'sanytypes introducedconsole.logleft in codeOne thing noticed, not changed
useTrendsdoessetTrends(data.trends)with no fallback (src/features/trends/hooks/useTrends.ts). A/tags/trendsbody without atrendskey leaves the stateundefinedandTrendingTopicsWidgetthen throws ontrends.length— which takes down the whole route, on every page, since the widget is in the right rail everywhere. I hit it with a malformed stub rather than from the real API, and fixing it is outside this change; flagging it as worth a one-line guard.🤖 Generated with Claude Code
https://claude.ai/code/session_01MyKUa9kaZDJbC7D1j7w2Fs