-
Notifications
You must be signed in to change notification settings - Fork 788
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
Message posting clean-up #4256
Message posting clean-up #4256
Conversation
This is currently a failing test; work relating to Textualize#3869 should make this pass.
This is currently a failing test; work relating to Textualize#3869 should make this pass.
Fixed Collapsible for the purposes of Textualize#3869.
In support of work on Textualize#3869.
Until now it was possible, depending on the DOM, for this message to not bubble. This ensures that this won't be an issue. In support of work on Textualize#3869.
This will fail right at the moment; the fix follows. In support of work on Textualize#3869.
In support of work on Textualize#3869.
In aid of Textualize#3869. This will fail right now, this is a thing that needs to be fixed.
In aid of Textualize#3869. This ensures that when the dev makes a call on SelectionList.toggle, that SelectionList.SelectionToggled gets posted.
The call to load_text needed fixing for messages too; and actually setting TextArea.text calls this anyway. In support of Textualize#3869.
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.
Looks good to me.
I'm not going to pretend I went through all the code of all widgets to make sure you didn't miss anything, but the changes you did make look good.
self._values = { | ||
**self._values, | ||
**{ | ||
option.value: index | ||
for index, option in enumerate(cleaned_options, start=self.option_count) | ||
}, | ||
} |
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.
Isn't .update
better in terms of speed while being the same in terms of readability?
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.
Off the top of my head I don't know the speed difference; it feels like you are right, do you have a reference?
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.
I don't have a reference, no, it's just an educated guess.
I was just surprised you spelled this out 🤷
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.
I'd probably go with update. It would be faster, but doubt the difference would be measurable. It's more that update
expresses intent better.
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.
Cool. Will tweak it.
Mention them as breaking changes too; while this is an improvement that shouldn't have a negative impact on applications, it's still something developers should be aware of.
Assorted tweaks and fixes as fallout from the work done in #3869. Where possible/sensible extra tests have been added too.
The most significant change here, I think, is to
SelectionList
, which needed a little bit of extra work because it became necessary to find back the index of a value. (while this is in review I'm going to give that part one last run over as I want to be double sure it's a good approach -- I think this also possibly either provides a "good" reason for #3908 or might actually make it less good)