|
12 | 12 | } from './selection-info-utils' |
13 | 13 | import { measureDateColumnWidth } from '../views/full-list-utils' |
14 | 14 | import { formatFileSize, formatDateTime, getSizeDisplayMode } from '$lib/settings/reactive-settings.svelte' |
15 | | - import { getDisplaySize, buildFileSizeTooltip, buildSelectionSizeTooltip } from '../views/full-list-utils' |
| 15 | + import { |
| 16 | + getDisplaySize, |
| 17 | + buildFileSizeTooltip, |
| 18 | + buildDirSizeTooltip, |
| 19 | + buildSelectionSizeTooltip, |
| 20 | + } from '../views/full-list-utils' |
16 | 21 | import { isScanning } from '$lib/indexing/index-state.svelte' |
17 | 22 | import { tooltip } from '$lib/tooltip/tooltip' |
18 | 23 | import { Hourglass } from '@lucide/svelte' |
|
66 | 71 | // File info mode (Brief mode without selection) |
67 | 72 | // ======================================================================== |
68 | 73 |
|
| 74 | + // Drive index scanning state — used for stale indicator when dirs are shown |
| 75 | + const scanning = $derived(isScanning()) |
| 76 | +
|
69 | 77 | const sizeDisplayMode = $derived(getSizeDisplayMode()) |
70 | 78 | const displayName = $derived(entry?.name ?? '') |
71 | 79 | const isDirectory = $derived(entry?.isDirectory ?? false) |
72 | 80 | const isBrokenSymlink = $derived(checkBrokenSymlink(entry)) |
73 | 81 | const isPermissionDenied = $derived(checkPermissionDenied(entry)) |
74 | | - const fileDisplaySize = $derived( |
75 | | - entry && !isDirectory ? getDisplaySize(entry.size, entry.physicalSize, sizeDisplayMode) : undefined, |
| 82 | + const displaySize = $derived( |
| 83 | + entry |
| 84 | + ? getDisplaySize( |
| 85 | + isDirectory ? entry.recursiveSize : entry.size, |
| 86 | + isDirectory ? entry.recursivePhysicalSize : entry.physicalSize, |
| 87 | + sizeDisplayMode, |
| 88 | + ) |
| 89 | + : undefined, |
76 | 90 | ) |
77 | | - const sizeDisplay = $derived(getSizeDisplay(entry, isBrokenSymlink, isPermissionDenied, fileDisplaySize)) |
| 91 | + const sizeDisplay = $derived(getSizeDisplay(entry, isBrokenSymlink, isPermissionDenied, displaySize)) |
78 | 92 | const sizeTooltip = $derived( |
79 | | - entry && !isDirectory ? buildFileSizeTooltip(entry.size, entry.physicalSize, formatFileSize) : undefined, |
| 93 | + entry |
| 94 | + ? isDirectory |
| 95 | + ? buildDirSizeTooltip( |
| 96 | + entry.recursiveSize, |
| 97 | + entry.recursivePhysicalSize, |
| 98 | + entry.recursiveFileCount ?? 0, |
| 99 | + entry.recursiveDirCount ?? 0, |
| 100 | + scanning, |
| 101 | + formatFileSize, |
| 102 | + formatNumber, |
| 103 | + pluralize, |
| 104 | + ) || undefined |
| 105 | + : buildFileSizeTooltip(entry.size, entry.physicalSize, formatFileSize) |
| 106 | + : undefined, |
80 | 107 | ) |
81 | 108 | // Use formatDateTime from reactive-settings for consistent date formatting with Full mode |
82 | 109 | const dateDisplay = $derived.by(() => { |
|
199 | 226 | // Selection summary mode |
200 | 227 | // ======================================================================== |
201 | 228 |
|
202 | | - // Drive index scanning state — used for stale indicator when dirs are selected |
203 | | - const scanning = $derived(isScanning()) |
204 | | -
|
205 | 229 | // Computed values for selection summary |
206 | 230 | const selectedFiles = $derived(stats?.selectedFiles ?? 0) |
207 | 231 | const selectedDirs = $derived(stats?.selectedDirs ?? 0) |
|
0 commit comments