# Shot Table Enhanced Specification - 2024 Update
## Overview
This specification documents the comprehensive shot table implementation with all recent enhancements and improvements. The shot table provides a powerful, feature-rich interface for managing shots with task status tracking, advanced filtering, sorting, and bulk operations.
## Current Implementation Status
### ✅ Completed Features
1. **TanStack Table Integration** - Modern, performant table implementation
2. **Directional Sort Icons** - Visual feedback for sort direction (up/down arrows)
3. **Column Visibility Control** - Unified popover pattern matching task page
4. **Task Status Filtering** - Advanced multi-select popover with search
5. **Toolbar Restructuring** - Consistent layout matching task page structure
6. **Full Width Layout** - Optimized screen space utilization
7. **Cascade Deletion** - Safe shot deletion with task confirmation
8. **Custom Status Support** - Integration with project-specific task statuses
9. **Enhanced UI Components** - Consistent heights and icon-only buttons
10. **Independent Frames Column** - Separate frame count display
## User Stories
### User Story 1: Enhanced Shot Table Display
**As a** coordinator
**I want** to view shots in a comprehensive table with advanced features
**So that** I can efficiently manage shot production with full visibility
**Acceptance Criteria:**
1. ✅ WHEN viewing shots, THE system SHALL display a table with sortable columns showing directional sort icons
2. ✅ WHEN sorting columns, THE system SHALL show up arrow for ascending, down arrow for descending, and up-down arrow for no sort
3. ✅ WHEN displaying frame information, THE system SHALL show both frame range (1001-1120) and frame count (120) in separate columns
4. ✅ WHEN viewing task statuses, THE system SHALL display custom project statuses with correct names and colors
5. ✅ WHEN the table loads, THE system SHALL use full screen width for optimal space utilization
### User Story 2: Advanced Filtering and Search
**As a** user
**I want** sophisticated filtering options with visual feedback
**So that** I can quickly find relevant shots
**Acceptance Criteria:**
1. ✅ WHEN using task status filter, THE system SHALL provide a popover with multi-select checkboxes
2. ✅ WHEN filtering by status, THE system SHALL show search functionality within the filter
3. ✅ WHEN filters are active, THE system SHALL display a badge counter showing number of active filters
4. ✅ WHEN using search, THE system SHALL position the search field on the right side of the toolbar
5. ✅ WHEN episode filtering, THE system SHALL provide a popover dropdown in the toolbar
### User Story 3: Consistent UI and Layout
**As a** user
**I want** consistent interface elements across all pages
**So that** I have a familiar and predictable experience
**Acceptance Criteria:**
1. ✅ WHEN viewing the toolbar, THE system SHALL ensure all components have consistent 32px height
2. ✅ WHEN using action buttons, THE system SHALL display icons only without text labels
3. ✅ WHEN accessing filters, THE system SHALL use the same popover + command pattern as task page
4. ✅ WHEN viewing the toolbar structure, THE system SHALL match the task page layout exactly
5. ✅ WHEN using column visibility, THE system SHALL provide the same interface as other data tables
### User Story 4: Safe Deletion with Cascade Confirmation
**As a** coordinator
**I want** comprehensive deletion confirmation with task details
**So that** I can safely delete shots while understanding the impact
**Acceptance Criteria:**
1. ✅ WHEN deleting a shot, THE system SHALL show a confirmation dialog with all associated tasks
2. ✅ WHEN viewing task details in deletion dialog, THE system SHALL display task status using TaskStatusBadge component
3. ✅ WHEN confirming deletion, THE system SHALL require typing the shot name for confirmation
4. ✅ WHEN deletion is confirmed, THE system SHALL cascade delete all associated tasks
5. ✅ WHEN deletion completes, THE system SHALL show success message with count of deleted tasks
### User Story 5: Custom Status Integration
**As a** project manager
**I want** custom task statuses to display correctly throughout the interface
**So that** project-specific workflows are properly supported
**Acceptance Criteria:**
1. ✅ WHEN viewing task statuses, THE system SHALL fetch and display custom project statuses
2. ✅ WHEN showing status badges, THE system SHALL use correct custom status names and colors
3. ✅ WHEN filtering by status, THE system SHALL include both system and custom statuses
4. ✅ WHEN displaying status in dialogs, THE system SHALL use the enhanced TaskStatusBadge component
5. ✅ WHEN status data is unavailable, THE system SHALL gracefully fall back to string display
## Technical Implementation
### Component Architecture
```
ShotBrowser.vue (Main Container)
├── ShotTableToolbar.vue (Sticky Toolbar)
│ ├── Episode Filter (Popover)
│ ├── Task Status Filter (Popover + Command)
│ ├── Column Visibility (Popover + Command)
│ ├── Search Input (Right-aligned)
│ └── Action Buttons (Icon-only)
├── ShotsDataTable.vue (TanStack Table)
│ └── columns.ts (Column Definitions)
└── ShotDeleteConfirmDialog.vue (Enhanced Deletion)
└── TaskStatusBadge.vue (Status Display)
```
### Key Technical Features
#### 1. TanStack Table Integration
- **Type Safety**: Full TypeScript support with proper column definitions
- **Performance**: Optimized rendering for large datasets
- **Sorting**: Built-in sorting with directional icons
- **Column Management**: Robust show/hide functionality
- **State Management**: Proper sorting and visibility state handling
#### 2. Enhanced Column Definitions
```typescript
// Directional sort icons
const getSortIcon = (sortDirection: false | 'asc' | 'desc') => {
if (sortDirection === 'asc') return h(ArrowUp, { class: 'ml-2 h-4 w-4' })
if (sortDirection === 'desc') return h(ArrowDown, { class: 'ml-2 h-4 w-4' })
return h(ArrowUpDown, { class: 'ml-2 h-4 w-4' })
}
// Independent frames column
{
accessorKey: 'frame_end',
id: 'frames',
header: ({ column }) => h(Button, {
variant: 'ghost',
onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'),
}, () => ['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())
},
}
```
#### 3. Advanced Filtering System
```vue