11<script setup lang="ts">
2- import type { FilterChip , SortOption } from ' #shared/types/preferences'
2+ import type { FilterChip } from ' #shared/types/preferences'
33import { onKeyDown } from ' @vueuse/core'
44import { debounce } from ' perfect-debounce'
55import { isValidNewPackageName , checkPackageExists } from ' ~/utils/package-name'
@@ -31,8 +31,6 @@ const updateUrlPage = debounce((page: number) => {
3131// The actual search query (from URL, used for API calls)
3232const query = computed (() => (route .query .q as string ) ?? ' ' )
3333
34- const packageListRef = useTemplateRef (' packageListRef' )
35-
3634// Track if page just loaded (for hiding "Searching..." during view transition)
3735const hasInteracted = shallowRef (false )
3836onMounted (() => {
@@ -91,10 +89,6 @@ watch(
9189 },
9290)
9391
94- const resultsMatchQuery = computed (() => {
95- return previousQuery .value === query .value
96- })
97-
9892// Results to display (directly from incremental search)
9993const rawVisibleResults = computed (() => results .value )
10094
@@ -158,7 +152,6 @@ const {
158152 toggleKeyword,
159153 clearFilter,
160154 clearAllFilters,
161- setSort,
162155} = useStructuredFilters ({
163156 packages: resultsArray ,
164157 initialSort: ' relevance-desc' , // Default to search relevance
@@ -182,11 +175,6 @@ function handleClearFilter(chip: FilterChip) {
182175 clearFilter (chip )
183176}
184177
185- // Handle sort change from table
186- function handleSortChange(option : SortOption ) {
187- setSort (option )
188- }
189-
190178// Should we show the loading spinner?
191179const showSearching = computed (() => {
192180 // Don't show during initial page load (view transition)
@@ -195,11 +183,6 @@ const showSearching = computed(() => {
195183 return status .value === ' pending' && displayResults .value .length === 0
196184})
197185
198- const totalPages = computed (() => {
199- if (! visibleResults .value ) return 0
200- return Math .ceil (visibleResults .value .total / pageSize )
201- })
202-
203186// Load more when triggered by infinite scroll
204187async function loadMore() {
205188 if (isLoadingMore .value || ! hasMore .value ) return
@@ -757,7 +740,6 @@ defineOgImageComponent('Default', {
757740
758741 <PackageList
759742 v-if =" displayResults.length > 0"
760- ref =" packageListRef"
761743 :results =" displayResults"
762744 :search-query =" query"
763745 heading-level =" h2"
0 commit comments