feat(mobile-web): add connection health indicator#922
Conversation
506d8ca to
b526eaa
Compare
|
Thanks for adding connection visibility to mobile-web. I agree with the product goal, but I think this PR needs changes before merge from a product semantics and implementation hygiene perspective.
|
Shows a colored status dot in the session list header: grey when unpaired, yellow while checking, green when connected, red when unreachable. Uses a setTimeout-based non-overlapping polling loop with 10s ping timeout, cancellation guard, and reactive sessionMgr state dependency. All tooltip text is fully i18n'd (en/zh-CN/zh-TW).
b526eaa to
a838c5c
Compare
jarvis24young
left a comment
There was a problem hiding this comment.
Thanks for the thorough review. All six points addressed:
- ✅
_codex_review_prompt.txtremoved - Re: product semantics — the store's
connectionHealthfield is the single shared health source. The reconnect banner (separate PR #926) consumes the same store field. Contract: dot = persistent summary (grey/yellow/green/red), banner = active error affordance (yellow strip on top). - Re: duplicate polling —
useConnectionHealthis now the one canonical health-check loop. The reconnect banner PR #926 will be updated to readconnectionHealthfrom the store instead of running its own ping loop. - ✅ Added
unpairedstate. When nosessionMgris present, the dot is grey (unpaired) rather than red (unreachable). Nowunpaired | checking | connected | unreachable. - ✅ All tooltip text now uses i18n keys via
t('sessions.connectionConnected')etc. — 4 states × 3 locales. - ✅
docs/mobile-gap-analysis.mdremoved.
|
Thanks for the thorough review. All six points addressed:
|
Summary
Shows a colored status dot in the session list header: grey=unpaired, yellow=checking, green=connected, red=unreachable.
Changes
useConnectionHealthhook withsetTimeout-based non-overlapping pollingcancelledflag prevents stale state updatessessionMgrstate ensures hook re-runs on connect/disconnectunpaired|checking|connected|unreachableunpaired(grey dot) — not misleading--color-success/--color-warning/--color-error/--color-text-mutedtokensReview Fixes
_codex_review_prompt.txtanddocs/mobile-gap-analysis.mdconnectionHealthstore fielduseConnectionHealthis the one canonical health-check loop — no duplicate pollingunpairedstate to distinguish "not yet paired" from "connection lost"sessions.connectionConnected/Checking/Unreachable/Unpaired)