Fix active tree's comments not getting scrolled into view when switching to comments tab #8022
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.
Currently, the active tree's comment is not reliably highlighted when switching from skeleton to the comments tab due to some likely unexpected behavior: Once the comments tab is opened but then not visible, e.g. hidden behind the skeleton tab, the comments tab is still active but not antd is being rendered. Thus, the ref to this antd tree component is null which results in the component not scrolling to the active tree in the described case. To fix this behaviour I did some state lifting: The comments tab is now aware whether it is visible. When the component is visible again, the scroll to call is triggered and thus the active tree is shown :)
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)