Skip to content

fix(topics): nest /topics/ tree by parsing real titlePath separators - #2117

Merged
jung-thomas merged 1 commit into
DEVfrom
deploy-dev-46da5201
Sep 2, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
deploy-dev-46da5201

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

Tom reported the /topics/ tree renders completely flat — every item is one leaf carrying the whole titlePath (e.g. "Operating System : Android — 92 tutorials · 116 concepts") with no drill-in folders.

Root cause

parseTitlePath split on legacy > (facet) / -- (level) separators that never appear in live Tags.titlePath data. 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 to facet='' with the whole path as a single segment → the tree-builder had nothing to nest.

Fix

  • parseTitlePath now splits facet on : and levels on /.
  • buildTopicSlugMap derives the slug from the full titlePath so already-published topic-<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.js already 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.js updated 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.

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).
@jung-thomas
jung-thomas merged commit 24abea4 into DEV Sep 2, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the deploy-dev-46da5201 branch September 2, 2026 16:47
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