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

add searchable room name #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeremieb24
Copy link
Contributor

@jeremieb24 jeremieb24 commented Oct 9, 2024

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

SetRoomView(RoomView),
SetSendAllPath(String),
SetSendAllWorld(String),
ShowLoggingInstructions,
ShowRoomFilter,
Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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

@fenhl fenhl added type: enhancement New feature or request component: GUI Related to the multiworld app labels Oct 10, 2024
crate/multiworld-gui/src/main.rs Show resolved Hide resolved
SetRoomView(RoomView),
SetSendAllPath(String),
SetSendAllWorld(String),
ShowLoggingInstructions,
ShowRoomFilter,
Copy link
Member

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,
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: GUI Related to the multiworld app type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants