|
|
@@ -48,6 +48,7 @@ export default function ReviewPage() {
|
|
|
const [submitting, setSubmitting] = useState(false);
|
|
|
const [replyTo, setReplyTo] = useState<Comment | null>(null);
|
|
|
const [showResolved, setShowResolved] = useState(false);
|
|
|
+ const [showDeleted, setShowDeleted] = useState(false);
|
|
|
const [showShareModal, setShowShareModal] = useState(false);
|
|
|
|
|
|
// Drawing state — lifted to page level
|
|
|
@@ -160,7 +161,7 @@ export default function ReviewPage() {
|
|
|
try {
|
|
|
const [{ asset: a }, { comments: c }] = await Promise.all([
|
|
|
assetsApi.get(token, assetId),
|
|
|
- commentsApi.list(token, assetId),
|
|
|
+ commentsApi.list(token, assetId, undefined, true),
|
|
|
]);
|
|
|
setAsset(a);
|
|
|
setComments(c);
|
|
|
@@ -375,7 +376,10 @@ export default function ReviewPage() {
|
|
|
: '';
|
|
|
|
|
|
const allComments = comments.flatMap(c => [c, ...(c.replies ?? [])]);
|
|
|
- const visibleComments = comments.filter(c => !c.deleted && (showResolved || !c.resolved));
|
|
|
+ const visibleComments = comments.filter(c =>
|
|
|
+ (showDeleted || !c.deleted) && (showResolved || !c.resolved)
|
|
|
+ );
|
|
|
+ const deletedCount = comments.filter(c => c.deleted).length;
|
|
|
|
|
|
// Seek to previous/next comment (defined here so they can reference visibleComments)
|
|
|
const handlePrevComment = useCallback(() => {
|
|
|
@@ -996,6 +1000,9 @@ export default function ReviewPage() {
|
|
|
<span className="text-xs px-1.5 py-0.5 rounded-full"
|
|
|
style={{ background: 'rgba(255,255,255,0.06)', color: 'var(--text-muted)' }}>
|
|
|
{comments.length}
|
|
|
+ {comments.length !== visibleComments.length && (
|
|
|
+ <span className="ml-1 opacity-60">/ {visibleComments.length}</span>
|
|
|
+ )}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div className="flex items-center gap-2">
|
|
|
@@ -1009,6 +1016,16 @@ export default function ReviewPage() {
|
|
|
>
|
|
|
{showResolved ? 'Hide resolved' : 'Show resolved'}
|
|
|
</button>
|
|
|
+ {isProjectAdmin && deletedCount > 0 && (
|
|
|
+ <button
|
|
|
+ onClick={() => setShowDeleted(v => !v)}
|
|
|
+ className={`text-[11px] px-2 py-0.5 rounded-md transition-colors ${showDeleted ? 'bg-red-600 text-white' : ''}`}
|
|
|
+ style={!showDeleted ? { background: 'rgba(239,68,68,0.12)', color: '#FCA5A5' } : {}}
|
|
|
+ title="Toggle deleted comments"
|
|
|
+ >
|
|
|
+ {showDeleted ? 'Hide deleted' : `${deletedCount} deleted`}
|
|
|
+ </button>
|
|
|
+ )}
|
|
|
<button
|
|
|
onClick={() => setCommentPanelCollapsed(v => !v)}
|
|
|
className="text-[11px] px-2 py-0.5 rounded-md transition-colors"
|
|
|
@@ -1019,11 +1036,11 @@ export default function ReviewPage() {
|
|
|
>
|
|
|
<svg className="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
|
|
|
{commentPanelCollapsed ? (
|
|
|
- // Chevron right — panel is collapsed to the right
|
|
|
- <path strokeLinecap="round" strokeLinejoin="round" d="M9 5l7 7-7 7" />
|
|
|
- ) : (
|
|
|
- // Chevron left — panel is expanded
|
|
|
+ // Chevron left — clicking expands the panel (panel slides in from right)
|
|
|
<path strokeLinecap="round" strokeLinejoin="round" d="M15 19l-7-7 7-7" />
|
|
|
+ ) : (
|
|
|
+ // Chevron right — clicking collapses the panel (panel slides out to right)
|
|
|
+ <path strokeLinecap="round" strokeLinejoin="round" d="M9 5l7 7-7 7" />
|
|
|
)}
|
|
|
</svg>
|
|
|
</button>
|