From 9d010ce525b884a96165959df967a4f1052d117d Mon Sep 17 00:00:00 2001 From: dormouse-bot Date: Tue, 23 Jun 2026 07:41:55 +0000 Subject: [PATCH] chore(agent-browser): drop redundant viewportWidth/Height status cast The `status` event payload is already typed `AgentBrowserStreamStatus` (aliased `StreamStatus`), which declares `viewportWidth?: number` and `viewportHeight?: number` (agent-browser-connection.ts:27-28). The intersection cast at the status branch added nothing, so read the fields directly off `event.status`. Co-Authored-By: Claude Opus 4.8 --- lib/src/components/wall/AgentBrowserPanel.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/src/components/wall/AgentBrowserPanel.tsx b/lib/src/components/wall/AgentBrowserPanel.tsx index 24c66c23..67926db0 100644 --- a/lib/src/components/wall/AgentBrowserPanel.tsx +++ b/lib/src/components/wall/AgentBrowserPanel.tsx @@ -458,9 +458,8 @@ export function AgentBrowserPanel({ api, params, renderMode: renderModeProp }: I } else if (event.type === 'status') { setStatus(event.status); setConnectionLost(event.status.connected === false); - const maybeStatus = event.status as StreamStatus & { viewportWidth?: number; viewportHeight?: number }; - if (typeof maybeStatus.viewportWidth === 'number' && typeof maybeStatus.viewportHeight === 'number') { - deviceRef.current = { width: maybeStatus.viewportWidth, height: maybeStatus.viewportHeight }; + if (typeof event.status.viewportWidth === 'number' && typeof event.status.viewportHeight === 'number') { + deviceRef.current = { width: event.status.viewportWidth, height: event.status.viewportHeight }; maybeDisengageSync(); publishScreen(); }