Repository navigation
fix(navigator): merge duplicate Software Product tags by label (#1594) - #1599
Merged
Merged
Conversation
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.
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.
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
availableProductsinuseNavigatorFilters.tsdeduped 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:software-product>mobile-development-kit-clientproducts>mobile-development-kit-clienthumanizeTag(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)
availableProductsnow groups the facet by human label; each entry is{ label, slugs }carrying all member slugs.toggleProduct/isProductSelectedhelpers add/remove the whole slug group as one selection.primaryTag eq …), and URL sync are unchanged — they still operate on the flatfilters.productsslug 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
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 buildsucceeds.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.