|
197 | 197 | // Computed values for selection summary |
198 | 198 | const selectedFiles = $derived(stats?.selectedFiles ?? 0) |
199 | 199 | const selectedDirs = $derived(stats?.selectedDirs ?? 0) |
200 | | - const selectedFileSize = $derived(stats?.selectedFileSize ?? 0) |
| 200 | + const selectedSize = $derived(stats?.selectedSize ?? 0) |
201 | 201 | const totalFiles = $derived(stats?.totalFiles ?? 0) |
202 | 202 | const totalDirs = $derived(stats?.totalDirs ?? 0) |
203 | | - const totalFileSize = $derived(stats?.totalFileSize ?? 0) |
| 203 | + const totalSize = $derived(stats?.totalSize ?? 0) |
204 | 204 |
|
205 | 205 | const hasFiles = $derived(totalFiles > 0) |
206 | 206 | const hasDirs = $derived(totalDirs > 0) |
|
209 | 209 | // When directories are selected during scanning, sizes might be incomplete |
210 | 210 | const showSelectionStale = $derived(scanning && selectedDirs > 0) |
211 | 211 |
|
212 | | - const sizePercentage = $derived(calculatePercentage(selectedFileSize, totalFileSize)) |
213 | | - const filePercentage = $derived(calculatePercentage(selectedFiles, totalFiles)) |
214 | | - const dirPercentage = $derived(calculatePercentage(selectedDirs, totalDirs)) |
| 212 | + const sizePercentage = $derived(calculatePercentage(selectedSize, totalSize)) |
215 | 213 |
|
216 | 214 | // Size triads for selection summary |
217 | | - const selectedSizeTriads = $derived(formatSizeTriads(selectedFileSize)) |
218 | | - const totalSizeTriads = $derived(formatSizeTriads(totalFileSize)) |
| 215 | + const selectedSizeTriads = $derived(formatSizeTriads(selectedSize)) |
| 216 | + const totalSizeTriads = $derived(formatSizeTriads(totalSize)) |
219 | 217 |
|
220 | 218 | // Tooltip with human-readable sizes |
221 | 219 | const selectionSizeTooltip = $derived( |
222 | | - hasFiles ? `${formatFileSize(selectedFileSize)} of ${formatFileSize(totalFileSize)}` : undefined, |
| 220 | + totalSize > 0 ? `${formatFileSize(selectedSize)} of ${formatFileSize(totalSize)}` : undefined, |
223 | 221 | ) |
224 | 222 | </script> |
225 | 223 |
|
|
256 | 254 | <span class="summary-text" use:tooltip={selectionSizeTooltip}> |
257 | 255 | {#if hasOnlyDirs} |
258 | 256 | <!-- Only dirs, no files --> |
| 257 | + {#if totalSize > 0} |
| 258 | + {#each selectedSizeTriads as triad, i (i)}<span class={triad.tierClass}>{triad.value}</span>{/each} |
| 259 | + of |
| 260 | + {#each totalSizeTriads as triad, i (i)}<span class={triad.tierClass}>{triad.value}</span>{/each} |
| 261 | + ({sizePercentage}%) selected in |
| 262 | + {/if} |
259 | 263 | {formatNumber(selectedDirs)} of {formatNumber(totalDirs)} |
260 | | - {pluralize(totalDirs, 'dir', 'dirs')} ({dirPercentage}%) selected. |
| 264 | + {pluralize(totalDirs, 'dir', 'dirs')}{#if totalSize === 0} |
| 265 | + selected{/if}. |
261 | 266 | {#if showSelectionStale} |
262 | 267 | <span class="stale-indicator" use:tooltip={'Might be outdated. Currently scanning...'}>⚠️</span> |
263 | 268 | {/if} |
|
267 | 272 | of |
268 | 273 | {#each totalSizeTriads as triad, i (i)}<span class={triad.tierClass}>{triad.value}</span>{/each} |
269 | 274 | ({sizePercentage}%) selected in {formatNumber(selectedFiles)} of {formatNumber(totalFiles)} |
270 | | - {pluralize(totalFiles, 'file', 'files')} ({filePercentage}%){#if hasDirs} |
| 275 | + {pluralize(totalFiles, 'file', 'files')}{#if hasDirs} |
271 | 276 | and {formatNumber(selectedDirs)} of {formatNumber(totalDirs)} |
272 | | - {pluralize(totalDirs, 'dir', 'dirs')} ({dirPercentage}%){/if}. |
| 277 | + {pluralize(totalDirs, 'dir', 'dirs')}{/if}. |
273 | 278 | {#if showSelectionStale} |
274 | 279 | <span class="stale-indicator" use:tooltip={'Might be outdated. Currently scanning...'}>⚠️</span> |
275 | 280 | {/if} |
|
0 commit comments