๐จ Critical: getSortIcon Function Was Corrupted
The autofix completely broke the sort icon logic:
โ BROKEN (after autofix):
if (sortDirection === 'asc') {
return h(ArrowUp, { class: 'ml-2 h-4 w-4' }) // โ
Correct
} else if (sortDirection === 'desc') {
return h(ArrowUp, { class: 'ml-2 h-4 w-4' }) // โ Wrong! Should be ArrowDown
} else {
return h(ArrowDown, { class: 'ml-2 h-4 w-4' }) // โ Wrong! Should be ArrowUpDown
}
This made all sort icons show incorrectly!
๐ง Fix Details
1. Sort Icons Fixed
const getSortIcon = (sortDirection: false | 'asc' | 'desc') => {
if (sortDirection === 'asc') {
return h(ArrowUp, { class: 'ml-2 h-4 w-4' }) // โ Ascending
} else if (sortDirection === 'desc') {
return h(ArrowDown, { class: 'ml-2 h-4 w-4' }) // โ Descending
} else {
return h(ArrowUpDown, { class: 'ml-2 h-4 w-4' }) // โ No sort
}
}
2. Frame Range Made Non-Sortable
{
id: 'frameRange',
header: 'Frame Range', // Simple string, no button
enableSorting: false, // Explicitly disabled
cell: ({ row }) => {
const shot = row.original
return h('span', { class: 'text-sm' }, `${shot.frame_start}-${shot.frame_end}`)
},
}
3. Frame Count Sorting Fixed
{
id: 'frames',
accessorFn: (row) => row.frame_end - row.frame_start + 1, // Sort by calculated count
header: ({ column }) => {
return h(Button, {
variant: 'ghost',
onClick: () => column.toggleSorting(column.getIsSorted() === 'desc'),
}, () => ['Frames', getSortIcon(column.getIsSorted())])
},
cell: ({ row }) => {
const frameCount = row.original.frame_end - row.original.frame_start + 1
return h('span', { class: 'text-sm font-medium' }, frameCount.toString())
},
}
๐ Frame Count Example
Frame Count sorting should work like this:
Shot A: frames 1001-1024 โ Count: 24 frames
Shot B: frames 2001-2120 โ Count: 120 frames
Shot C: frames 3001-3048 โ Count: 48 frames
Ascending sort by Frames: Shot A (24), Shot C (48), Shot B (120)
Descending sort by Frames: Shot B (120), Shot C (48), Shot A (24)
NOT sorting by end frame: 1024, 2120, 3048 โ
BUT sorting by count: 24, 48, 120 โ