Skip to content
2 changes: 1 addition & 1 deletion src/frontend/features/cleaner/cleaner-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function CleanerSection({

function confirmCleanup() {
if (report) {
startCleanup(useCleanerViewModelHook.viewModel);
void startCleanup(useCleanerViewModelHook.viewModel);
}
setShowConfirmDialog(false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/features/cleaner/cleaner.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type CleanerContextType = {
diskSpace: number;
sectionKeys: CleanerSectionKey[];
generateReport: (force?: boolean) => Promise<void>;
startCleanup: (viewModel: CleanerViewModel) => void;
startCleanup: (viewModel: CleanerViewModel) => Promise<void>;
stopCleanup: () => void;
setInitialCleaningState: () => void;
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function CleanupConfirmDialog({ isVisible, onConfirm, onCancel, useTransl
return (
<div className="fixed inset-0 z-50 flex items-center justify-center">
{/* Backdrop */}
<div className="bg-opacity-50 absolute inset-0 bg-black backdrop-blur-sm" onClick={onCancel} />
<div className="bg-opacity-50 absolute inset-0 bg-black backdrop-blur-sm" onClick={onCancel} aria-hidden="true" />

{/* Dialog */}
<div className="bg-surface relative mx-4 w-full max-w-md rounded-lg p-6 shadow-xl dark:bg-gray-800">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function CleanupSizeIndicator({ selectedSize, totalSize, segmentDetails,

acc.elements.push(
<path
key={index}
key={`segment-${index}`}
d="M 20 100 A 80 80 0 0 1 180 100"
fill="none"
stroke={segment.color}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function SectionDetailHeader({
return (
<div className="dark:bg-gray-5 flex items-center justify-between p-4">
<div className="flex items-center gap-3">
<div className="flex items-center gap-1 text-blue-600 hover:cursor-pointer dark:text-blue-400" onClick={onClose}>
<div className="flex items-center gap-1 text-blue-600 hover:cursor-pointer dark:text-blue-400" onClick={onClose} aria-hidden="true">
<CaretDoubleRight color="#0066ff" weight="bold" />
</div>
<h3 className="text-lg font-semibold text-gray-900 dark:text-gray-100">{sectionConfig[sectionName].name}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ export function SectionDetailMenu({
onToggleItem,
useTranslationContext,
}: Readonly<Props>) {
if (!sectionName) return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the props, sectionName is always defined.

const parentRef = useRef<HTMLDivElement>(null);

const sectionData = report[sectionName];
const sectionViewModel = viewModel[sectionName];
if (!sectionViewModel) return null;
const items = sectionData?.items || [];

const virtualizer = useVirtualizer({
count: items.length,
getScrollElement: () => parentRef.current,
estimateSize: () => 80,
overscan: 10,
});

const stats = getSectionStats({ viewModel: sectionViewModel, allItems: sectionData.items });

Expand All @@ -50,16 +57,6 @@ export function SectionDetailMenu({
}
}

const parentRef = useRef<HTMLDivElement>(null);
const items = sectionData.items;

const virtualizer = useVirtualizer({
count: items.length,
getScrollElement: () => parentRef.current,
estimateSize: () => 80,
overscan: 10,
});

return (
<div
className={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function SectionItem({

<div
className="flex flex-1 items-end justify-end"
aria-hidden="true"
onClick={(e) => {
e.stopPropagation();
onToggleSectionExpansion(sectionName);
Expand Down
Loading