fix: preserve update version subtitle
Keep the available target version visible throughout download, verification, cancellation, and failure states while reserving the progress footer for runtime status. Add the requested emphasis to the update dialog heading.
This commit is contained in:
+2
-8
@@ -7478,7 +7478,7 @@ function showUpdateBanner(info) {
|
|||||||
const notes = document.getElementById('updateReleaseNotes');
|
const notes = document.getElementById('updateReleaseNotes');
|
||||||
const notesBody = document.getElementById('updateReleaseNotesBody');
|
const notesBody = document.getElementById('updateReleaseNotesBody');
|
||||||
const installButton = document.getElementById('installUpdateBtn');
|
const installButton = document.getElementById('installUpdateBtn');
|
||||||
if (title) title.textContent = 'Eine neue Version ist verfügbar';
|
if (title) title.textContent = 'Eine neue Version ist verfügbar!';
|
||||||
if (message) {
|
if (message) {
|
||||||
message.textContent = `Update v${version} verfügbar`;
|
message.textContent = `Update v${version} verfügbar`;
|
||||||
message.hidden = false;
|
message.hidden = false;
|
||||||
@@ -7502,43 +7502,38 @@ function handleUpdateProgress(data) {
|
|||||||
const progress = data || {};
|
const progress = data || {};
|
||||||
const message = document.getElementById('updateMessage');
|
const message = document.getElementById('updateMessage');
|
||||||
const button = document.getElementById('installUpdateBtn');
|
const button = document.getElementById('installUpdateBtn');
|
||||||
|
if (message) message.hidden = false;
|
||||||
if (progress.stage === 'starting') {
|
if (progress.stage === 'starting') {
|
||||||
_updateInstallBusy = true;
|
_updateInstallBusy = true;
|
||||||
_setUpdateDialogBusy(true, true);
|
_setUpdateDialogBusy(true, true);
|
||||||
_setUpdateProgress(0, 'Download 0%', 'downloading');
|
_setUpdateProgress(0, 'Download 0%', 'downloading');
|
||||||
if (message) message.hidden = true;
|
|
||||||
if (button) button.textContent = 'Download 0%';
|
if (button) button.textContent = 'Download 0%';
|
||||||
} else if (progress.stage === 'downloading') {
|
} else if (progress.stage === 'downloading') {
|
||||||
const percent = Math.max(0, Math.min(100, Math.round(Number(progress.percent) || 0)));
|
const percent = Math.max(0, Math.min(100, Math.round(Number(progress.percent) || 0)));
|
||||||
_updateInstallBusy = true;
|
_updateInstallBusy = true;
|
||||||
_setUpdateDialogBusy(true, true);
|
_setUpdateDialogBusy(true, true);
|
||||||
_setUpdateProgress(percent, `Download ${percent}%`, 'downloading');
|
_setUpdateProgress(percent, `Download ${percent}%`, 'downloading');
|
||||||
if (message) message.hidden = true;
|
|
||||||
if (button) button.textContent = `Download ${percent}%`;
|
if (button) button.textContent = `Download ${percent}%`;
|
||||||
} else if (progress.stage === 'verifying') {
|
} else if (progress.stage === 'verifying') {
|
||||||
_updateInstallBusy = true;
|
_updateInstallBusy = true;
|
||||||
_setUpdateDialogBusy(true, false);
|
_setUpdateDialogBusy(true, false);
|
||||||
_setUpdateProgress(100, 'Prüfen…', 'verifying');
|
_setUpdateProgress(100, 'Prüfen…', 'verifying');
|
||||||
if (message) message.hidden = true;
|
|
||||||
if (button) button.textContent = 'Prüfen…';
|
if (button) button.textContent = 'Prüfen…';
|
||||||
} else if (progress.stage === 'prepared') {
|
} else if (progress.stage === 'prepared') {
|
||||||
_updateInstallBusy = true;
|
_updateInstallBusy = true;
|
||||||
_setUpdateDialogBusy(true, false);
|
_setUpdateDialogBusy(true, false);
|
||||||
_setUpdateProgress(100, 'Neustart…', 'prepared');
|
_setUpdateProgress(100, 'Neustart…', 'prepared');
|
||||||
if (message) message.hidden = true;
|
|
||||||
if (button) button.textContent = 'Neustart…';
|
if (button) button.textContent = 'Neustart…';
|
||||||
} else if (progress.stage === 'launching' || progress.stage === 'done') {
|
} else if (progress.stage === 'launching' || progress.stage === 'done') {
|
||||||
_updateInstallBusy = true;
|
_updateInstallBusy = true;
|
||||||
_setUpdateDialogBusy(true, false);
|
_setUpdateDialogBusy(true, false);
|
||||||
_setUpdateProgress(100, 'Neustart…', 'prepared');
|
_setUpdateProgress(100, 'Neustart…', 'prepared');
|
||||||
if (message) message.hidden = true;
|
|
||||||
if (button) button.textContent = 'Neustart…';
|
if (button) button.textContent = 'Neustart…';
|
||||||
} else if (progress.stage === 'aborted') {
|
} else if (progress.stage === 'aborted') {
|
||||||
_updateInstallBusy = false;
|
_updateInstallBusy = false;
|
||||||
_setUpdateDialogBusy(false);
|
_setUpdateDialogBusy(false);
|
||||||
const currentProgress = Number(document.getElementById('updateProgressBar')?.getAttribute('aria-valuenow')) || 0;
|
const currentProgress = Number(document.getElementById('updateProgressBar')?.getAttribute('aria-valuenow')) || 0;
|
||||||
_setUpdateProgress(currentProgress, 'Download abgebrochen', 'aborted');
|
_setUpdateProgress(currentProgress, 'Download abgebrochen', 'aborted');
|
||||||
if (message) message.hidden = true;
|
|
||||||
if (button) {
|
if (button) {
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
button.textContent = 'Wiederholen';
|
button.textContent = 'Wiederholen';
|
||||||
@@ -7550,7 +7545,6 @@ function handleUpdateProgress(data) {
|
|||||||
const currentProgress = Number(document.getElementById('updateProgressBar')?.getAttribute('aria-valuenow')) || 0;
|
const currentProgress = Number(document.getElementById('updateProgressBar')?.getAttribute('aria-valuenow')) || 0;
|
||||||
const errorText = `Update fehlgeschlagen: ${String(progress.error || 'Unbekannter Fehler').slice(0, 400)}`;
|
const errorText = `Update fehlgeschlagen: ${String(progress.error || 'Unbekannter Fehler').slice(0, 400)}`;
|
||||||
_setUpdateProgress(currentProgress, errorText, 'error');
|
_setUpdateProgress(currentProgress, errorText, 'error');
|
||||||
if (message) message.hidden = true;
|
|
||||||
if (button) {
|
if (button) {
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
button.textContent = 'Wiederholen';
|
button.textContent = 'Wiederholen';
|
||||||
|
|||||||
+1
-1
@@ -104,7 +104,7 @@
|
|||||||
['Hilfe', 'Help'],
|
['Hilfe', 'Help'],
|
||||||
['Log-Ordner öffnen', 'Open log folder'],
|
['Log-Ordner öffnen', 'Open log folder'],
|
||||||
['Diagnose-Paket exportieren', 'Export diagnostics package'],
|
['Diagnose-Paket exportieren', 'Export diagnostics package'],
|
||||||
['Eine neue Version ist verfügbar', 'A new version is available'],
|
['Eine neue Version ist verfügbar!', 'A new version is available!'],
|
||||||
['Bereit zum Download', 'Ready to download'],
|
['Bereit zum Download', 'Ready to download'],
|
||||||
['Abbrechen', 'Cancel'],
|
['Abbrechen', 'Cancel'],
|
||||||
['Jetzt installieren', 'Install now'],
|
['Jetzt installieren', 'Install now'],
|
||||||
|
|||||||
+1
-1
@@ -150,7 +150,7 @@
|
|||||||
<svg><use href="#icon-download"></use></svg>
|
<svg><use href="#icon-download"></use></svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="update-dialog-copy">
|
<div class="update-dialog-copy">
|
||||||
<h2 id="updateDialogTitle">Eine neue Version ist verfügbar</h2>
|
<h2 id="updateDialogTitle">Eine neue Version ist verfügbar!</h2>
|
||||||
<p id="updateMessage"></p>
|
<p id="updateMessage"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="update-release-notes" id="updateReleaseNotes" hidden>
|
<div class="update-release-notes" id="updateReleaseNotes" hidden>
|
||||||
|
|||||||
+4
-4
@@ -2441,7 +2441,7 @@ setTimeout(async () => {
|
|||||||
await captureVisual('05-update.png');
|
await captureVisual('05-update.png');
|
||||||
|
|
||||||
const updateDialogCopy = await wc.executeJavaScript('(() => { const title = document.getElementById("updateDialogTitle")?.textContent?.trim(); const message = document.getElementById("updateMessage")?.textContent?.trim(); return [title, message].join("|"); })()');
|
const updateDialogCopy = await wc.executeJavaScript('(() => { const title = document.getElementById("updateDialogTitle")?.textContent?.trim(); const message = document.getElementById("updateMessage")?.textContent?.trim(); return [title, message].join("|"); })()');
|
||||||
check('Update dialog names the available version', updateDialogCopy === 'Eine neue Version ist verfügbar|Update v9.9.9 verfügbar');
|
check('Update dialog names the available version', updateDialogCopy === 'Eine neue Version ist verfügbar!|Update v9.9.9 verfügbar');
|
||||||
|
|
||||||
const updateDialogActions = await wc.executeJavaScript('[document.getElementById("dismissUpdateBtn")?.textContent?.trim(), document.getElementById("installUpdateBtn")?.textContent?.trim()].join("|")');
|
const updateDialogActions = await wc.executeJavaScript('[document.getElementById("dismissUpdateBtn")?.textContent?.trim(), document.getElementById("installUpdateBtn")?.textContent?.trim()].join("|")');
|
||||||
check('Update dialog offers cancel and install actions', updateDialogActions === 'Abbrechen|Jetzt installieren');
|
check('Update dialog offers cancel and install actions', updateDialogActions === 'Abbrechen|Jetzt installieren');
|
||||||
@@ -2486,10 +2486,10 @@ setTimeout(async () => {
|
|||||||
check('Busy update keeps its progress dialog open with a dangerous download cancellation action', busyUpdateState.display === 'flex' && busyUpdateState.hidden === 'false' && busyUpdateState.closeDisabled === true && busyUpdateState.dismissDisabled === false && busyUpdateState.dismissText === 'Download abbrechen' && busyUpdateState.dismissDanger === true && busyUpdateState.headerHidden === false);
|
check('Busy update keeps its progress dialog open with a dangerous download cancellation action', busyUpdateState.display === 'flex' && busyUpdateState.hidden === 'false' && busyUpdateState.closeDisabled === true && busyUpdateState.dismissDisabled === false && busyUpdateState.dismissText === 'Download abbrechen' && busyUpdateState.dismissDanger === true && busyUpdateState.headerHidden === false);
|
||||||
check('Update progress exposes an accessible live value', busyUpdateState.progressLabel === 'Update-Fortschritt' && busyUpdateState.progressText === 'Download 50%');
|
check('Update progress exposes an accessible live value', busyUpdateState.progressLabel === 'Update-Fortschritt' && busyUpdateState.progressText === 'Download 50%');
|
||||||
check('Update download progress is green, wide, and places its status below the line', busyUpdateState.progressState === 'downloading' && busyUpdateState.progressColor === 'rgb(117, 211, 155)' && busyUpdateState.progressTrackWidth >= 390 && busyUpdateState.progressTextTop >= busyUpdateState.progressTrackBottom);
|
check('Update download progress is green, wide, and places its status below the line', busyUpdateState.progressState === 'downloading' && busyUpdateState.progressColor === 'rgb(117, 211, 155)' && busyUpdateState.progressTrackWidth >= 390 && busyUpdateState.progressTextTop >= busyUpdateState.progressTrackBottom);
|
||||||
check('Busy update shows progress only below the bar', busyUpdateState.messageHidden === true && busyUpdateState.messageText === 'Update v9.9.9 verfügbar');
|
check('Busy update preserves the available version subtitle while progress stays below the bar', busyUpdateState.messageHidden === false && busyUpdateState.messageText === 'Update v9.9.9 verfügbar');
|
||||||
|
|
||||||
const updateErrorRecovery = await wc.executeJavaScript('handleUpdateProgress({ stage: "aborted", error: "Update abgebrochen" }); (() => { const bar = document.getElementById("updateProgressBar"); const state = [bar.style.width, bar.dataset.state, getComputedStyle(bar).backgroundColor, document.getElementById("updateMessage").hidden].join("|"); document.getElementById("dismissUpdateBtn").click(); return state + "|" + document.getElementById("updateBanner").style.display + "|" + document.getElementById("updateCloseBtn").disabled + "|" + document.getElementById("dismissUpdateBtn").disabled + "|" + document.getElementById("headerUpdateBtn").hidden; })()');
|
const updateErrorRecovery = await wc.executeJavaScript('handleUpdateProgress({ stage: "aborted", error: "Update abgebrochen" }); (() => { const bar = document.getElementById("updateProgressBar"); const state = [bar.style.width, bar.dataset.state, getComputedStyle(bar).backgroundColor, document.getElementById("updateMessage").hidden, document.getElementById("updateMessage").textContent].join("|"); document.getElementById("dismissUpdateBtn").click(); return state + "|" + document.getElementById("updateBanner").style.display + "|" + document.getElementById("updateCloseBtn").disabled + "|" + document.getElementById("dismissUpdateBtn").disabled + "|" + document.getElementById("headerUpdateBtn").hidden; })()');
|
||||||
check('Canceled updates show one status, preserve progress in red, and restore close actions', updateErrorRecovery === '50%|aborted|rgb(255, 133, 140)|true|none|false|false|false');
|
check('Canceled updates preserve the version subtitle, show one red status, and restore close actions', updateErrorRecovery === '50%|aborted|rgb(255, 133, 140)|false|Update v9.9.9 verfügbar|none|false|false|false');
|
||||||
|
|
||||||
const initialInstallUpdateHandler = initialIpcHandlers.get('app:install-update');
|
const initialInstallUpdateHandler = initialIpcHandlers.get('app:install-update');
|
||||||
const initialUpdateQueueHandler = initialIpcHandlers.get('save-pending-queue');
|
const initialUpdateQueueHandler = initialIpcHandlers.get('save-pending-queue');
|
||||||
|
|||||||
Reference in New Issue
Block a user