feat: 升级插件至 V1.0、更新全新Logo、调整采集梯度(50/100/200)并支持页面浮窗与弹窗双重进度可视化

This commit is contained in:
喻长发
2026-09-15 14:19:38 +08:00
parent 2c8e7a5435
commit a7f496e635
32 changed files with 4135 additions and 16 deletions
+37
View File
@@ -49,6 +49,42 @@ function renderReviewStatus(lp,show){
livePreview.innerHTML=(lp.preview||[]).map((value,index)=>`<div>${index+1}. ${escapeHtml(value)}</div>`).join('')||'等待评论数据…';
}
function updateCollectSteps(state, progress, reviewLive) {
const stepInfo = byId('stepInfo');
const stepParams = byId('stepParams');
const stepReviews = byId('stepReviews');
const stepReport = byId('stepReport');
if (!stepInfo) return;
const isCollecting = state === 'collecting' || state === 'collecting_reviews';
const isAnalyzing = state === 'sending' || state === 'analyzing';
const isCompleted = state === 'analysis_completed';
stepInfo.classList.toggle('done', progress >= 15 || isAnalyzing || isCompleted);
stepInfo.classList.toggle('active', progress < 15 && isCollecting);
stepParams.classList.toggle('done', progress >= 25 || isAnalyzing || isCompleted);
stepParams.classList.toggle('active', progress >= 15 && progress < 25 && isCollecting);
stepReviews.classList.toggle('done', progress >= 75 || isAnalyzing || isCompleted);
stepReviews.classList.toggle('active', state === 'collecting_reviews' || (progress >= 25 && progress < 75 && isCollecting));
stepReport.classList.toggle('done', isCompleted);
stepReport.classList.toggle('active', isAnalyzing);
const liveBadge = byId('liveReviewBadge');
if (liveBadge) {
if (state === 'collecting_reviews' && reviewLive) {
liveBadge.style.display = 'inline-block';
const cap = reviewLive.reviewCap || (collectionMode==='quick'?50:collectionMode==='full'?200:100);
liveBadge.textContent = String(reviewLive.count || 0) + " / " + String(cap) + " 条";
} else {
liveBadge.style.display = 'none';
}
}
}
function renderTaskStatus(data){
const d=data||{};
const state=d.state||'idle';
@@ -82,6 +118,7 @@ function renderTaskStatus(data){
phaseLabel.textContent=phaseMap[state]||'任务处理中';
statusCard.dataset.state=reportReady?'completed':(analysisFailed||analysisBlocked)?'failed':analysisBusy?'analyzing':activeCollect?'collecting':'idle';
isAnalysisRunning=analysisBusy;
updateCollectSteps(state, progress, d.reviewLive);
updateRunButtonText(waitingForReviews,false);
collectionControls.style.display=analysisBusy||reportReady?'none':'grid';