Repository navigation
feat(mobile): offer a manual reconnect while the status still reads healthy - #826
Merged
Merged
Conversation
…ealthy The status popover only carried an action when the app already knew the connection had failed. A transport that dies without the client noticing — the socket silently half-open, presence heartbeats missed while the UI keeps the last green packet — left the user with a badge that said 已连接 and no way to act on it short of unpairing and re-scanning the desktop. Give the badge's bubble the same manual reconnect in the two states where the app itself claims everything is fine (connected, and the attempt still in flight): the press tears the client down and reconnects, which re-runs the catalogue and timeline recovery the transport-loss path already uses. It is rendered as a secondary button so a healthy connection does not push it forward, and the states that have their own answer (waiting for the desktop to come up, or a pairing that must be redone) are left alone. Verified by the existing component tests plus a new `connection-popover` capture scenario, whose assertion reads the popover's button labels — an empty bubble now fails the capture instead of shipping quietly.
huichen
enabled auto-merge (squash)
September 25, 2026 09:37
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
The 桌面端连接状态 bubble only offered an action once the app had already decided the connection failed. A transport that dies without the client noticing — the socket half-open with the UI still holding the last green presence packet — left the popover saying 已连接 with nothing to act on, and no way back short of unpairing and re-scanning the desktop.
What
connected(action: "none") and the attempt still in flight (action: "wait").reconnect(): the client is torn down and re-opened, and the new socket'sonReconnectedre-runs the catalogue + timeline recovery the transport-loss path already uses.Verification
mobile:npm run typecheck,npm run lint,npx jest --runInBand— 125 suites / 1911 tests pass. The new component test asserts the button's label, its secondary variant, that pressing it callsonReconnect, and that the bubble closes.connection-popoverscenario (scripts/screenshots/scenarios.json) opens the bubble by a programmatic click (an emulated tap lands ~58px lower here) and asserts the popover's button labels contain 重新连接 — an empty bubble fails the capture. Captured with the real UI on the Expo web build; OCR of the resulting PNG confirms桌面端连接状态 / 已连接 / 手机已连接到桌面端 / 重新连接with the button full width inside the card and nothing clipped.The captures live in
.screenshots/(gitignored):m-connection-popover.png.