fix(home): keep pending channel live status polling#589
fix(home): keep pending channel live status polling#589lefarcen merged 3 commits intonexu-io:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughHomePage enables "channels-live-status" polling when any channel is connected or a channel is pending connection. For pending-channel rows, an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/src/pages/home.tsx`:
- Around line 865-878: The button currently shows the connection state via
statusMeta.label and only swaps to the action "disconnect" on hover, which is
unsafe for touch/keyboard users; update the JSX for the button (the element
referencing isConnectedLive, statusMeta.label and t("home.disconnect")) to
always expose an explicit action-oriented label and non-hover fallback: render
action text like t("home.disconnect") when isConnectedLive, add an aria-label
describing the action (e.g., aria-label={t("home.disconnect")}) and/or include a
visually-hidden span that always contains the action text so keyboard and
screen-reader users see the intent, and remove reliance on group-hover as the
sole affordance.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d3765d15-1319-4883-880c-47889c0863a9
📒 Files selected for processing (1)
apps/web/src/pages/home.tsx
lefarcen
left a comment
There was a problem hiding this comment.
LGTM — clean fix for a real UX issue.
What it does right:
- Extends live-status polling to cover the
pendingChannelIdphase. Before this, newly connected channels showed stale "disconnected" status until the first successful poll — could take up to 3s with no feedback. - The
effectiveStatusoverride (connectingwhen pending + disconnected) gives immediate visual feedback while the backend is still processing. - The hover-to-reveal "Disconnect" button is a nice touch — shows status by default, action on hover.
One minor suggestion (non-blocking):
The shouldPollLiveStatus condition means polling starts as soon as any channel is pending, even before it's actually created server-side. The /live-status endpoint might return 404 or empty for a channel that doesn't exist yet. Not a bug (the query handles undefined gracefully), but worth noting that this will generate a few wasted requests during the brief config phase. Could add a comment for clarity.
Verified:
pendingChannelIdis correctly nulled on success/error (lines 521, 529)- Polling stops when both
hasChannelandpendingChannelIdare false aria-labelandtitleattributes correctly reflect the effective state
|
@hkslover Thanks for this contribution! The fix is clean and well-scoped — keeping the live-status poll alive during pending channel connections and the hover-to-disconnect UX are both nice improvements. Merging now. |
What
Why
When a new channel is being connected, the home page could stop polling too early and briefly fall back to a disconnected-looking state before the live status catches up. That makes the connection flow feel unstable and can confuse users about whether the channel actually connected.
How
shouldPollLiveStatusflag from either an existing connected channel or an in-flightpendingChannelIdeffectiveStatusfor the connected-channel row so pending channels stay in a connecting state even if live status briefly reports disconnected during startupDisconnecton hoverAffected areas
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpassespnpm generate-typesrun (if API routes/schemas changed)anytypes introduced (useunknownwith narrowing)Notes for reviewers
pnpm --filter @nexu/web typecheckpnpm exec biome check apps/web/src/pages/home.tsxpnpm --filter @nexu/web exec vitest run tests/home.test.tsxSummary by CodeRabbit