Fix sizing and scrolling of main widget and containers#123
Merged
Conversation
this was really useful for debugging and developed over time. I'm not sure how useful it is for perpetuity, I'll look closely at them and potentially remove later
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
+ Coverage 93.20% 94.12% +0.92%
==========================================
Files 11 11
Lines 1236 1379 +143
==========================================
+ Hits 1152 1298 +146
+ Misses 84 81 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@carlos, this is ready to go with good test coverage, but a painful review. I tested it in napari as much as possible at it seems to work. I know we discussed in morning meeting, but there is no rush for this PR because it merges cleanly (surprisingly into the events callback branch we were working on earlier) |
Contributor
Author
|
I'm going to merge this because it becomes harder to merge with #125 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
References and relevant issues
Scrolling gets a little broken and expands forever, especially in horizontal mode. Also, there was very ppor test coverage of the main widget.
Description
This works by using a "water-fill" approach to expanding individual widgets (see
_allocate_section_extens(). Whereby scrollbars / shrinking will only be done on the "largest" widget, allowing smaller widgets to take up their full space (mostly done through the container's new SizeHint. It also means that there less dependence on an overall outer scrollbar, until its gets so tiny its hard to use anyways...It also correctly maintains expansion state and doesn't do as expensive of rebuilds for the switches.
It also adds good test coverage generally for the main widget, which didn't exist before and allowed all sorts of things to break. Again, these are LLM generated tests, so I haven't looked as closely at them and they probably aren't amazing.