Преглед на файлове

Updates search result count to show plus for more

main
Keith Daulton преди 2 години
committed by Eric Amodio
родител
ревизия
d5e7bea793
променени са 2 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. +3
    -0
      src/webviews/apps/plus/graph/GraphWrapper.tsx
  2. +5
    -3
      src/webviews/apps/shared/components/search/search-nav.ts

+ 3
- 0
src/webviews/apps/plus/graph/GraphWrapper.tsx Целия файл

@ -245,6 +245,7 @@ export function GraphWrapper({
const [searchValue, setSearchValue] = useState('');
const [searchResultKey, setSearchResultKey] = useState<string | undefined>(undefined);
const [searchIds, setSearchIds] = useState(searchResults?.ids);
const [hasMoreSearchIds, setHasMoreSearchIds] = useState(searchResults?.paging?.more ?? false);
useEffect(() => {
if (graphRows.length === 0) {
@ -358,6 +359,7 @@ export function GraphWrapper({
setIsPrivateRepo(state.selectedRepositoryVisibility === RepositoryVisibility.Private);
setIsLoading(state.loading);
setSearchIds(state.searchResults?.ids);
setHasMoreSearchIds(state.searchResults?.paging?.more ?? false);
}
useEffect(() => subscriber?.(transformData), []);
@ -599,6 +601,7 @@ export function GraphWrapper({
aria-label="Graph search navigation"
step={searchPosition}
total={searchIds?.length ?? 0}
more={hasMoreSearchIds}
onPrevious={() => handleSearchNavigation(false)}
onNext={() => handleSearchNavigation(true)}
/>

+ 5
- 3
src/webviews/apps/shared/components/search/search-nav.ts Целия файл

@ -7,9 +7,8 @@ const template = html`