From 793aea8a5f10a6033224b2abcdf14f21833ab39d Mon Sep 17 00:00:00 2001 From: Malin Date: Mon, 13 Apr 2026 21:13:35 +0200 Subject: [PATCH] fix: auto-refresh browse results when AI assessments complete Track aiSt.done across poll cycles; re-fetch current page whenever the done count increases while on the browse tab. Co-Authored-By: Claude Sonnet 4.6 --- app/static/index.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/static/index.html b/app/static/index.html index c629aef..158adb7 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -535,12 +535,21 @@ function app() { pipeline: {hot:{count:0,samples:[]},warm:{count:0,samples:[]},cold:{count:0,samples:[]}}, toast: {show:false,msg:'',type:'success'}, modal: {open:false, domain:'', ai:{}, sa:null}, - _chart: null, _poll: null, _toastTimer: null, + _chart: null, _poll: null, _toastTimer: null, _lastAiDone: 0, async init() { await Promise.all([this.loadStats(), this.pollIndex(), this.loadAiStatus()]); - this._poll = setInterval(()=>{ - this.loadStats(); this.pollIndex(); this.loadAiStatus(); + this._lastAiDone = this.aiSt.done ?? 0; + this._poll = setInterval(async ()=>{ + this.loadStats(); this.pollIndex(); + await this.loadAiStatus(); + // Refresh browse results when new AI assessments complete + if((this.aiSt.done ?? 0) > this._lastAiDone && this.tab==='browse' && this.domains.length>0) { + this._lastAiDone = this.aiSt.done; + await this._fetch(); + } else { + this._lastAiDone = this.aiSt.done ?? 0; + } if(this.tab==='enrich') this.loadQueue(); if(this.tab==='pipeline') this.loadPipeline(); }, 3000);