()
| 837 | } |
| 838 | window._runScanSTLHomeImpl = runScanSTLHomeImpl; |
| 839 | |
| 840 | // Add these queue-related variables |
| 841 | let renderQueue = []; |
| 842 | /** Lower values run first. Scan / off-grid work uses THUMB_PRIORITY_BACKGROUND so on-screen grid cells win. */ |
| 843 | const THUMB_PRIORITY_BACKGROUND = 1e12; |
| 844 | /** Priorities at or above this are off-viewport grid rows (see computeThumbPriorityForScroll / refresh). */ |
| 845 | const THUMB_PRIORITY_LOW_TIER_MIN = 2e9; |
| 846 | /** Extra delay after each low-priority render so visible/interactive work stays smooth. */ |
| 847 | let RENDER_DELAY_BACKGROUND = 750; |
| 848 | /** When the queue has only off-screen work, cap parallel WebGL thumbs (foreground uses MAX_CONCURRENT_RENDERS). */ |
| 849 | let MAX_CONCURRENT_RENDERS_BACKGROUND = 2; |
| 850 | let pendingThumbnails = new Set(); // Track files currently being rendered |
| 851 | |
| 852 | function isLowPriorityThumbnailTask(task) { |
| 853 | const p = task?.thumbPriority ?? THUMB_PRIORITY_BACKGROUND; |
| 854 | return p >= THUMB_PRIORITY_LOW_TIER_MIN; |
| 855 | } |
no outgoing calls
no test coverage detected