@@ -66,6 +66,12 @@ window.MaxExtensionFloatingPanel.startQueue = function () {
6666 }
6767 this . isQueueRunning = true ;
6868 logConCgp ( '[queue-engine] Queue started.' ) ;
69+
70+ // Show progress bar container when queue starts
71+ if ( this . queueProgressContainer ) {
72+ this . queueProgressContainer . style . display = 'block' ;
73+ }
74+
6975 this . updateQueueControlsState ( ) ;
7076 this . processNextQueueItem ( ) ;
7177} ;
@@ -80,6 +86,14 @@ window.MaxExtensionFloatingPanel.pauseQueue = function () {
8086 this . queueTimerId = null ;
8187 }
8288 logConCgp ( '[queue-engine] Queue paused.' ) ;
89+
90+ // Freeze the progress bar
91+ if ( this . queueProgressBar ) {
92+ const computedWidth = window . getComputedStyle ( this . queueProgressBar ) . width ;
93+ this . queueProgressBar . style . transition = 'none' ;
94+ this . queueProgressBar . style . width = computedWidth ;
95+ }
96+
8397 this . updateQueueControlsState ( ) ;
8498} ;
8599
@@ -90,6 +104,16 @@ window.MaxExtensionFloatingPanel.resetQueue = function () {
90104 this . pauseQueue ( ) ; // Stop any running timers and set isQueueRunning to false
91105 this . promptQueue = [ ] ;
92106 logConCgp ( '[queue-engine] Queue reset.' ) ;
107+
108+ // Hide and reset progress bar
109+ if ( this . queueProgressBar ) {
110+ this . queueProgressBar . style . transition = 'none' ;
111+ this . queueProgressBar . style . width = '100%' ;
112+ }
113+ if ( this . queueProgressContainer ) {
114+ this . queueProgressContainer . style . display = 'none' ;
115+ }
116+
93117 this . renderQueueDisplay ( ) ;
94118 this . updateQueueControlsState ( ) ; // This will disable buttons as needed
95119} ;
@@ -138,10 +162,34 @@ window.MaxExtensionFloatingPanel.processNextQueueItem = function () {
138162 logConCgp ( `[queue-engine] Waiting for ${ delayMin } minutes before next item.` ) ;
139163 }
140164
165+ // Start the progress bar animation
166+ if ( this . queueProgressBar ) {
167+ // Reset to full width instantly, then start the transition
168+ this . queueProgressBar . style . transition = 'none' ;
169+ this . queueProgressBar . style . width = '100%' ;
170+
171+ // Force reflow to apply the reset before starting transition
172+ setTimeout ( ( ) => {
173+ this . queueProgressBar . style . transition = `width ${ delayMs / 1000 } s linear` ;
174+ this . queueProgressBar . style . width = '0%' ;
175+ } , 20 ) ;
176+ }
177+
141178 this . queueTimerId = setTimeout ( ( ) => this . processNextQueueItem ( ) , delayMs ) ;
142179 } else {
143180 logConCgp ( '[queue-engine] All items have been sent.' ) ;
144181 this . pauseQueue ( ) ; // Queue finished, so pause/stop
182+
183+ // Hide progress bar after a short delay to let animation finish
184+ setTimeout ( ( ) => {
185+ if ( this . queueProgressContainer && ! this . isQueueRunning ) {
186+ this . queueProgressContainer . style . display = 'none' ;
187+ if ( this . queueProgressBar ) {
188+ this . queueProgressBar . style . transition = 'none' ;
189+ this . queueProgressBar . style . width = '100%' ;
190+ }
191+ }
192+ } , 1000 ) ; // Wait 1 second after finish to hide
145193 }
146194} ;
147195
0 commit comments