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

Search all SelectingItemsControl items with TextSearch on key input, not just realized ones #17506

Merged
merged 22 commits into from
Feb 26, 2025

Conversation

jonko0493
Copy link
Contributor

@jonko0493 jonko0493 commented Nov 14, 2024

What does the pull request do?

This PR brings the behavior of SelectingItemControls with VirtualizingPanel presenters into parity with those controls without virtualizing presenters.

What is the current behavior?

Currently, SelectingItemsControls with VirtualizingPanel item presenters (such as ComboBox) do not search the full contents of their boxes with text search, only the currently realized controls. This means that if a ComboBox is closed, typing does nothing, and even when opened, (this was slightly wrong!) it will only jump to items immediately in the popup.

What is the updated/expected behavior with this PR?

Now, ComboBoxes and other SelectingItemsControls with virtualizing presenters will have proper TextSearch for their entire item sets.

How was the solution implemented (if it's not obvious)?

The anonymous method that existed in the SelectingItemsControl class previously has been moved into a static method in ItemsPresenter. It's now used there and in VirtualizingPanel to check search their items/children for text search. (Note: I don't know if there is a preferred place for a static method like this; happy to move as appropriate.)

Unit test case was added to an existing test and the test was adapted so that ComboBoxes in tests will use a VirtualizingStackPanel like the real controls do to ensure the tests fail without this change.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #12490.

@jonko0493 jonko0493 changed the title [SelectingItemsControl] Search all items with TextSearch on key input, not just realized ones Search all SelectingItemsControl items with TextSearch on key input, not just realized ones Nov 14, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053300-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Nov 14, 2024

  • All contributors have signed the CLA.

@jonko0493
Copy link
Contributor Author

@cla-avalonia agree

@jonko0493
Copy link
Contributor Author

Everything was passing prior to me merging master... not sure what changed, could be transient failures?

@timunie
Copy link
Contributor

timunie commented Nov 17, 2024

@jonko0493 don't worry tests are a bit flaky atm

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053407-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053771-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053885-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053987-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jonko0493
Copy link
Contributor Author

Hi folks! Is there something more I need to do to get this reviewed? It is needed for the application I'm developing and it's been a month since it was opened. Thanks!

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0054097-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jonko0493
Copy link
Contributor Author

@timunie I'm very sorry to ping you, but I'm wondering if there's anything else I need to do to get this reviewed. It's needed to make my project usable and I'd prefer not to take a dependency on the PR package. Please let me know if there's anything I can do!

@timunie
Copy link
Contributor

timunie commented Jan 12, 2025

If you have paid support please ask for priority

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0054235-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jonko0493
Copy link
Contributor Author

@timunie I don't have paid support as we're a tiny open source project, so fair enough, I'll wait my turn. This PR has been open three months -- how long should I expect to wait before getting a review without paid support?

@MikeCodesDotNET
Copy link
Member

Thanks for bearing with us. To clarify, this PR was submitted on 14th November, so it’s been open for less than two months, not three.

As an open-source project, we greatly value community contributions, but our priority is supporting paying customers. While we can’t guarantee review times for community PRs, we aim to review them as quickly as possible.

We’re planning to allocate time this week to address outstanding contributions, though I can’t promise which specific PRs will be reviewed.

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.

While the implementation has its merits, we now have different behaviors for standard panels and for VirtualizingPanel.
The non-virtualized implementation searches inside item containers (controls) directly. The new implementation for VirtualizingPanel searches only inside Items.

We should have the same implementation for both panels here, for consistency.
Looking at WPF, it always searches in Items, so I propose that we do the same, whatever the panel.

The search should look for:

  • TextSearch.Text (current)
  • IContentControl.Content.ToString() (current)
  • item.ToString()

(Ideally we'd also consider DisplayMemberBinding, like WPF does, but this is out of scope of this PR and can be added later).

@jonko0493
Copy link
Contributor Author

@MikeCodesDotNET Thanks so much for letting me know and I'm sorry for misrepresenting how long the PR had been open -- that was truly a mistake on my part (I can't do date math well in my head, apparently lol).

@MrJul Thank you for the review! The changes you've suggested make good sense. I'll make them in the next few days.

@jonko0493
Copy link
Contributor Author

@MrJul Sorry for the delay -- I am embarrassed that it took so long but life really hit me with a ton of stuff all at once right after I said I was going to do this. In any case, I believe I have addressed your feedback. If you could give this another look when you get a chance, I would greatly appreciate it!

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0055076-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0055111-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jonko0493 jonko0493 requested a review from MrJul February 25, 2025 04:29
@MrJul
Copy link
Member

MrJul commented Feb 26, 2025

@MrJul Sorry for the delay -- I am embarrassed that it took so long but life really hit me with a ton of stuff all at once right after I said I was going to do this.

No worries, life happens and in my opinion should always be the priority! :)
Thank you for coming back to this.

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@MrJul MrJul added this pull request to the merge queue Feb 26, 2025
Merged via the queue into AvaloniaUI:master with commit 418e15d Feb 26, 2025
10 checks passed
@jonko0493
Copy link
Contributor Author

@MrJul Thanks so much for your review and help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SelectingItemsControl] TextSearch in all items, not only realized items
6 participants