From ecaa9630551867344855ca9c762687ded53e2beb Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Sun, 7 Jun 2026 14:39:21 +0200 Subject: [PATCH] table displays and memory --- .../projects/[id]/ProjectTabsClient.tsx | 21 +++++++++++++----- .../shot-status/ShotStatusClient.tsx | 22 ++++++++++++++++--- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/app/(dashboard)/projects/[id]/ProjectTabsClient.tsx b/app/(dashboard)/projects/[id]/ProjectTabsClient.tsx index 716531a..309928f 100644 --- a/app/(dashboard)/projects/[id]/ProjectTabsClient.tsx +++ b/app/(dashboard)/projects/[id]/ProjectTabsClient.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState, useTransition } from "react"; +import { useState, useTransition, useEffect } from "react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { ShotCard } from "@/components/shots/ShotCard"; @@ -89,8 +89,16 @@ export function ProjectTabsClient({ const [showImportShots, setShowImportShots] = useState(false); const [showNewAsset, setShowNewAsset] = useState(false); const [showNewTask, setShowNewTask] = useState(false); - const [collapsedEpisodes, setCollapsedEpisodes] = useState>(new Set()); + const [expandedEpisodes, setExpandedEpisodes] = useState>(new Set()); const [editingEpisode, setEditingEpisode] = useState(null); + + // Load saved episode expand state from localStorage on mount + useEffect(() => { + try { + const saved = localStorage.getItem(`project:${projectId}:episodeExpand`); + if (saved) setExpandedEpisodes(new Set(JSON.parse(saved) as string[])); + } catch {} + }, [projectId]); const [episodeDateInput, setEpisodeDateInput] = useState(""); const [isPendingDate, startDateTransition] = useTransition(); @@ -118,9 +126,12 @@ export function ProjectTabsClient({ }; const toggleEpisode = (ep: string) => - setCollapsedEpisodes((prev) => { + setExpandedEpisodes((prev) => { const next = new Set(prev); next.has(ep) ? next.delete(ep) : next.add(ep); + try { + localStorage.setItem(`project:${projectId}:episodeExpand`, JSON.stringify([...next])); + } catch {} return next; }); @@ -243,7 +254,7 @@ export function ProjectTabsClient({ ) : projectType === "EPISODIC" ? (
{episodeGroups.map(([episode, episodeShots]) => { - const collapsed = collapsedEpisodes.has(episode); + const collapsed = !expandedEpisodes.has(episode); const dueDate = episodeDueDateMap.get(episode); const isOverdue = dueDate && dueDate < new Date(); const isEditing = editingEpisode === episode; @@ -350,7 +361,7 @@ export function ProjectTabsClient({ ) : standardGroups.length > 0 ? (
{standardGroups.map(([groupName, groupShots]) => { - const collapsed = collapsedEpisodes.has(groupName); + const collapsed = !expandedEpisodes.has(groupName); return (