sip-protocol / sip-protocol/sipher
[tech-debt] ConnectionQualityIndicator polish (Wave 2a E1 follow-up)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Follow-ups from Wave 2a Cluster E1 (#219 connection-quality indicator). Code-quality review flagged 2 substantive minors.
Tasks
-
Add
AbortControllerfor in-flight fetch on visibility/unmount transitions —app/src/components/ConnectionQualityIndicator.tsx:38-52. When the tab transitionsvisible → hiddenwhile a ping'sawait fetch(ENDPOINT)is mid-flight,stopInterval()cancels future intervals but the live request continues. When it resolves,cancelledis stillfalse(only set on unmount), so 3 setState calls fire while the tab is hidden — wasted work and an extra state churn on the nextvisibleevent. Fix: thread anAbortControllerintofetch, callcontroller.abort()fromstopInterval()AND the cleanup function; treatAbortErroras silent in catch. -
Align a11y semantics with sibling indicators —
app/src/components/ConnectionQualityIndicator.tsx:88-93usesrole="img"+aria-label, but siblingAgentDotcomponents in the same header icon group have no a11y semantics (silent dots). Screen readers will announce 1 dynamic indicator + 3 silent dots — inconsistent reading. Options: (a) liftAgentDottorole="img"witharia-label, OR (b) addaria-live="polite"to the indicator for state transitions so SR users hear "Backend reachable (45ms)" → "Unreachable" announcements. -
Add flicker test for rapid
visible → hidden → visibletransitions —ConnectionQualityIndicator.test.tsx. Current tests covervisible-only,hidden-on-mount, unmount cleanup, but not the flicker case wherehandleVisibilityfires multiple times in quick succession while a ping is still pending. Behavior is correct by inspection (idempotentstartInterval/stopInterval) but a test would lock the contract.
Source
Wave 2a Cluster E1 code-quality review (6 minors total — top 3 bundled here, others skipped as polish-only).
Priority
Low — indicator works correctly today; these are robustness polish.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app/src/components/ConnectionQualityIndicator.tsx:38-52 and the existing visibility and cleanup logic, then read ConnectionQualityIndicator.test.tsx. Trace the in-flight fetch behavior during visible/hidden transitions and review the sibling AgentDot semantics at lines 88-93. Done means aborted requests are silent, the indicator semantics are aligned with the chosen accessibility approach, and rapid visibility flicker has a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100