(modelRefs, batchSize = 20)
| 11342 | pendingTagData = []; |
| 11343 | } catch (error) { |
| 11344 | console.error('Error applying tags:', error); |
| 11345 | await window.electron.showMessage('Error', 'Failed to apply tags: ' + error.message); |
| 11346 | } |
| 11347 | }); |
| 11348 | |
| 11349 | document.getElementById('tag-preview-dialog')?.addEventListener('close', () => { |
| 11350 | suppressTagPreviewReopen = true; |
| 11351 | reviewDialogOpen = false; |
| 11352 | pendingTagData = []; |
| 11353 | batchTagGenerationInProgress = false; |
| 11354 | rateLimitDialogShown = false; |
| 11355 | }); |
| 11356 | |
| 11357 | document.getElementById('tag-preview-cancel')?.addEventListener('click', () => { |
| 11358 | document.getElementById('tag-preview-dialog')?.close(); |
| 11359 | }); |
| 11360 | |
| 11361 | // Add handlers for progress dialog |
| 11362 | window.electron.on('show-progress-dialog', (data) => { |
| 11363 | const progressDialog = document.getElementById('progress-dialog'); |
| 11364 | const progressTitle = document.getElementById('progress-title'); |
| 11365 | const progressMessage = document.getElementById('progress-message'); |
| 11366 | const progressBar = document.getElementById('progress-bar'); |
| 11367 | const progressStatus = document.getElementById('progress-status'); |
| 11368 | |
| 11369 | // Set initial values |
| 11370 | progressTitle.textContent = data.title || 'Processing...'; |
| 11371 | progressMessage.textContent = data.message || 'Please wait...'; |
| 11372 | progressBar.style.width = '0%'; |
| 11373 | progressStatus.textContent = `0 / ${data.total}`; |
| 11374 | |
| 11375 | // Show the dialog |
| 11376 | progressDialog.showModal(); |
| 11377 | }); |
| 11378 | |
| 11379 | window.electron.on('update-progress', (data) => { |
| 11380 | const progressBar = document.getElementById('progress-bar'); |
| 11381 | const progressMessage = document.getElementById('progress-message'); |
| 11382 | const progressStatus = document.getElementById('progress-status'); |
| 11383 | |
| 11384 | // Update progress bar |
| 11385 | const percentage = (data.current / data.total) * 100; |
| 11386 | progressBar.style.width = `${percentage}%`; |
| 11387 | |
| 11388 | // Update message and status |
| 11389 | if (data.message) { |
| 11390 | progressMessage.textContent = data.message; |
| 11391 | } |
| 11392 | progressStatus.textContent = `${data.current} / ${data.total}`; |
| 11393 | }); |
| 11394 | |
| 11395 | window.electron.on('close-progress-dialog', () => { |
| 11396 | const progressDialog = document.getElementById('progress-dialog'); |
| 11397 | progressDialog.close(); |
| 11398 | }); |
| 11399 | |
| 11400 | // Listen for tag generation progress updates and update a progress bar |
| 11401 | window.electron.on('tag-generation-progress', (completed, total) => { |
no test coverage detected