浏览代码

Adds jump to last match support in Graph

main
Eric Amodio 2 年前
父节点
当前提交
4fc4a30910
共有 2 个文件被更改,包括 22 次插入14 次删除
  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 查看文件

@ -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 查看文件

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