Collapseable Comments section
Deploy / deploy (push) Successful in 2m43s

This commit is contained in:
twotalesanimation
2026-07-15 02:22:19 +02:00
parent b390c0bb35
commit c6c1c4c370
+29 -2
View File
@@ -33,9 +33,12 @@ import {
XCircle, XCircle,
AlertCircle, AlertCircle,
ChevronDown, ChevronDown,
ChevronRight,
ChevronLeft,
ArrowLeft, ArrowLeft,
Film, Film,
ShieldCheck, ShieldCheck,
MessageSquare,
} from "lucide-react"; } from "lucide-react";
interface ReviewPageClientProps { interface ReviewPageClientProps {
@@ -120,6 +123,7 @@ export function ReviewPageClient({
const [isSubmittingApproval, setIsSubmittingApproval] = useState(false); const [isSubmittingApproval, setIsSubmittingApproval] = useState(false);
const [isInternallyApproving, setIsInternallyApproving] = useState(false); const [isInternallyApproving, setIsInternallyApproving] = useState(false);
const [showVersions, setShowVersions] = useState(false); const [showVersions, setShowVersions] = useState(false);
const [commentsOpen, setCommentsOpen] = useState(true);
const playerRef = useRef<ReviewPlayerRef>(null); const playerRef = useRef<ReviewPlayerRef>(null);
const { toast } = useToast(); const { toast } = useToast();
@@ -343,8 +347,30 @@ export function ReviewPageClient({
/> />
</div> </div>
{/* Comment panel — 30%, min 280px */} {/* Comment panel — collapsible */}
<div className="w-80 xl:w-96 shrink-0 flex flex-col border-l border-border"> <div
className={cn(
"shrink-0 flex flex-col border-l border-border transition-all duration-200",
commentsOpen ? "w-80 xl:w-96" : "w-10"
)}
>
{/* Collapse toggle */}
<button
onClick={() => setCommentsOpen((o) => !o)}
className="flex items-center justify-center h-10 w-full border-b border-border hover:bg-muted/50 transition-colors shrink-0"
title={commentsOpen ? "Collapse comments" : "Expand comments"}
>
{commentsOpen ? (
<ChevronRight className="h-4 w-4 text-muted-foreground" />
) : (
<ChevronLeft className="h-4 w-4 text-muted-foreground" />
)}
{!commentsOpen && (
<MessageSquare className="h-4 w-4 text-muted-foreground mt-1" />
)}
</button>
{commentsOpen && (
<CommentPanel <CommentPanel
versionId={version.id} versionId={version.id}
fps={version.fps} fps={version.fps}
@@ -357,6 +383,7 @@ export function ReviewPageClient({
currentUserId={currentUserId} currentUserId={currentUserId}
isAdmin={userRole === "ADMIN"} isAdmin={userRole === "ADMIN"}
/> />
)}
</div> </div>
</div> </div>