Repository navigation
API: a Bot's screen viewer can say how large it draws the screen - #2150
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 24, 2026 20:30
davidmckayv
force-pushed
the
sharp-screen-spec
branch
from
November 24, 2026 20:54
96f2c28 to
9610c95
Compare
Adds an optional viewSize flag to the screen socket's hello and a view-size message the viewer sends back, so frames can come at the size the viewer draws them in its own device pixels (sharp on a high-resolution display) and no larger. Additive only: a viewer that never sends view-size, and a server that never says viewSize, behave as today.
davidmckayv
force-pushed
the
sharp-screen-spec
branch
from
November 24, 2026 21:15
9610c95 to
8a8455c
Compare
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.
A Bot's screen looks soft on a high-resolution display: the computer sends frames at the screen's own 1280 by 800 pixels, and a Retina display draws the view at twice that or more, so text is upscaled.
This adds what a viewer needs to ask for frames at the size it actually draws them:
ScreenHello.viewSize(optional boolean): the server says it takes a view size.ScreenViewSize({"type":"view-size","width","height"}), a new message on the screen socket: how large the viewer draws the screen, in its own device pixels (its size on the page times the display's pixel ratio). Sent only after hello saysviewSize, and again when the size changes. A viewer that only watches may send it too.ScreenFrame: the picture can have more pixels thanwidthandheight, which stay the screen's own size that mouse positions are measured in.Additive only. A viewer that never sends
view-size, and a server that never saysviewSize, behave exactly as today, and clicks keep the same coordinates.Checks:
bun run api:lintclean,bun run api:live:diffagainst main says no change breaks a client,bun run api:generatechanges nothing else (the REST spec is untouched).