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

Ensure reflow reflows non-visible widgets, fix scroll_to_center issue #2684

Merged
merged 3 commits into from
May 29, 2023

Conversation

darrenburns
Copy link
Member

@darrenburns darrenburns commented May 29, 2023

Closes #2268
Closes #2254

When reflow was called, we were only reflowing visible widgets. This was preventing widgets that were not visible from being added into full_map.

reflow_visible was explicitly passing visible_only=True to arrange_root, but that was actually already the default value. reflow was not passing visible_only at all, so it was defaulting to True.

This broke scroll_to_center, because widgets that were scrolled out of view were not present in the compositors full map.

With this change, the _full_map is now fully populated by reflow, and scroll_to_center works as expected.

image

I've removed the xfail the scroll_to_center snapshot test and it seems to pass consistently now.

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

@darrenburns darrenburns changed the title Ensure reflow reflows non-visible widgets Ensure reflow reflows non-visible widgets, fix scroll_to_center issue May 29, 2023
@willmcgugan
Copy link
Collaborator

Is that all it was?! I thought it would be a much more complex issue than that.

@darrenburns
Copy link
Member Author

@willmcgugan Yup, seems like it 😄

@darrenburns darrenburns marked this pull request as ready for review May 29, 2023 17:16
yield Label(("SPAM\n" * 49)[:-1])
yield Label(("SPAM\n" * 51)[:-1])
yield Label(("SPAM\n" * 59)[:-1])
yield Label(("SPAM\n" * 53)[:-1])
Copy link
Member Author

Choose a reason for hiding this comment

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

Simplified this a little because I was struggling to understand it vs what was on screen. It still has multiple levels of nested scrolling containers, both vertical and horizontal.

Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

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

Nice 🚀

@darrenburns darrenburns merged commit a40300a into main May 29, 2023
@darrenburns darrenburns deleted the compositor-full-map-fix branch May 29, 2023 17:23
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.

Scroll to center problem Compositor map not aware of widgets nested deep into the DOM on app startup
3 participants