Optimize shot table loading performance
- Pass episode_id filter to backend API instead of client-side filtering, reducing payload size when an episode is selected - Skip getShot refetch in ShotDetailPanel when initialShot prop is provided - Fix redundant DB query in list_shots: read project.custom_task_statuses directly from the already-fetched project object - Add missing indexes on Task.shot_id, Task.assigned_user_id, Task.deleted_at and Episode.project_id; add add_perf_indexes.py migration script to apply them to existing databases - Center login page layout - Update CLAUDE.md and AGENTS.md with correct venv path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { RouteLocationNormalized } from 'vue-router'
|
||||
import { useProjectsStore } from '@/stores/projects'
|
||||
import { episodeService } from '@/services/episode'
|
||||
import { shotService } from '@/services/shot'
|
||||
|
||||
export interface BreadcrumbItem {
|
||||
label: string
|
||||
@@ -73,6 +74,30 @@ export class BreadcrumbService {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Handle shot detail page (path: /projects/:projectId/shots/:shotId)
|
||||
if (pathSegments[2] === 'shots' && pathSegments[3]) {
|
||||
const shotId = parseInt(pathSegments[3])
|
||||
if (!isNaN(shotId)) {
|
||||
try {
|
||||
const shot = await shotService.getShot(shotId)
|
||||
// Replace the last item (Shots) with Shots > ShotName
|
||||
if (crumbs.length > 1) {
|
||||
crumbs[crumbs.length - 1] = {
|
||||
label: 'Shots',
|
||||
href: `/projects/${projectId}/shots`
|
||||
}
|
||||
}
|
||||
crumbs.push({
|
||||
label: shot.name,
|
||||
isActive: true
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Failed to load shot for breadcrumbs:', error)
|
||||
// Keep the default behavior - show shot ID
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Handle other routes
|
||||
|
||||
Reference in New Issue
Block a user