@@ -71,6 +71,8 @@ interface ShotStatusClientProps {
|
||||
canManage: boolean;
|
||||
}
|
||||
|
||||
const SCROLL_KEY = 'shot-status-scroll';
|
||||
|
||||
const STATUS_CONFIG: Record<string, { label: string; color: string; icon: React.ElementType }> = {
|
||||
WAITING: { label: "Waiting", color: "bg-zinc-500/10 text-zinc-400 border-zinc-500/20", icon: Clock },
|
||||
IN_PROGRESS: { label: "In Progress", color: "bg-blue-500/10 text-blue-400 border-blue-500/20", icon: Film },
|
||||
@@ -341,6 +343,7 @@ function ShotTable({
|
||||
<Link
|
||||
href={`/projects/${projectId}/shots/${shot.id}`}
|
||||
className="font-mono text-sm text-white hover:text-blue-400 transition-colors"
|
||||
onClick={() => sessionStorage.setItem(SCROLL_KEY, String(window.scrollY))}
|
||||
>
|
||||
{shot.shotCode}
|
||||
</Link>
|
||||
@@ -399,6 +402,15 @@ export function ShotStatusClient({
|
||||
const router = useRouter();
|
||||
const { toast } = useToast();
|
||||
|
||||
// Restore scroll position when shots load
|
||||
useEffect(() => {
|
||||
const saved = sessionStorage.getItem(SCROLL_KEY);
|
||||
if (saved) {
|
||||
sessionStorage.removeItem(SCROLL_KEY);
|
||||
requestAnimationFrame(() => window.scrollTo(0, parseInt(saved, 10)));
|
||||
}
|
||||
}, [shots]);
|
||||
|
||||
// Restore last selected project if no project is currently selected
|
||||
useEffect(() => {
|
||||
if (!selectedProjectId) {
|
||||
|
||||
Reference in New Issue
Block a user