✨ Tag page lists every node kind (issues, solutions, case studies)#99
Merged
Conversation
The /tag/[slug] page called /api/issues, which only returns top-level issues, so a tag's page showed a handful of nodes while the topics index badge counted every tagged issue and solution (e.g. "17" vs "Found 2"). Add /api/tag/[slug]: returns all approved, non-spam issues and solutions carrying the tag, plus the case studies attached to any tagged solution (case studies have no tags of their own, so they surface transitively). Filters match /api/tags. The page now groups results into Issues, Solutions, and Case studies sections with per-kind counts. Extend the /api/tags `uses` badge to also count those transitive case studies so the badge equals the page total again. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧹 Code quality
updated for |
CI's code-quality job failed on the previous commit: the page template was unformatted, and fallow flagged both new units as introduced complexity (0% estimated coverage puts the CRAP ceiling at cyclomatic 5). - Format app/pages/tag/[slug].vue per vize. - Endpoint: extract listParams / taggedNodeIds / tagIssueNodes / tagCaseStudies / caseStudyOrder helpers and fetch the two lists in parallel, dropping the handler well under the complexity threshold. - Page: move pluralization, the count breakdown, the related-tag size class, and the section config into computeds; collapse the two identical node sections into one v-for. The remaining template branching is irreducible list-rendering, so suppress it with fallow-ignore-next-line (the diff-gate re-attributes the whole touched template as introduced), mirroring the case-study pages. Behavior unchanged: re-verified nodes, transitive case studies, badge parity, search and sort against the dev DB. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Problem
The
/tag/[slug]page called/api/issues, which only returns top-level issues. So a tag's page showed a handful of nodes while the topics-index badge counted every tagged issue and solution — e.g.#circular-economyshowed 17 on/tagsbut "Found 2 issues" on its own page.Change
New endpoint
server/api/tag/[slug].get.tsissuestable).search_vector, so search filters them too./api/issues→/api/issue/[id]convention and avoids a typed-route union collision with/api/tags/similar.Page
app/pages/tag/[slug].vueCardIssuefor issues/solutions,CardCaseStudyfor studies. ReusesUiSearchAndSortBar/UiSectionTitle/UiEmptyState; related-tags cloud now aggregates across all returned nodes.Badge consistency
server/api/tags.get.tsusesbadge now also counts those transitive case studies, so it equals the page total again (distinctcounts, since the case-study join multiplies solution rows).Verification (against local dev DB)
climate: badge 27 = page total 27 (17 issues incl. 14 sub-issues + 10 solutions).bunx vue-tsc --noEmitclean; lint shows only warnings identical to the shippedsolutions.vue/case-studies.vue(accepted project style). Addedaria-labels to the sections.🤖 Generated with Claude Code