Skip to content

Commit c54a0c0

Browse files
fix(ui): yolo shows incorrect results
1 parent 6a44d71 commit c54a0c0

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

app/components/PaginationControls.vue

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,17 @@ const effectiveMode = computed<PaginationMode>(() =>
2323
)
2424
2525
// When 'all' is selected, there's only 1 page with everything
26-
const isShowingAll = computed(() => pageSize.value === 'all')
27-
const totalPages = computed(() =>
28-
isShowingAll.value ? 1 : Math.ceil(props.totalItems / (pageSize.value as number)),
29-
)
26+
const totalPages = computed(() => Math.ceil(props.totalItems / (pageSize.value as number)))
3027
3128
// Whether to show the mode toggle (hidden in table view since table always uses pagination)
3229
const showModeToggle = computed(() => props.viewMode !== 'table')
3330
3431
const startItem = computed(() => {
3532
if (props.totalItems === 0) return 0
36-
if (isShowingAll.value) return 1
3733
return (currentPage.value - 1) * (pageSize.value as number) + 1
3834
})
3935
4036
const endItem = computed(() => {
41-
if (isShowingAll.value) return props.totalItems
4237
return Math.min(currentPage.value * (pageSize.value as number), props.totalItems)
4338
})
4439
@@ -159,10 +154,7 @@ function handlePageSizeChange(event: Event) {
159154
@change="handlePageSizeChange"
160155
:items="
161156
PAGE_SIZE_OPTIONS.map(size => ({
162-
label:
163-
size === 'all'
164-
? $t('filters.pagination.all_yolo')
165-
: $t('filters.pagination.per_page', { count: size }),
157+
label: $t('filters.pagination.per_page', { count: size }),
166158
value: String(size),
167159
}))
168160
"

shared/types/preferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export const DEFAULT_FILTERS: StructuredFilters = {
279279
// Pagination modes
280280
export type PaginationMode = 'infinite' | 'paginated'
281281

282-
export const PAGE_SIZE_OPTIONS = [10, 25, 50, 100, 'all'] as const
282+
export const PAGE_SIZE_OPTIONS = [10, 25, 50, 100, 250] as const
283283
export type PageSize = (typeof PAGE_SIZE_OPTIONS)[number]
284284

285285
// Complete preferences state

0 commit comments

Comments
 (0)