feat: archive tasks (#232)
This commit is contained in:
@@ -36,6 +36,7 @@ import { hashDiff, normalizeDiffContent } from '@/components/review/types';
|
||||
import type { DiffComment } from '@/lib/diff/types';
|
||||
import { usePanelActions } from '@/hooks/use-panel-actions';
|
||||
import type { SelectedDiff } from './task-layout';
|
||||
import { useIsTaskArchived, ArchivedPanelPlaceholder } from './task-archived-context';
|
||||
|
||||
type TaskChangesPanelProps = {
|
||||
selectedDiff: SelectedDiff | null;
|
||||
@@ -49,6 +50,7 @@ const TaskChangesPanel = memo(function TaskChangesPanel({
|
||||
onClearSelected,
|
||||
onOpenFile: onOpenFileProp,
|
||||
}: TaskChangesPanelProps) {
|
||||
const isArchived = useIsTaskArchived();
|
||||
const { openFile: panelOpenFile } = usePanelActions();
|
||||
const handleOpenFile = onOpenFileProp ?? panelOpenFile;
|
||||
|
||||
@@ -297,6 +299,8 @@ const TaskChangesPanel = memo(function TaskChangesPanel({
|
||||
const totalCount = allFiles.length;
|
||||
const progressPercent = totalCount > 0 ? (reviewedCount / totalCount) * 100 : 0;
|
||||
|
||||
if (isArchived) return <ArchivedPanelPlaceholder />;
|
||||
|
||||
return (
|
||||
<PanelRoot>
|
||||
{/* Top bar */}
|
||||
|
||||
Reference in New Issue
Block a user