Skip to content
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

Fix active tree's comments not getting scrolled into view when switching to comments tab #8022

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

MichaelBuessemeyer
Copy link
Contributor

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):

  • https://___.webknossos.xyz

Steps to test:

  • Open an skeleton annotation
  • create some skeletons with comments
  • reduce the browser window height to decrease the amount of needed comments to get the comments tab into scrolling behaviour
  • save and reload
  • open skeleton tab, select a tree with at least one comment and switch to the comments tab. The tree's comments should be scrolled into view upon switching
  • Optional: Compare with master behaviour

Issues:


(Please delete unneeded items, merge only when none are left open)

@MichaelBuessemeyer MichaelBuessemeyer marked this pull request as ready for review August 22, 2024 15:38
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

thank you for fixing this! works great 👍

@MichaelBuessemeyer MichaelBuessemeyer merged commit daf966c into master Aug 23, 2024
2 checks passed
@MichaelBuessemeyer MichaelBuessemeyer deleted the scroll-active-comment-to-top branch August 23, 2024 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants