Repository navigation
feat(ui): open a phone in a window of its own - #128
Merged
Merged
Conversation
Add "Open in a window" to the phone's ⋯ menu and right-click menu. The window shows only the phone's live screen at its aspect, with its keys, a small control banner with Hand back, and an optional Keep on top pin. It shares the phone's mirror and its one stream with the main window, maps input at its own size through mirrorInput, follows rotation, shows the offline, paused or connecting state, and closes when the phone is removed. Closes #122 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #122.
Open in a window in a phone's ⋯ menu under its mirror, and in its right-click menu (sidebar row, All phones tile), opens a window with only that phone's live screen, for iPhones, iPads and Android phones. Opening it again brings the existing window to the front.
What the window does
mirrorInput.mirrorViewnow takes asurface(onPage,onTile,onWindow), and the mirror keeps the screen's box for each surface, so a click maps to device pixels at the size of the view it came from. This works even when the page and the window show the mirror at the same time at different sizes. A touch takes over and pauses the agent exactly as on the page.mirrorfrommirrorFor, so it uses the same gateway stream, decoder and bitmap as the main window.inWindowkeeps that mirror out ofsweepMirrorsandcloseMirrors, so it stays open while the main window shows another page or is hidden or minimized.tileStillkeeps an iPhone's tile live while its window is open. When the window closes or the phone stops being live, the window lets the mirror go.StateKeyphone-<id>remembers where it was placed.controlFor: the banner's text and whether the person is in control.phoneKeys: the keys.Tests
ui/phonewindow_test.go:TestPhoneWindowInput:TestPhoneWindowKeepsTheStream: hiding the main window or switching pages keeps the mirror; closing the window releases it.TestPhoneWindowStates:TestPhoneWindowShape: sizes for opening, resizing and turning.TestPhoneWindowScreenshots: needsPINKY_SCREENSHOTS; renders fake phones only.make checkpasses.I also checked it in the UI demo (
-scenario three, test-pattern streams, driven through MyGo's automation socket):Not tried on a real phone.
Docs: README.md and README.zh-CN.md (new bullet before "Removing a phone"), plus a section in
docs/notes/client.md. Messages are added in en, zh-Hans and ja. The new icons are MingCuteexternal_link_line,pin_lineandpin_fill.🤖 Generated with Claude Code