Pinned progress bar to 100% for sessions that can't provide timeline info ('Compact' theme)

This commit is contained in:
nutty
2026-08-16 17:22:21 +10:00
parent 539a1aebf3
commit abff66d3e2
+10 -9
View File
@@ -102,19 +102,20 @@ function SetProgressInfo(timelineProps, currentPositionMs, accentColorPalette) {
// Ensure we don't divide by zero or exceed 100% // Ensure we don't divide by zero or exceed 100%
const durationMs = timelineProps.EndTime; const durationMs = timelineProps.EndTime;
// If the duration is 0, that means the session isn't returning any timeline info, so just put the progress at 100%
if (durationMs <= 0 || !showProgressBar)
{
progressBarTrack.style.display = 'none';
return;
}
else
progressBarTrack.style.display = '';
// Calculate the progress percentage // Calculate the progress percentage
let progressPercent = durationMs > 0 ? (currentPositionMs / durationMs) * 100 : 0; let progressPercent = durationMs > 0 ? (currentPositionMs / durationMs) * 100 : 0;
progressPercent = Math.min(100, Math.max(0, progressPercent)); progressPercent = Math.min(100, Math.max(0, progressPercent));
// If the duration is 0, that means the session isn't returning any timeline info, so just put the progress at 100%
if (durationMs <= 0 || !showProgressBar)
// {
// progressBarTrack.style.display = 'none';
// return;
// }
// else
// progressBarTrack.style.display = '';
progressPercent = 100;
// Calculate how much needs to be hidden (the right-side offset) // Calculate how much needs to be hidden (the right-side offset)
const clipRight = 100 - progressPercent; const clipRight = 100 - progressPercent;