-
Notifications
You must be signed in to change notification settings - Fork 885
WIP new option list #5510
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
WIP new option list #5510
Conversation
I hope you don't mind me sticking my nose in (as usual!), especially since this is still a WiP. Is it necessary to remove the |
I would disagree it is less intuitive. The OptionList intuitively takes a list of options. But a "Separator" is not an option, nor anything that is present in the option list. It is just a way of marking the end of a logical group. I think Internally, it does simplify things. There is no need to distinguish between a real option and this special Separator case. |
def test_option_list_wrapping(snap_compare): | ||
"""You should see a 40 cell wide Option list with a single line, ending in an ellipsis.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't spot this before it was merged, from the snapshot it looks like the OptionList height is based on the full height of the prompt rather than the truncated version with nowrap
. Is that expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks.
A rewrite of OptionList internals, mostly preserving the original interface. The original was brittle, small changes would break everything. There was also some misguided attempts at doing things lazily, which resulted in doing work multiple times, particularly when first adding the widget. The original would also not be able to report its size accurately, until two or three frames later. An earlier pass partially fixed that, but it still took a frame before the OL could report its size.
Simplify internal data structures.
Fix "lazy" operations.
Integrate better with the new Visual API.
Replace
Separator
withNone
Fixes An empty
OptionList
withwidth: auto
causes a crash inget_content_width
#5489Fixes When an
OptionList
has atransparent
background option colours can get out of sync (since 0.86.0) #5488Fixes The
wrap
parameter forOptionList
no longer works #5418Fixes Updating a
OptionList
that contains separator lines can result in a garbled display (since 0.86.0) #5431Fixes Large
OptionList
widgets are slow to load (since 0.86.0) #5498