Fix performance bottlenecks when multi buffers have huge numbers of buffers (#26308)

This is motivated by trying to make the Project Diff view usable with
huge Git change sets.

Release Notes:

- Improved performance of rendering multibuffers with very large numbers
of buffers
This commit is contained in:
Max Brunsfeld 2025-03-07 18:15:15 -08:00 committed by GitHub
parent cb543f9546
commit 4846e6fb3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 62 additions and 21 deletions

View file

@ -2424,14 +2424,10 @@ impl Pane {
.child(label),
);
let single_entry_to_resolve = {
let item_entries = self.items[ix].project_entry_ids(cx);
if item_entries.len() == 1 {
Some(item_entries[0])
} else {
None
}
};
let single_entry_to_resolve = self.items[ix]
.is_singleton(cx)
.then(|| self.items[ix].project_entry_ids(cx).get(0).copied())
.flatten();
let total_items = self.items.len();
let has_items_to_left = ix > 0;