@fern-api/fdr-sdk 1.2.42-b174eece86 → 1.2.42-d3871329d3

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.
@@ -1685,7 +1685,11 @@ function computeSiblingSortBoundaries(ordered) {
1685
1685
  for (const s of ordered) {
1686
1686
  const type = metaStr(s.seg.metadata, "type");
1687
1687
  const sec = s.seg.section;
1688
- if (type !== "section" || sec === "") {
1688
+ if (type !== "section") {
1689
+ continue;
1690
+ }
1691
+ if (sec === "") {
1692
+ rootSections.push(s);
1689
1693
  continue;
1690
1694
  }
1691
1695
  const parent = parentSectionPath(sec);
@@ -1737,7 +1741,9 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1737
1741
  continue;
1738
1742
  }
1739
1743
  if (type === "section" && sec === "") {
1740
- const sectionChildren = buildSectionTree(ctx, scopeSegs, "", scopePrefix);
1744
+ const bounds = siblingBoundaries.get(s);
1745
+ const ownedSegs = bounds != null ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi) : scopeSegs;
1746
+ const sectionChildren = buildSectionTree(ctx, ownedSegs, "", scopePrefix, changelogScopePrefix);
1741
1747
  const node = sectionNode(ctx, s, sectionChildren, scopePrefix);
1742
1748
  annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
1743
1749
  continue;