-
Notifications
You must be signed in to change notification settings - Fork 1
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
add searchable room name #51
base: main
Are you sure you want to change the base?
add searchable room name #51
Conversation
SetRoomView(RoomView), | ||
SetSendAllPath(String), | ||
SetSendAllWorld(String), | ||
ShowLoggingInstructions, | ||
ShowRoomFilter, |
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 can have one message called ToggleRoomFilter instead if Show/Hide RoomFilter
I just thought it was more explicit like this. but I think both would do the same for 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.
Given that their implementations are identical, merging them makes more sense imo. Or change their implementations so ShowRoomFilter
always sets the field to true
and sets focus, while HideRoomFilter
always sets the field to false
and doesn't set focus.
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.
sounds good ill merge them into ToggleRoomFilter
SetRoomView(RoomView), | ||
SetSendAllPath(String), | ||
SetSendAllWorld(String), | ||
ShowLoggingInstructions, | ||
ShowRoomFilter, |
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.
Given that their implementations are identical, merging them makes more sense imo. Or change their implementations so ShowRoomFilter
always sets the field to true
and sets focus, while HideRoomFilter
always sets the field to false
and doesn't set focus.
@@ -149,6 +149,7 @@ pub struct RoomFormatter { | |||
pub password_required: bool, | |||
pub name: String, | |||
pub id: u64, | |||
pub active: bool, |
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.
Using Option<RoomFormatter>
where necessary would be better than using this field to create dummy room formatters imo.
I changed the picklist for selecting a room name, using a text input, the picklist and a stack I was able to replicate the same behavior as a combo box without the state complexity of a combo box.
There is a bug where the picklist will crash if there are no options (the use case where all options are filtered out) so I added a dummy option in those cases. I wasn't able to make it unselectable, so I added a variable
active
in the roomFormatter struct so that if the option is selected, the filter is cleared out and nothing happens.I know it's not a perfect solution, but it's a simple one for a simple UI change.
this was probably the thing that annoyed me the most, having to scroll all the way down to find my room.
Thank you for reviewing and let me know if you think the solution is too clunky🙏
Mido.s.House.Multiworld.2024-10-09.16-51-56.mp4