feat: improve desktop reliability and customization

Address reliability and consistency gaps across Agent Runtimes, persistence, settings, Knowledge, Magic Notes, Smart Heartbeat, and the download site. Runtime processes now have bounded lifecycle cleanup and atomic configuration rollback, while model packages and persisted mutations recover safely.

Add a configurable global shortcut, protect unsaved work, improve modal and keyboard behavior, localize the built-in project without rewriting stored data, and lazy-load heavy renderer routes under enforced bundle budgets. Align project forms and disabled controls with shared typography and interaction states, and strengthen website release metadata validation and navigation accessibility.

Release note: 修复 Runtime、设置、知识库、魔法笔记与智能心跳中的可靠性和交互一致性问题;新增可配置全局快捷键,改进无障碍与加载性能,并强化官网下载校验。
This commit is contained in:
mesalogo
2026-08-20 10:11:06 +08:00
parent 20c15f74c6
commit f44a0dc907
129 changed files with 15511 additions and 2112 deletions
+49
View File
@@ -0,0 +1,49 @@
(() => {
"use strict";
const root = document.documentElement;
const currentLanguage = root.lang.toLowerCase().startsWith("zh") ? "zh" : "en";
const requestedLanguage = new URLSearchParams(window.location.search).get("lang");
let savedLanguage = null;
if (requestedLanguage === "zh" || requestedLanguage === "en") {
savedLanguage = requestedLanguage;
try {
localStorage.setItem("goodbuddy-site-language", requestedLanguage);
} catch {
// The requested language still applies to this navigation.
}
} else {
try {
const storedLanguage = localStorage.getItem("goodbuddy-site-language");
if (storedLanguage === "zh" || storedLanguage === "en") {
savedLanguage = storedLanguage;
}
} catch {
// Fall back to the browser language when storage is unavailable.
}
}
const preferredLanguage =
navigator.languages?.[0] ?? navigator.language ?? "en";
const targetLanguage =
savedLanguage ?? (preferredLanguage.toLowerCase().startsWith("zh") ? "zh" : "en");
document.addEventListener("click", (event) => {
const languageLink =
event.target instanceof Element
? event.target.closest("[data-language-link]")
: null;
if (!(languageLink instanceof HTMLAnchorElement)) {
return;
}
const targetUrl = new URL(languageLink.href, window.location.href);
targetUrl.hash = window.location.hash;
languageLink.href = targetUrl.href;
});
if (targetLanguage !== currentLanguage) {
const targetPath = targetLanguage === "zh" ? "./" : "./en.html";
window.location.replace(`${targetPath}${window.location.hash}`);
}
})();