โœ… Shot Column Visibility Fix

FIXED: Column Visibility Control in ShotTableToolbar now properly shows all task type columns including custom task types.

๐Ÿ”ง Problem Identified

The issue was that allColumns was defined as a static array that used props.allTaskTypes at component initialization time. Since task types are loaded asynchronously, the initial allTaskTypes was empty, and the static array never updated when the task types were loaded.

Root Cause

๐Ÿ› ๏ธ Solution Applied

Changed allColumns from Static Array to Computed Property

// Before: Static array (non-reactive) const allColumns = [ { id: 'thumbnail', label: 'Thumbnail' }, { id: 'name', label: 'Shot Name' }, // ... other columns ...props.allTaskTypes.map(taskType => ({ id: taskType, label: taskType.charAt(0).toUpperCase() + taskType.slice(1) })) ]
// After: Computed property (reactive) const allColumns = computed(() => [ { id: 'thumbnail', label: 'Thumbnail' }, { id: 'name', label: 'Shot Name' }, // ... other columns ...props.allTaskTypes.map(taskType => ({ id: taskType, label: taskType.charAt(0).toUpperCase() + taskType.slice(1) })) ])

Updated hiddenColumnsCount Computed Property

// Before: Using static allColumns const hiddenColumnsCount = computed(() => { return allColumns.filter(col => props.columnVisibility[col.id] === false).length })
// After: Using computed allColumns.value const hiddenColumnsCount = computed(() => { return allColumns.value.filter(col => props.columnVisibility[col.id] === false).length })

๐ŸŽฏ Benefits of the Fix

๐Ÿ”„ Data Flow (Fixed)

  1. Component Initialization: ShotTableToolbar renders with empty allTaskTypes
  2. Computed Property: allColumns computed returns basic columns only
  3. Async Loading: ShotBrowser loads task types via API
  4. Prop Update: allTaskTypes prop updates with loaded task types
  5. Reactive Update: allColumns computed automatically recalculates
  6. UI Update: Column visibility popover shows all columns including custom types

๐Ÿงช Testing Scenarios

Test Cases to Verify

  1. Initial Load: Column visibility shows all standard columns
  2. After Task Types Load: Custom task type columns appear in visibility control
  3. Add Custom Task Type: New columns appear immediately in visibility control
  4. Remove Custom Task Type: Columns are removed from visibility control
  5. Column Toggle: All columns (standard + custom) can be toggled on/off

Expected Behavior

๐Ÿ“ Files Modified

frontend/src/components/shot/ShotTableToolbar.vue โ”œโ”€โ”€ Changed allColumns from static array to computed property โ”œโ”€โ”€ Updated hiddenColumnsCount to use allColumns.value โ””โ”€โ”€ Maintained existing template structure (no changes needed)
SUCCESS: Shot Column Visibility Control now properly displays all task type columns including custom task types. The fix ensures reactive updates when task types are loaded asynchronously.