refine: simplify update notifications
Open known updates directly without redundant searching or found toasts, retain failure and no-update feedback, and render the update dialog close action in red with a destructive hover state.
This commit is contained in:
+1
-3
@@ -840,12 +840,10 @@ async function requestUpdateCheck({ forceRefresh = true } = {}) {
|
|||||||
if (_updateCheckBusy) return null;
|
if (_updateCheckBusy) return null;
|
||||||
_updateCheckBusy = true;
|
_updateCheckBusy = true;
|
||||||
_syncHeaderUpdateState();
|
_syncHeaderUpdateState();
|
||||||
showCopyToast('Suche nach Updates…');
|
|
||||||
try {
|
try {
|
||||||
const result = await window.api.checkForUpdate({ forceRefresh });
|
const result = await window.api.checkForUpdate({ forceRefresh });
|
||||||
if (result && result.available) {
|
if (result && result.available) {
|
||||||
showUpdateBanner(result);
|
showUpdateBanner(result);
|
||||||
showCopyToast('Update gefunden!');
|
|
||||||
} else if (result && result.error) {
|
} else if (result && result.error) {
|
||||||
showCopyToast('Updateprüfung fehlgeschlagen');
|
showCopyToast('Updateprüfung fehlgeschlagen');
|
||||||
} else {
|
} else {
|
||||||
@@ -7436,7 +7434,7 @@ function setupListeners() {
|
|||||||
if (e.target.id === 'jobLogModal') hideJobLogModal();
|
if (e.target.id === 'jobLogModal') hideJobLogModal();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('headerUpdateBtn')?.addEventListener('click', requestUpdateCheck);
|
document.getElementById('headerUpdateBtn')?.addEventListener('click', () => requestUpdateCheck({ forceRefresh: false }));
|
||||||
document.getElementById('installUpdateBtn')?.addEventListener('click', installKnownUpdate);
|
document.getElementById('installUpdateBtn')?.addEventListener('click', installKnownUpdate);
|
||||||
document.getElementById('dismissUpdateBtn')?.addEventListener('click', handleUpdateDismiss);
|
document.getElementById('dismissUpdateBtn')?.addEventListener('click', handleUpdateDismiss);
|
||||||
document.getElementById('updateCloseBtn')?.addEventListener('click', closeUpdateDialog);
|
document.getElementById('updateCloseBtn')?.addEventListener('click', closeUpdateDialog);
|
||||||
|
|||||||
@@ -582,7 +582,6 @@
|
|||||||
['Speichern vor dem Beenden hat zu lange gedauert', 'Saving before quitting took too long'],
|
['Speichern vor dem Beenden hat zu lange gedauert', 'Saving before quitting took too long'],
|
||||||
['Stoppt nach aktiven Uploads...', 'Stopping after active uploads...'],
|
['Stoppt nach aktiven Uploads...', 'Stopping after active uploads...'],
|
||||||
['Suche nach Aktualisierungen…', 'Checking for updates…'],
|
['Suche nach Aktualisierungen…', 'Checking for updates…'],
|
||||||
['Suche nach Updates…', 'Checking for updates…'],
|
|
||||||
['System wird heruntergefahren in', 'System will shut down in'],
|
['System wird heruntergefahren in', 'System will shut down in'],
|
||||||
['Übernehmen', 'Apply'],
|
['Übernehmen', 'Apply'],
|
||||||
['Übersprungen', 'Skipped'],
|
['Übersprungen', 'Skipped'],
|
||||||
|
|||||||
+4
-4
@@ -2405,14 +2405,14 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; }
|
|||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--text-dim);
|
color: var(--danger);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.update-close-button:hover {
|
.update-close-button:hover {
|
||||||
border-color: var(--border);
|
border-color: transparent;
|
||||||
background: var(--bg-active);
|
background: var(--danger);
|
||||||
color: var(--text);
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.update-close-button svg {
|
.update-close-button svg {
|
||||||
|
|||||||
@@ -2445,6 +2445,8 @@ setTimeout(async () => {
|
|||||||
|
|
||||||
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');
|
||||||
|
const updateCloseColor = await wc.executeJavaScript('getComputedStyle(document.getElementById("updateCloseBtn")).color');
|
||||||
|
check('Update dialog exposes a red close action', updateCloseColor === 'rgb(255, 133, 140)');
|
||||||
const updateDialogChangelog = await wc.executeJavaScript('(() => { const title = document.querySelector(".update-release-notes-title"); const body = document.getElementById("updateReleaseNotesBody"); const titleRect = title?.getBoundingClientRect(); const bodyRect = body?.getBoundingClientRect(); return { hidden: document.getElementById("updateReleaseNotes")?.hidden, title: title?.textContent?.trim(), body: body?.textContent, gap: bodyRect && titleRect ? bodyRect.top - titleRect.bottom : null }; })()');
|
const updateDialogChangelog = await wc.executeJavaScript('(() => { const title = document.querySelector(".update-release-notes-title"); const body = document.getElementById("updateReleaseNotesBody"); const titleRect = title?.getBoundingClientRect(); const bodyRect = body?.getBoundingClientRect(); return { hidden: document.getElementById("updateReleaseNotes")?.hidden, title: title?.textContent?.trim(), body: body?.textContent, gap: bodyRect && titleRect ? bodyRect.top - titleRect.bottom : null }; })()');
|
||||||
check('Update dialog renders a compact normalized changelog', updateDialogChangelog.hidden === false && updateDialogChangelog.title === 'Changelog' && updateDialogChangelog.body === 'New in this version\\n\\nMenus and navigation\\n\\n• Added live language switching.\\n• Improved settings layout.' && updateDialogChangelog.gap <= 10);
|
check('Update dialog renders a compact normalized changelog', updateDialogChangelog.hidden === false && updateDialogChangelog.title === 'Changelog' && updateDialogChangelog.body === 'New in this version\\n\\nMenus and navigation\\n\\n• Added live language switching.\\n• Improved settings layout.' && updateDialogChangelog.gap <= 10);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user