Skip to content

Commit 7dcfc30

Browse files
committed
Ensures search results are loaded for visible rows
1 parent 8eb15d7 commit 7dcfc30

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/webviews/plus/graph/graphWebview.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,23 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
16181618
this.setSelectedRows(firstResult);
16191619
}
16201620

1621+
// Check if all search results are visible and we have more available
1622+
// If so, proactively load more search results to ensure pagination works
1623+
while (
1624+
search.paging?.hasMore &&
1625+
search.more != null &&
1626+
search.results.size &&
1627+
graph.ids.has(last(search.results.keys())!)
1628+
) {
1629+
// Automatically load more search results since all current ones are visible
1630+
const searchMore = await search.more(configuration.get('graph.searchItemLimit') ?? 100);
1631+
if (searchMore != null) {
1632+
this._search = search = searchMore;
1633+
// Ensure the new results are visible if needed
1634+
void (await this.ensureSearchStartsInRange(graph, search));
1635+
}
1636+
}
1637+
16211638
return {
16221639
results: search.results.size
16231640
? {

0 commit comments

Comments
 (0)