chore(agent-browser): drop redundant viewportWidth/Height status cast#171
Open
dormouse-bot wants to merge 1 commit into
Open
chore(agent-browser): drop redundant viewportWidth/Height status cast#171dormouse-bot wants to merge 1 commit into
dormouse-bot wants to merge 1 commit into
Conversation
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 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
9d010ce
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://871a5449.mouseterm.pages.dev |
| Branch Preview URL: | https://chore-agent-browser-drop-red.mouseterm.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surfaced by the nightly code-quality survey.
The
statusevent payload inAgentBrowserPanel's connection subscription is already typedAgentBrowserStreamStatus(imported asStreamStatus), and that interface declaresviewportWidth?: numberandviewportHeight?: number(agent-browser-connection.ts#L27-L28). The status branch nonetheless re-castevent.statustoStreamStatus & { viewportWidth?: number; viewportHeight?: number }before reading those fields — an intersection that adds nothing the base type doesn't already provide.This reads the fields directly off
event.status, dropping the cast and the intermediatemaybeStatuslocal. Pure simplification — no behavior change; thetypeof … === 'number'guards are unchanged.No regression test: this is a type-level cleanup with no runtime behavior change, validated by the
tsc -bstep in CI.