Repository navigation
fix(topics): nest /topics/ tree by parsing real titlePath separators - #2117
Merged
Merged
Conversation
parseTitlePath split on legacy '>'/'--' separators that never appear in live Tags.titlePath data (which uses ' : ' for facet, ' / ' for hierarchy levels), collapsing every tag to facet='' + one whole-path segment — the flat /topics/ tree Tom reported. Now split facet on ' : ' and levels on ' / '. buildTopicSlugMap derives the slug from the FULL titlePath so already-published topic-<slug> BLOB keys/URLs stay byte-stable, with an index suffix for rare collisions (dropped the facet-qualified branch).
Merged
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
Tom reported the
/topics/tree renders completely flat — every item is one leaf carrying the wholetitlePath(e.g. "Operating System : Android — 92 tutorials · 116 concepts") with no drill-in folders.Root cause
parseTitlePathsplit on legacy>(facet) /--(level) separators that never appear in liveTags.titlePathdata. Real values use:to separate the facet from the value and/to separate hierarchy levels (e.g.Software Product : Database / SAP HANA Cloud / Data Lake). Result: every tag parsed tofacet=''with the whole path as a single segment → the tree-builder had nothing to nest.Fix
parseTitlePathnow splits facet on:and levels on/.buildTopicSlugMapderives the slug from the full titlePath so already-publishedtopic-<slug>BLOB keys and/topics/<slug>/URLs stay byte-stable; rare collisions get an index suffix (dropped the old facet-qualified branch).topics-query.js/topic-list-page.jsalready build + render the nested hierarchy correctly — they were just being fed flat data.Verification
test/unit/topic-slug.test.js+test/unit/topics-query.test.jsupdated to the real separator format; added a nested-hierarchy assertion (facet → Database folder → SAP HANA Cloud → Data Lake leaf). 17/17 pass./topics/index is live CAP SSR (version-keyed cache cleared on restart), so a srv redeploy fixes the tree with no republish; a standard content republish refreshes detail-page facet/relatedTags.Deploy + live DEV verification to follow from fresh origin/DEV after merge.