️ perf(native-window): 优化 AI 独立窗口启动与交互

- 关闭时隐藏保活,重开复用现有进程并通过可见性版本消除竞态
- 拆分 AI 与工作台资源,使用启动状态白名单减少序列化开销
- 修复设置中心层级、Windows 前台切换及独立窗口关闭交互
- 补齐状态同步、断线重放与窗口生命周期回归测试
This commit is contained in:
Syngnat
2026-07-21 23:40:17 +08:00
parent 62a045b39d
commit fda0733f11
38 changed files with 3147 additions and 1051 deletions

View File

@@ -28,6 +28,7 @@ func TestRuntimeExposesParentWindowManagerInsideDetachedChildren(t *testing.T) {
"Manager: parentWindowManager",
"bridge.OpenWindow(request || {})",
"bridge.FocusWindow",
"bridge.HideWindow",
"bridge.CloseWindow",
} {
if !strings.Contains(script, expected) {
@@ -36,6 +37,23 @@ func TestRuntimeExposesParentWindowManagerInsideDetachedChildren(t *testing.T) {
}
}
func TestRuntimeRoutesRevisionedHideAndFocusCommands(t *testing.T) {
script := detachedRuntimeBridgeScript()
for _, expected := range []string{
GracefulHideRequestEventName,
"requestGracefulHide(command)",
"visibilityRevisionOf(command)",
"control.FocusRevision(visibilityRevisionOf(command))",
} {
if !strings.Contains(script, expected) {
t.Fatalf("runtime bridge is missing revisioned visibility marker %q", expected)
}
}
if strings.Contains(script, "control.Hide(") {
t.Fatal("runtime hide command bypasses the frontend state flush")
}
}
func TestRuntimeRoutesParentCloseThroughGracefulFrontendEvent(t *testing.T) {
script := detachedRuntimeBridgeScript()
for _, expected := range []string{