Repository navigation
Description
Problem Statement
Phone connection setup conflates device pairing with configuring individual network routes. Users can connect through one address but struggle to add Tailscale, cannot tell why automatic publishing is unavailable, and cannot inspect the addresses of their saved computer. Connect readiness can hide Tailscale setup. A publishing conflict must not overwrite another service.
Related: #2598 (encrypted LAN and route recovery), #2599 / #2600 (merged LAN foundation, native acceptance remains separate), #2387 (Connect). This specification extends the accepted connection UX and publishing lifecycle; it does not duplicate the LAN foundation or claim its native acceptance.
Solution
One saved Remote Host, one normal device enrollment, several independently enabled routes. Prefer authenticated LAN, then Tailscale, then Connect, protecting ongoing work. Offer pairing as soon as a supported path is ready. Guide Tailscale setup with one contextual action, automatically choose a non-conflicting publishing entry, and preserve other services. Device connections and Connect are independent settings sections. Mobile environment details show connection addresses, actual active route, truthful test results and recovery actions.
User Stories
- As a Human, I want one Connect phone action, so that I do not need to choose IPs or protocols.
- As a Human, I want clear LAN enablement, so that I know when local access becomes available.
- As a Human with a working remote route, I want to pair without enabling LAN, so that local access is optional.
- As a phone user, I want to scan once and approve my device once, so that network changes do not repeat enrollment.
- As a Human, I want Tailscale setup optional alongside working LAN, so that unfinished remote setup does not block local use.
- As a Human, I want installation, login, permission and Serve approval distinguished, so that each interruption has an actionable next step.
- As a Human, I want setup to resume after external approval, so that I do not reconstruct command-line steps.
- As a Host owner, I want an occupied Tailscale publishing entry preserved, so that enabling phone access does not break another service.
- As a Host owner, I want an alternative publishing port selected and verified automatically, so that I do not enter port numbers.
- As a Host owner, I want explicit enablement remembered across restarts, so that access returns reliably.
- As a Host owner, I want disablement to remove only still-owned application mappings, so that other configurations survive.
- As a phone user, I want newly enabled routes learned over a trusted connection, so that I do not scan again.
- As a phone user, I want one Host entry after address updates, so that my history and presentation state stay intact.
- As a phone user, I want LAN preferred at home and remote fallback away, so that the app follows my network.
- As a phone user, I want recovery to LAN without interrupting healthy uploads or writes, so that optimization preserves work.
- As a phone user, I want uncertain sends reconciled rather than replayed, so that network failure does not duplicate actions.
- As a phone user, I want my current connection method visible, so that I understand how I am connected.
- As a phone user, I want addresses and ports in environment details, so that I can inspect the routes to this computer.
- As a phone user, I want to copy or test a route without permanently locking selection, so that diagnostics do not undermine automatic recovery.
- As a phone user, I want saved, untested and verified addresses distinguished, so that stale data is not presented as a working connection.
- As a phone user with no reachable route, I want scan-to-update recovery preserving my existing Host on failure, so that I can recover without losing state.
- As a Human, I want Connect in its own settings section, so that account setup does not hide device/Tailscale controls.
- As a Human, I want closing a route to retain pairing and other routes, so that connection management is reversible.
- As an English or Chinese user with large text or accessibility needs, I want reachable readable controls, so that I can complete setup.
- As an operator, I want matching CLI behavior and coded refusals, so that configuration is testable without a model or UI.
- As a PR reviewer, I want matched Expo Web before/after screenshots and a concrete UX walkthrough, so that delivered behavior is reviewable.
Implementation Decisions
- Retain the existing Device Pairing, encrypted channel, Host Feed and client session owners. An address does not create a Host or device identity. Reuse the merged LAN entry rather than introducing another listener or trust system.
- Maintain stable route preference separately from the last successful route. Authenticate candidates before using credentials; never add plaintext fallback or trust a matching public Host ID alone.
- Tailscale publishing lifecycle is application-owned; explicit enablement authorizes supported configuration. Track owned publishing entries, verify before advertising them and preserve foreign entries during conflict, recovery and disablement. Do not change the Host listening port to resolve a publishing-map conflict.
- Keep the existing Host Service / API Gateway / CLI seams; matching CLI commands and bilingual documentation accompany management changes.
- Device connections owns LAN, Tailscale, pairing and devices. Connect owns account access and its service state. Externally required authorization is surfaced explicitly.
- The mobile Host/session owner exposes route status and tests to UI. Screens do not perform their own network calls. Valid identity/approval survives route updates; legacy trust upgrades remain explicit.
- No permanent route lock or reorder UI in this slice. No credential-bearing URL appears in details or screenshots.
- Deliver a runnable vertical slice and obtain Human feedback before expanding providers/variants. Keep missing native acceptance explicit rather than treating screenshots as network proof.
Testing Decisions
- The agreed highest seam is the complete pairing-to-Host journey: LAN enrollment, live Host state, enable Tailscale without rescan, leave Wi-Fi, return and retain identity/history. Test operations through existing management/CLI and mobile client public boundaries, observing user-visible outcomes.
- Reuse existing device publishing, encrypted pairing and mobile client/session behavioral tests. Inject only external command/network effects needed to deterministically reproduce conflicts and failures; avoid private-method assertions.
- Cover foreign publishing entries, restart restoration, disable ownership, route failure, authentication mismatch, revoked devices and no duplicate business writes. Keep model availability separate from connection readiness.
- Capture matched Expo Web before/after images of pairing and environment details, plus desktop settings where changed. Use the actual app and disclose any fixture state; screenshots do not qualify native camera, OS permission, Wi-Fi or VPN behavior.
- Run focused regressions, regular typechecking, applicable checks, the full suite once and the two-axis code review. Queue native qualification under shared-device rules and report concrete remaining blockers.
Out of Scope
Provider additions, raw HTTP credential fallback, new pairing authority, permanent route overrides, latency-racing business requests, router configuration, public Funnel exposure, and taking over other agents' device/Host sessions. No merge or release is authorized by this issue.
Further Notes
The Human confirmed the complete flow in the 2026-10-25 design interview and explicitly requested an implementation PR with Expo Web screenshots explaining delivered UX. ADR-0241 owns accepted decisions; T3 Connect and NN/g progressive disclosure/status visibility informed the flow. The working checkout used during the interview predates merged LAN support; implementation must use current main and recheck all gaps.
Activity
DoodleBears commentedon Oct 25, 2026
Agent work claim
codex/local/01a17305-4a2f-7241-9b05-b5b4b0688677(not a DSH Session)codex/2784-connection-uxRelated #2598 remains the broader LAN recovery/upgrade specification; this task does not take over #2599 native QA or its device queue allocation.
fix: retain explicit trust upgrades and reachable recovery routes
fix: refresh push registration after pairing recovery
DoodleBears commentedon Oct 25, 2026
Agent work handoff
Task:
codex/local/01a17305-4a2f-7241-9b05-b5b4b0688677.State: handed-off for Human/native QA; implementation is in draft PR #2789, head
74898aef192b24b641b6279d60cb26f6f8a1b2dc.Delivered: independent LAN/Tailscale preparation, managed Tailscale publishing and owned cleanup, authenticated route learning/preference/recovery, separate Connect settings, phone connection details and explicit scan recovery. Reapproval also refreshes push credentials without requesting notification permission again.
Evidence: PR embeds Expo Web before/after and actual isolated-Host Devices/Connect screenshots, pinned to the head and verified as accessible images. Expo uses an offline layout fixture; no native/network success is implied. Desktop baseline is still an explicit evidence gap.
Checks: focused final regressions 48 passed; local lint/format/typecheck and runtime build passed; both actual Host page drives had zero console issues. Windows full-suite attempts were interrupted after failures, not green. Follow-up reproduced an untouched registry CRLF expectation and Lark contract directory-fsync EPERM; other full-suite timeouts remain unqualified.
Remaining acceptance: physical phone LAN→Tailscale→LAN including an in-flight upload; actual managed publishing/port conflict/restart/disable; Android/iOS themes, text sizes, accessibility, copy/test/scan. Android request is in the shared queue at this head, not cut or executed; iOS queue submission remains pending. No merge requested.
A head-bound HTML explainer was generated and visually checked locally at desktop/narrow widths. No authorized reviewer-accessible hosting path was used, so it is not a shared review artifact.
Cleanup: task-owned verification Host stopped, listening port released, evidence retained; no shared device or Metro resources allocated. Source worktree retained for review.
Final exact-head CI: run 40201147465 succeeded, including all 3 affected-test shards, mobile verification, isolated Host smoke, docs and lint/format/typecheck/build. This does not qualify physical-device acceptance or the local full suite.
feat: streamline phone connections and separate Connect settings (#2789)
feat(connections): unify onboarding and target Client pairing (#2826)