story: replace List search results without duplicating rows - #2976
Merged
Conversation
Clear existing result groups before rebuilding them while keeping industry indices stable. Initialize groups and industry labels in sync so headings match their rows. Cover repeated, empty, cleared, and refreshed queries.
3 tasks
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
List Story appends search matches to the previous results. Repeating a search or refreshing the data duplicates rows, and a query with no matches can leave old rows visible.
This clears each result group before rebuilding it from the source companies. The groups themselves stay in place so industry order and section indices do not change between queries. It also removes an extra empty group from initialization, which put companies and their industry headings at different indices.
Only the Story delegate and its regression test change. The List component and its public API are unchanged.
Screenshots
These show an unmatched query and the list after clearing it, not a before/after comparison. Company data is randomly generated on each launch.
How to Test
On macOS:
Use the company list's search field, not the sidebar search:
no-company-matches-123. The list should be empty.Correct filtering can expose the separate row-measurement bug fixed by #2975. If a filtered row overlaps its footer, that is not fixed here. The two patches should remain separate, with #2975 merged first.
The regression runs without opening a window:
cargo test -p gpui-component-story --lib searching_and_refreshing_replace_company_groups --lockedIt failed before the fix and passes afterward. It checks case-insensitive matching, no matches, clearing the query, alignment between companies and industry groups, and rebuilding results without duplicates.
Automated checks
cargo test -p gpui-component-story --lib --locked cargo clippy -p gpui-component-story --all-targets --locked -- -D warningsAll 14 Story library tests passed, along with strict Clippy, formatting, and the diff whitespace check. The agent also checked matching, empty, cleared, and repeated searches through the macOS accessibility tree.
Windows and Linux runtime were not tested.
Checklist
AI assistance
I tested this fix in my application, then asked OpenAI's
gpt-6-astrato extract it into a standalone PR. The agent prepared the patch, regression test, and description, and ran the automated checks. I reviewed the extracted patch, requested corrections, and manually tested it again on macOS.