Skip to content

Commit 109b59a

Browse files
patconclaude
andcommitted
feat: show KNN graph phase before iteration progress bar
While status is running but no progress tick has arrived yet, the dialog shows "Building KNN graph…" with a pulse animation. Once the first progress message lands the bar replaces it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0e79416 commit 109b59a

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/components/convo-explorer/RecomputeProjectionDialog.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,23 @@ export const RecomputeProjectionDialog: React.FC<RecomputeProjectionDialogProps>
179179

180180
{isRunning && (
181181
<div className="flex flex-col gap-1">
182-
<div className="h-2 w-full overflow-hidden rounded-full bg-muted">
183-
<div
184-
className="h-full bg-blue-600 transition-all duration-300"
185-
style={{ width: `${Math.round((progress ?? 0) * 100)}%` }}
186-
/>
187-
</div>
188-
<p className="text-xs text-muted-foreground text-right">
189-
{Math.round((progress ?? 0) * 100)}%
190-
</p>
182+
{progress === null ? (
183+
<p className="text-xs text-muted-foreground animate-pulse">
184+
Building KNN graph…
185+
</p>
186+
) : (
187+
<>
188+
<div className="h-2 w-full overflow-hidden rounded-full bg-muted">
189+
<div
190+
className="h-full bg-blue-600 transition-all duration-300"
191+
style={{ width: `${Math.round(progress * 100)}%` }}
192+
/>
193+
</div>
194+
<p className="text-xs text-muted-foreground text-right">
195+
{Math.round(progress * 100)}%
196+
</p>
197+
</>
198+
)}
191199
</div>
192200
)}
193201

src/hooks/useDruidWorker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function useDruidWorker(): DruidWorkerState {
6969
setStatus("running");
7070
setResult(null);
7171
setError(null);
72-
setProgress(0);
72+
// progress stays null until first tick — signals KNN graph is building
7373
const request: ReducerRequest = { type: "reduce", matrix, algorithm, params };
7474
getWorker().postMessage(request);
7575
},

0 commit comments

Comments
 (0)