Skip to content

Conversation

snprajwal
Copy link
Contributor

@snprajwal snprajwal commented Aug 4, 2025

Bug/issue #, if applicable: rdar://155522179

Summary

PR #757 enabled DocC to include manually curated non-symbol nodes in the
topics section, irrespective of the node language. This allows curating
articles across documentation in different languages, even though the
article's language is considered to be "Swift". However, the logic was
too permissive, and allowed curating non-symbol nodes within the same
bundle but across different languages. This is incorrect, since the
target page should be annotated with the SupportedLanguage directive
to enable curating it in a different language. A bespoke mechanism to
curate an internal reference correctly is not necessary. This patch
tightens the logic to only allow curating external references in a
different language than the source page language, , and removes the
existing test for the undesired behaviour of including local references
to cross-language symbols.

The changes in PR #757 were not propagated to the navigator, resulting
in the references being present in the topics section but not in the
sidebar. This patch also introduces the curation logic in the navigator
to maintain parity with the topics section. The navigator tests for
external render nodes have been modified accordingly to reflect this
change.

Dependencies

None

Testing

The navigator tests in ExternalRenderNodeTests have been updated to reflect the curation behaviour.

Checklist

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

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@snprajwal snprajwal force-pushed the pnadig/fix-nav branch 2 times, most recently from 6c5b795 to 812c56a Compare August 4, 2025 17:23
@snprajwal
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@d-ronnqvist d-ronnqvist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's some information that I'm missing, this change in behavior feels like it's incorrect to me.

@snprajwal snprajwal changed the title Include symbols without common lang in navigator Add manually curated non-symbol nodes in navigator Sep 10, 2025
@snprajwal
Copy link
Contributor Author

@swift-ci please test

@anferbui anferbui self-requested a review September 12, 2025 12:47
@snprajwal snprajwal changed the title Add manually curated non-symbol nodes in navigator Only curate external non-symbols in different lang Sep 19, 2025
@snprajwal
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@d-ronnqvist d-ronnqvist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good. I think it would be good to add code comments in a few places to highlight that this behavior is a workaround, rather than the intended behavior.

@snprajwal
Copy link
Contributor Author

snprajwal commented Oct 1, 2025

I've added a note with the link to #240 in the relevant comments, and also left FIXMEs for us to come back to.

@snprajwal snprajwal requested a review from d-ronnqvist October 1, 2025 11:31
@snprajwal
Copy link
Contributor Author

@swift-ci please test

PR swiftlang#757 enabled DocC to include manually curated non-symbol nodes in the
topics section, irrespective of the node language. This allows curating
articles across documentation in different languages, even though the
article's language is considered to be "Swift". However, the logic was
too permissive, and allowed curating non-symbol nodes within the same
bundle but across different languages. This is incorrect, since the
target page should be annotated with the `SupportedLanguage` directive
to enable curating it in a different language. A bespoke mechanism to
curate an internal reference correctly is not necessary. This patch
tightens the logic to only allow curating external references in a
different language than the source page language, and removes the
existing test for the undesired behaviour of including local references
to cross-language symbols.

The changes in PR swiftlang#757 were not propagated to the navigator, resulting
in the references being present in the topics section but not in the
sidebar. This patch also introduces the curation logic in the navigator
to maintain parity with the topics section. The navigator tests for
external render nodes have been modified accordingly to reflect this
change.

rdar://155522179
Copy link
Contributor

@d-ronnqvist d-ronnqvist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thank you for working through all the feedback.

@d-ronnqvist
Copy link
Contributor

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit 82cc6c8 into swiftlang:main Oct 6, 2025
2 checks passed
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.

3 participants