Skip to content

Commit 8b420ad

Browse files
committed
fix: disable sorting in table in general search page
1 parent 68ae9df commit 8b420ad

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

app/components/Package/List.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const props = defineProps<{
3939
paginationMode?: PaginationMode
4040
/** Current page (1-indexed) for paginated mode */
4141
currentPage?: number
42+
/** When true, shows search-specific UI (relevance sort, no filters) */
43+
searchContext?: boolean
4244
}>()
4345
4446
const emit = defineEmits<{
@@ -60,7 +62,11 @@ const sortOption = defineModel<SortOption>('sortOption')
6062
6163
// View mode and columns
6264
const viewMode = computed(() => props.viewMode ?? 'cards')
63-
const columns = computed(() => props.columns ?? DEFAULT_COLUMNS)
65+
const columns = computed(() => {
66+
const targetColumns = props.columns ?? DEFAULT_COLUMNS
67+
if (props.searchContext) return targetColumns.map(column => ({ ...column, sortable: false }))
68+
return targetColumns
69+
})
6470
// Table view forces pagination mode (no virtualization for tables)
6571
const paginationMode = computed(() =>
6672
viewMode.value === 'table' ? 'paginated' : (props.paginationMode ?? 'infinite'),

app/pages/search.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ defineOgImageComponent('Default', {
737737
v-if="displayResults.length > 0"
738738
:results="displayResults"
739739
:search-query="query"
740+
search-context
740741
heading-level="h2"
741742
show-publisher
742743
:has-more="hasMore"

0 commit comments

Comments
 (0)