Sfoglia il codice sorgente

Adds jump to last match support in Graph

main
Eric Amodio 2 anni fa
parent
commit
4fc4a30910
2 ha cambiato i file con 22 aggiunte e 14 eliminazioni
  1. +11
    -11
      src/webviews/apps/plus/graph/GraphWrapper.tsx
  2. +11
    -3
      src/webviews/apps/shared/components/search/search-box.ts

+ 11
- 11
src/webviews/apps/plus/graph/GraphWrapper.tsx Vedi File

@ -330,8 +330,8 @@ export function GraphWrapper({
next = false;
searchIndex = 0;
} else if (direction === 'last') {
next = true;
searchIndex = count - 1;
next = false;
searchIndex = -1;
} else {
next = direction === 'next';
[searchIndex, id] = getClosestSearchResultIndex(results, searchQuery, activeRow, next);
@ -361,16 +361,16 @@ export function GraphWrapper({
} else {
searchIndex = 0;
}
} else if (direction === 'last' && searchQuery != null && results?.paging?.hasMore) {
const moreResults = await onSearchPromise?.(searchQuery, { limit: 0, more: true });
if (moreResults?.results != null && !('error' in moreResults.results)) {
if (count < moreResults.results.count) {
results = moreResults.results;
count = results.count;
}
searchIndex = count;
}
} else {
// TODO@eamodio should we load all the results here? Or just go to the end of the loaded results?
// } else if (searchQuery != null && results?.paging?.hasMore) {
// const moreResults = await onSearchCommitsPromise?.(searchQuery, { limit: 0, more: true });
// if (moreResults?.results != null && !('error' in moreResults.results)) {
// if (count < moreResults.results.count) {
// results = moreResults.results;
// count = results.count;
// }
// }
searchIndex = count - 1;
}
}

+ 11
- 3
src/webviews/apps/shared/components/search/search-box.ts Vedi File

@ -57,8 +57,10 @@ const template = html`