Skip to content

Commit c88d331

Browse files
committed
Include total estimated time on folders and improve UI on mobile devices
1 parent c80cf24 commit c88d331

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

public/app.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,12 +498,21 @@ function computeFolderTimeEstimate(node) {
498498
}
499499
}
500500

501+
let activeElapsed = 0;
502+
for (const job of activeJobs) {
503+
if (job.startedAt) {
504+
activeElapsed += Date.now() - job.startedAt;
505+
}
506+
}
507+
501508
const estimatedRemaining = activeRemaining + queuedEstimate;
509+
const estimatedTotal = totalElapsed + activeElapsed + estimatedRemaining;
502510
const remainingCount = activeJobs.length + queuedJobs.length;
503511

504512
return {
505513
totalElapsed,
506514
estimatedRemaining,
515+
estimatedTotal,
507516
avgPerEpisode,
508517
doneCount: doneJobs.length,
509518
remainingCount,
@@ -519,10 +528,11 @@ function renderFolderTimeEstimate(node) {
519528
const parts = [];
520529

521530
if (est.remainingCount > 0 && est.doneCount > 0) {
522-
// Still encoding (show remaining estimate)
531+
// Still encoding (show estimated total and remaining)
532+
parts.push(`~${formatDurationShort(est.estimatedTotal)} total`);
523533
parts.push(`~${formatDurationShort(est.estimatedRemaining)} remaining`);
524534
} else if (est.remainingCount === 0 && est.doneCount > 0) {
525-
// All done (show total time)
535+
// All done (show actual total time)
526536
parts.push(`Total: ${formatDurationShort(est.totalElapsed)}`);
527537
}
528538

public/style.css

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,17 @@ code {
868868
margin-left: 10px;
869869
}
870870
.folder-header {
871+
flex-wrap: wrap;
871872
padding: 10px 12px;
872-
gap: 8px;
873+
gap: 6px;
874+
}
875+
.folder-left {
876+
flex: 1 1 100%;
877+
min-width: 0;
878+
}
879+
.folder-right {
880+
flex: 1 1 100%;
881+
align-items: flex-start;
873882
}
874883
.folder-stats {
875884
gap: 4px;
@@ -879,7 +888,11 @@ code {
879888
padding: 2px 5px;
880889
}
881890
.folder-progress {
882-
width: 80px;
891+
width: 100%;
892+
}
893+
.folder-time-estimate {
894+
font-size: 0.58rem;
895+
text-align: left;
883896
}
884897
.folder-time-estimate {
885898
font-size: 0.58rem;

0 commit comments

Comments
 (0)