Ver código fonte

Adds jump to last match support in Graph

main
Eric Amodio 2 anos atrás
pai
commit
4fc4a30910
2 arquivos alterados com 22 adições e 14 exclusões
  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 Ver arquivo

@ -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 Ver arquivo

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