techfreakworm commited on
Commit
990fcda
·
unverified ·
1 Parent(s): de7d60a

fix(ui): stop wavesurfer controls + timestamps disappearing during re-render

Browse files

Switched from clipping the inner wavesurfer wrappers (which hid the
1:00 timestamp + play/skip/forward controls during transient
re-renders) to clipping only at the outer .ams-out-audio panel and
the canvas itself. Inner .component-wrapper / .controls / .timestamps
now render freely.

Plus min-height reserved on .timestamps (24px) and .controls (60px)
so neither collapses to zero while wavesurfer is recalculating its
grid layout. Without this reservation, the user sees the play
controls vanish + reappear when the URL bar shows/hides on mobile
or any other viewport-height tick triggers a wavesurfer reflow.

Files changed (1) hide show
  1. theme.py +36 -4
theme.py CHANGED
@@ -492,20 +492,35 @@ main, .contain {{
492
  }}
493
  .ams-content .ams-out-audio {{
494
  min-height:90px !important;
495
- /* Wavesurfer's waveform renders one pixel per audio frame at the
496
- ``minPxPerSec`` rate; for a 60 s clip that can exceed the
497
- column's width. Cage it so it can't push the parent wider. */
 
498
  min-width:0 !important;
499
  max-width:100% !important;
500
  overflow:hidden !important;
501
  }}
502
- .ams-content .ams-out-audio .component-wrapper,
 
 
 
 
 
 
 
 
 
 
 
 
503
  .ams-content .ams-out-audio .waveform-container,
504
  .ams-content .ams-out-audio [data-testid^="waveform"],
505
  .ams-content .ams-out-audio #waveform {{
506
  width:100% !important;
507
  max-width:100% !important;
508
  min-width:0 !important;
 
 
509
  overflow:hidden !important;
510
  }}
511
  /* Wavesurfer renders a <canvas> sized in CSS pixels from the audio
@@ -514,6 +529,23 @@ main, .contain {{
514
  .ams-content .ams-out-audio wave {{
515
  max-width:100% !important;
516
  }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
517
  .ams-content .ams-out-meta {{
518
  min-height:80px !important;
519
  font-family: {FONT_MONO} !important;
 
492
  }}
493
  .ams-content .ams-out-audio {{
494
  min-height:90px !important;
495
+ /* Outer panel: cage everything so a long-clip wavesurfer canvas
496
+ can't push the parent column wider than the viewport. The inner
497
+ wavesurfer layout below is allowed to render freely we only
498
+ clip at THIS boundary. */
499
  min-width:0 !important;
500
  max-width:100% !important;
501
  overflow:hidden !important;
502
  }}
503
+ /* Inner wavesurfer wrappers: let them lay out their grid/flex children
504
+ freely. Earlier we set ``overflow: hidden`` on these too, which
505
+ hid the play/skip controls + 1:00 timestamp during transient
506
+ wavesurfer re-renders (controls would briefly compute wider than
507
+ the wrapper and get clipped → user saw the "fluctuating" preview).
508
+ Width / max-width caps remain so the layout still respects the
509
+ viewport. */
510
+ .ams-content .ams-out-audio .component-wrapper {{
511
+ width:100% !important;
512
+ max-width:100% !important;
513
+ min-width:0 !important;
514
+ overflow:visible !important;
515
+ }}
516
  .ams-content .ams-out-audio .waveform-container,
517
  .ams-content .ams-out-audio [data-testid^="waveform"],
518
  .ams-content .ams-out-audio #waveform {{
519
  width:100% !important;
520
  max-width:100% !important;
521
  min-width:0 !important;
522
+ /* Clip the canvas only — keep the wave bars from spilling but let
523
+ the parent containers show their controls. */
524
  overflow:hidden !important;
525
  }}
526
  /* Wavesurfer renders a <canvas> sized in CSS pixels from the audio
 
529
  .ams-content .ams-out-audio wave {{
530
  max-width:100% !important;
531
  }}
532
+ /* Reserve vertical space for the timestamps row and the controls
533
+ row so they NEVER collapse to zero during a wavesurfer re-render
534
+ transition. Without this min-height, the play/skip/forward icons
535
+ briefly vanish on mobile after a generation completes, giving the
536
+ "preview is fluctuating" look. */
537
+ .ams-content .ams-out-audio .timestamps {{
538
+ min-height:24px !important;
539
+ overflow:visible !important;
540
+ }}
541
+ .ams-content .ams-out-audio .controls {{
542
+ min-height:60px !important;
543
+ overflow:visible !important;
544
+ }}
545
+ .ams-content .ams-out-audio .play-pause-wrapper,
546
+ .ams-content .ams-out-audio .control-wrapper {{
547
+ min-width:0 !important;
548
+ }}
549
  .ams-content .ams-out-meta {{
550
  min-height:80px !important;
551
  font-family: {FONT_MONO} !important;