perf: optimize app startup and background lifecycles

This commit is contained in:
inman
2026-08-19 00:56:15 +08:00
parent 31332f6d76
commit 927e13349b
121 changed files with 4359 additions and 1400 deletions

View File

@@ -2,16 +2,18 @@ import { describe, expect, it } from 'vitest';
import { getNativeWindowMaterialOptions } from '../../electron/main/window-material';
describe('native window material', () => {
it('enables transparent under-window vibrancy on macOS', () => {
it('uses the same opaque light surface on macOS', () => {
expect(getNativeWindowMaterialOptions('darwin')).toEqual({
backgroundColor: '#00000000',
transparent: true,
vibrancy: 'under-window',
visualEffectState: 'active',
backgroundColor: '#FFFFFF',
transparent: false,
visualEffectState: 'inactive',
});
});
it.each(['win32', 'linux', 'freebsd'] as const)('keeps %s on the opaque fallback', (platform) => {
expect(getNativeWindowMaterialOptions(platform)).toEqual({});
it.each(['win32', 'linux', 'freebsd'] as const)('uses the opaque fallback on %s', (platform) => {
expect(getNativeWindowMaterialOptions(platform)).toEqual({
backgroundColor: '#FFFFFF',
transparent: false,
});
});
});