mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user