Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): iOS 模拟器面板轮询不再因未变化的 viewport 重渲染

Kirozeng0966d9bd7e3c
diff --git a/apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx b/apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx
index 3becd5910a..88e2d9fda3 100644
--- a/apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx
+++ b/apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx
@@ -899,7 +899,20 @@ export function IOSSimulatorTabBody({
acceptStream(resultStream(result));
if (nextInstance) void refresh();
const nextViewport = resultViewport(result);
- if (!cancelled && nextViewport) setViewport(nextViewport);
+ // Frame polls re-report the same viewport on every result. Keep the
+ // previous reference when nothing changed so an unchanged poll does not
+ // re-render the whole panel 20×/s — under a slow runner that churn also
+ // starves `act()` drains in tests until the suite times out.
+ if (!cancelled && nextViewport) {
+ setViewport((previous) =>
+ previous &&
+ previous.width === nextViewport.width &&
+ previous.height === nextViewport.height &&
+ previous.orientation === nextViewport.orientation
+ ? previous
+ : nextViewport,
+ );
+ }
const nextMutation = resultMutation(result);
if (!cancelled && nextMutation) setLiveMutation(nextMutation);
};