-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 search box to chat overlay #30382
Conversation
public void FilterChannels(string searchTerm) | ||
{ | ||
foreach (var item in ItemFlow.Children) | ||
{ | ||
if (string.IsNullOrEmpty(searchTerm)) | ||
{ | ||
item.Show(); | ||
continue; | ||
} | ||
|
||
if (item.Channel.Name.Contains(searchTerm, StringComparison.OrdinalIgnoreCase)) | ||
item.Show(); | ||
else | ||
item.Hide(); | ||
} | ||
} |
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.
Should not be implementing search logic manually, should be using SearchContainer
instead
searchTextBox.OnUpdate += (newText) => | ||
{ | ||
privateChannelGroup.FilterChannels(searchTextBox.Text); | ||
}; |
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.
Should not be doing things every frame, should be binding to changes of searchTextBox.Current
instead
@peppy code quality issues notwithstanding, any UX feedback on this? I'm not sure this should be limited to searching PM channels, I'd say the textbox should be topmost and allow searching public channels by name too? |
Yep, sounds fine with your proposed change. |
Would be neat if pressing enter automatically selects the first matching result (if it doesn't already) |
When I'm at home, I'm be ready to edit the code |
I'm just gonna apply the changes myself to speed this up. |
ok thanks 😋 |
After: 2024-10-22.12-33-35.mp4@ppy/team-client requesting second review as I rewrote every line. |
We probably need a |
Probably, but if you wanna go down that way we'd probably need to re-examine a bunch of UX (mod select comes to mind first and foremost?) |
Can happen later, just feels like i should be able to focus search here quickly |
I've been wanting to suggest this for a long time, and even left a message in Figma saying:
In general, I propose a pull request. I think it could have been done better than what I did.
2024-10-22.012627.mp4
I think it'll be a good user experience.