Skip to content

Commit 0d0418c

Browse files
committed
fix: replace fake "100%" scan progress with honest indeterminate bar
The percentage was scannedCount/totalDirs, but both counters grow together as folders are discovered, so it pinned at ~100% the entire scan. A real percentage is impossible without pre-enumerating the tree. Show a live folder count + animated indeterminate bar + current path instead.
1 parent b057065 commit 0d0418c

2 files changed

Lines changed: 25 additions & 14 deletions

File tree

‎src/renderer/App.css‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,19 @@ body {
1818
html.dark {
1919
color-scheme: dark;
2020
}
21+
22+
/* Indeterminate progress bar — the total is unknowable during a recursive
23+
scan, so animate a sliding segment instead of showing a fake percentage. */
24+
.indeterminate-bar {
25+
width: 40%;
26+
animation: indeterminate-slide 1.2s ease-in-out infinite;
27+
}
28+
29+
@keyframes indeterminate-slide {
30+
0% {
31+
margin-left: -40%;
32+
}
33+
100% {
34+
margin-left: 100%;
35+
}
36+
}

‎src/renderer/App.tsx‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,15 @@ function App() {
136136

137137
{scanning && scanProgress && (
138138
<div className="p-6 border-b border-slate-200 dark:border-slate-700">
139-
<div className="flex items-center gap-4">
140-
<div className="flex-1">
141-
<div className="text-sm font-medium mb-2">
142-
Scanning: {scanProgress.percentage}%
143-
</div>
144-
<div className="w-full bg-slate-200 dark:bg-slate-700 rounded-full h-2">
145-
<div
146-
className="bg-blue-600 h-2 rounded-full transition-all"
147-
style={{ width: `${scanProgress.percentage}%` }}
148-
/>
149-
</div>
150-
<div className="text-xs text-slate-600 dark:text-slate-400 mt-2">
151-
{scanProgress.currentPath}
152-
</div>
139+
<div className="flex-1 min-w-0">
140+
<div className="text-sm font-medium mb-2">
141+
Scanning… {scanProgress.current.toLocaleString()} folders
142+
</div>
143+
<div className="w-full bg-slate-200 dark:bg-slate-700 rounded-full h-2 overflow-hidden">
144+
<div className="indeterminate-bar h-2 rounded-full bg-blue-600" />
145+
</div>
146+
<div className="text-xs text-slate-600 dark:text-slate-400 mt-2 truncate">
147+
{scanProgress.currentPath}
153148
</div>
154149
</div>
155150
</div>

0 commit comments

Comments
 (0)