Repository navigation
Improve Mirror interaction, remote scrolling, and device pairing - #846
Merged
Merged
Conversation
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.
Why
This change addresses problems found while using Mirror for everyday interaction on Mac, iOS, and Android: ordinary phone messages can become blocked by an automation receipt, terminal History cannot navigate history owned by a full-screen TUI, and pairing/re-pairing requires too many separate steps.
Interactive input should not require task completion
Mobile messages previously used
agents.dispatch. If the Agent failed to calldispatch-complete, a pending dispatch could block subsequent human input even after the Agent became idle.Add a capability-negotiated
agentsInputcommand that reuses readiness checks and guarded delivery without creating, completing, or abandoning an automation dispatch. Delivery acknowledgement means the input was delivered, not that the Agent finished its work. Existing automation completion semantics remain unchanged. Mobile clients retain text-v1, authenticated pane leases, request deduplication, and delivery-receipt recovery; unsupported Hosts require an upgrade rather than silently falling back to dispatch.Navigate the Host viewport as well as retained History
History reads Ghostty's retained text buffer. Some full-screen TUIs, including the tested Codex version, manage and redraw their own history instead of placing it in terminal scrollback. Increasing History pagination cannot expose that content.
Keep History and add explicit Scroll Up / Scroll Down controls on all three clients:
Remote scrolling changes the Host's shared live viewport. It is not a separate archive or an independent per-client history position.
Preserve Mac terminal appearance while browsing native scrollback
The plain-text fallback made native history look substantially different from live terminal output, including font shaping and layout as well as colors.
Add negotiated
styled-scrollback-v1support for Mac. Existing Ghostty VT export APIs provide a bounded archive that is replayed in the same replica terminal, with viewport verification before display. Oversized archives or verification failures retain the text fallback. Exports are limited to 5,000 retained rows, 250,000 cells, and 2 MiB.Also prevent replay-generated focus/color/size reports from being forwarded back to Host, which could otherwise cause the viewport to jump back to the bottom immediately after scrolling. Genuine user input remains supported.
Ghostty source and bundled framework are unchanged. Mobile text-v1 and retained History remain intact.
Make pairing and recovery straightforward
Copying an address, port, and code separately is error-prone. After Host revokes access, a client may also continue trying saved credentials without an obvious way to replace them.
The final copy/paste UI change is Mac-only; mobile continues to use QR scanning.
Validation
Merged current upstream main (
436fc1e3) without conflicts. Its Canvas toolbar-spacing change does not overlap the Mirror implementation.After integration:
legacy_swiftui_aspect_ratioviolations inRepositoryIconImage.swift.Earlier feature validation included iOS/iPad simulator and UI tests, Android unit/instrumentation tests and lint, CLI/relay tests, and physical-device/remote-Host acceptance. Mobile suites were not rerun for the final upstream merge, which changes only Mac toolbar layout and documentation. Earlier full CLI unit validation also encountered existing WorkflowHistoryRetentionTests export failures; this is not a claim that every repository-wide suite is green.