fix: stabilize update telemetry layout
Render size, speed, and ETA in dedicated fixed-width columns with tabular numerals so rapidly changing values no longer shift neighboring metrics horizontally.
This commit is contained in:
+9
-2
@@ -7714,16 +7714,23 @@ function _setUpdateProgress(percent, text, state = 'ready') {
|
||||
function _setUpdateProgressDetails(progress) {
|
||||
const details = document.getElementById('updateProgressDetails');
|
||||
if (!details) return;
|
||||
const size = document.getElementById('updateProgressSize');
|
||||
const speed = document.getElementById('updateProgressSpeed');
|
||||
const eta = document.getElementById('updateProgressEta');
|
||||
const downloaded = Math.max(0, Number(progress?.bytesDownloaded) || 0);
|
||||
const total = Math.max(0, Number(progress?.bytesTotal) || 0);
|
||||
if (total <= 0) {
|
||||
details.textContent = '';
|
||||
if (size) size.textContent = '';
|
||||
if (speed) speed.textContent = '';
|
||||
if (eta) eta.textContent = '';
|
||||
details.hidden = true;
|
||||
return;
|
||||
}
|
||||
const bytesPerSecond = Math.max(0, Number(progress?.bytesPerSecond) || 0);
|
||||
const etaSeconds = Number.isFinite(Number(progress?.etaSeconds)) ? Math.max(0, Number(progress.etaSeconds)) : 0;
|
||||
details.textContent = `${formatSize(downloaded)} / ${formatSize(total)} · ${formatSize(bytesPerSecond)}/s · ETA ${formatTime(etaSeconds)}`;
|
||||
if (size) size.textContent = `${formatSize(downloaded)} / ${formatSize(total)}`;
|
||||
if (speed) speed.textContent = `${formatSize(bytesPerSecond)}/s`;
|
||||
if (eta) eta.textContent = `ETA ${formatTime(etaSeconds)}`;
|
||||
details.hidden = false;
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -162,7 +162,13 @@
|
||||
<div class="update-progress" aria-live="polite">
|
||||
<div class="update-progress-track"><span id="updateProgressBar" role="progressbar" aria-label="Update-Fortschritt" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-valuetext="0%"></span></div>
|
||||
<div class="update-progress-footer">
|
||||
<span id="updateProgressDetails" hidden></span>
|
||||
<span id="updateProgressDetails" hidden>
|
||||
<span id="updateProgressSize"></span>
|
||||
<span class="update-progress-separator" aria-hidden="true">·</span>
|
||||
<span id="updateProgressSpeed"></span>
|
||||
<span class="update-progress-separator" aria-hidden="true">·</span>
|
||||
<span id="updateProgressEta"></span>
|
||||
</span>
|
||||
<span id="updateProgressText"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+15
-2
@@ -2520,19 +2520,32 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; }
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
#updateProgressDetails {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
display: grid;
|
||||
grid-template-columns: 19ch auto 11ch auto 10ch;
|
||||
align-items: baseline;
|
||||
gap: 5px;
|
||||
color: var(--text-dim);
|
||||
font-size: 11px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 1.35;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.update-progress-separator {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#updateProgressSpeed,
|
||||
#updateProgressEta {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#updateProgressText {
|
||||
min-width: 34px;
|
||||
max-width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user