Skip to content

fix(navigator): merge duplicate Software Product tags by label (#1594) - #1599

Merged
jung-thomas merged 1 commit into
mainfrom
worktree-fix-1594-duplicate-tag
Aug 10, 2026
Merged

jung-thomas merged 1 commit into
mainfrom
worktree-fix-1594-duplicate-tag

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Fixes #1594.

Problem

In Learn → Tutorial Navigator → Software Product, "Mobile Development Kit Client" appeared twice, and each entry returned a different result set.

Root cause

availableProducts in useNavigatorFilters.ts deduped the facet list by tag slug, not by human label. Two distinct slugs humanize to the same label but filter on only their own slug:

Slug Tutorials (live PROD)
software-product>mobile-development-kit-client 34
products>mobile-development-kit-client 1

humanizeTag (scripts/parsers/frontmatter-utils.ts) takes only the segment after >, so both render "Mobile Development Kit Client" while staying distinct slugs through the whole pipeline. This is systemic: ~46 labels in the facet collide this way, driven by legacy AEM taxonomy (products>, topic>, programming-tool>) coexisting with the current one (software-product>, software-product-function>).

Fix (client-only)

  • availableProducts now groups the facet by human label; each entry is { label, slugs } carrying all member slugs.
  • New toggleProduct / isProductSelected helpers add/remove the whole slug group as one selection.
  • The filter predicate, server search (primaryTag eq …), and URL sync are unchanged — they still operate on the flat filters.products slug array, so a merged selection filters on the union of its slugs (matches tutorials tagged with either).

No content rebuild or data migration required — ships via a normal deploy.

Testing

  • 4 new regression tests in useNavigatorFilters.test.ts (merge into one entry, toggle selects/deselects all member slugs, union filtering, partial deep-link seed → unchecked). Full composable suite: 22 passed.
  • vite build succeeds.
  • The navigator component suite has 12 pre-existing failures on main (full-component mount/fetch harness issues, unrelated to this change) — verified the failing test set is byte-identical with and without this change.

Follow-up (not in this PR)

The durable root fix is a slug-alias / canonicalization table applied at build time (ideally DB-driven & admin-editable) so the ~46 collisions collapse before reaching the client and deep-link ?tag= URLs normalize too.

The Software Product filter deduped its facet list by tag slug, so two
distinct slugs that humanize to the same label (e.g.
`products>mobile-development-kit-client` and
`software-product>mobile-development-kit-client`, both 'Mobile
Development Kit Client') surfaced as two separate checkboxes that each
filtered on only their own slug — giving different result counts for
what looks like one choice. This affects ~46 labels where the legacy
AEM taxonomy and the current one collide.

availableProducts now groups by human label and each entry carries all
member slugs. New toggleProduct/isProductSelected helpers add/remove the
whole slug group as one selection; the filter predicate, server search,
and URL sync are unchanged (they still operate on the flat slug array).

Client-only change — no content rebuild needed.
@jung-thomas
jung-thomas merged commit ce42e56 into main Aug 10, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-1594-duplicate-tag branch August 10, 2026 19:55
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.

Duplicate Tag

1 participant