@dogsbay/docs-layout 0.2.0-beta.75 → 0.2.0-beta.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dogsbay/docs-layout",
3
- "version": "0.2.0-beta.75",
3
+ "version": "0.2.0-beta.76",
4
4
  "description": "Standard documentation layout components for Dogsbay",
5
5
  "type": "module",
6
6
  "exports": {
@@ -29,8 +29,8 @@
29
29
  "./json-ld": "./src/json-ld.ts"
30
30
  },
31
31
  "dependencies": {
32
- "@dogsbay/ui": "0.2.0-beta.75",
33
- "@dogsbay/primitives": "0.2.0-beta.75"
32
+ "@dogsbay/ui": "0.2.0-beta.76",
33
+ "@dogsbay/primitives": "0.2.0-beta.76"
34
34
  },
35
35
  "devDependencies": {
36
36
  "vitest": "^3.0.0"
@@ -528,16 +528,17 @@ const {
528
528
 
529
529
  let items: string;
530
530
  if (hierarchical) {
531
- // Slash-encoded values build a tree directly from their
532
- // values; segment-encoded values need nav.json for
533
- // structure. The helper detects which and falls back to
534
- // a flat list when segment-encoded + no nav yet — phase 3
535
- // upgrades to the real tree as soon as ensureNavLoaded
536
- // resolves and re-renders.
537
- const segmentEncoded = !entries.some((e) =>
538
- e.value.includes("/"),
539
- );
540
- if (segmentEncoded && navData === null) needsNav = true;
531
+ // Every hierarchical facet wants nav.json slash-encoded
532
+ // for sort order at each depth (so docs follow nav rather
533
+ // than count-desc), segment-encoded for the tree structure
534
+ // itself. Without nav, slash-encoded still renders a tree
535
+ // (using values alone) but in count-desc order, which is
536
+ // wrong on corpora where one branch dwarfs the rest
537
+ // (openshift's rest_api section). Fire ensureNavLoaded()
538
+ // any time a hierarchical facet renders with navData still
539
+ // null — when it resolves, renderFacets re-runs and
540
+ // upgrades the sort.
541
+ if (navData === null) needsNav = true;
541
542
  const tree = buildFacetTree(name, entries, {
542
543
  display: taxonomyDisplay,
543
544
  nav: navData ?? undefined,