feat(panel): refine macOS overlay geometry, port discovery, font tokens, and LF bundling

Co-authored-by: Swei <sweilo@qq.com>
This commit is contained in:
fish
2026-11-17 22:30:01 +09:00
co-authored by Swei
parent 96bf0c049f
commit d4d359bc89
13 changed files with 444 additions and 25 deletions
@@ -399,6 +399,7 @@ function isEquivalentTelemetry(prev, next) {
if ((pSet?.language ?? 'zh-CN') !== (nSet?.language ?? 'zh-CN')) return false;
if ((pSet?.themeAccent ?? 'host') !== (nSet?.themeAccent ?? 'host')) return false;
if ((pSet?.fontScale ?? 'md') !== (nSet?.fontScale ?? 'md')) return false;
if ((prev.hostPlatform || '') !== (next.hostPlatform || '')) return false;
if (Boolean(pSet?.contextWindowRiskAccepted) !== Boolean(nSet?.contextWindowRiskAccepted)) {
return false;
}
@@ -1490,3 +1491,21 @@ export function resolveScopedConversation(
ctxAgent,
};
}
/**
* 判断宿主系统是否为 macOS (`darwin`):优先读取后端遥测或双栖桥接注入的 `platform`,首帧缺省时回退 UA/平台标识。
*
* @param {Record<string, any>|null|undefined} telemetry
* @returns {boolean}
*/
export function isMacHostPlatform(telemetry) {
const p = String(telemetry?.hostPlatform || readInjectedWindowBridge()?.platform || '')
.trim()
.toLowerCase();
if (p) return p === 'darwin';
if (typeof navigator !== 'undefined') {
const ua = String(navigator.platform || navigator.userAgent || '');
return /\b(?:mac|darwin)\b|macintosh|mac\s*os/i.test(ua);
}
return false;
}