Skip to content

Fix regression with edge case where navigator may display wrong data #916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mportiz08
Copy link
Contributor

Bug/issue #, if applicable: 140370212

Summary

This re-introduces logic removed by #904 that was needed to handle an edge case where the navigator needs to decide between data for 2 distinct navigation trees in the rare scenario where it is provided in the IndexJSON by DocC.

There will usually only be data for a single tree provided, but in the rare scenario where multiple are provided, we should prefer the tree with the "module" root.

Testing

Steps:

  1. Verify that there are no regressions in behavior with loading/displaying data from Index JSON in the sidebar navigator.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

This addresses a rare edge case where the Index JSON contains multiple
top-level root nodes for distinct trees of navigation data. While that
shouldn't normally happen in practice, we would like to prefer the tree
with a containing module if available instead of always using the first
tree provided in the array.
@mportiz08
Copy link
Contributor Author

@swift-ci test

@mportiz08 mportiz08 merged commit 94d0938 into swiftlang:main Dec 5, 2024
1 check passed
@mportiz08 mportiz08 deleted the fix-regression-with-multiple-navigator-trees branch December 5, 2024 17:52
mportiz08 added a commit to mportiz08/swift-docc-render that referenced this pull request Jan 29, 2025
…wiftlang#916)

This addresses a rare edge case where the Index JSON contains multiple
top-level root nodes for distinct trees of navigation data. While that
shouldn't normally happen in practice, we would like to prefer the tree
with a containing module if available instead of always using the first
tree provided in the array.

Resolves: rdar://140370212
mportiz08 added a commit that referenced this pull request Jan 29, 2025
…916) (#925)

This addresses a rare edge case where the Index JSON contains multiple
top-level root nodes for distinct trees of navigation data. While that
shouldn't normally happen in practice, we would like to prefer the tree
with a containing module if available instead of always using the first
tree provided in the array.

Resolves: rdar://140370212
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.

2 participants