Skip to content

fix(home): keep pending channel live status polling#589

Merged
lefarcen merged 3 commits intonexu-io:mainfrom
hkslover:fix/home-channel-live-status
Mar 30, 2026
Merged

fix(home): keep pending channel live status polling#589
lefarcen merged 3 commits intonexu-io:mainfrom
hkslover:fix/home-channel-live-status

Conversation

@hkslover
Copy link
Copy Markdown
Contributor

@hkslover hkslover commented Mar 26, 2026

What

  • keep polling channel live status on the home page while a newly created channel is still pending
  • avoid briefly showing a pending channel as disconnected during the post-creation handshake
  • show the connected status by default and switch the action label to Disconnect on hover for connected channels

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

  • derive a shouldPollLiveStatus flag from either an existing connected channel or an in-flight pendingChannelId
  • compute an effectiveStatus for the connected-channel row so pending channels stay in a connecting state even if live status briefly reports disconnected during startup
  • keep the existing disconnect action, but improve the button behavior so connected channels show their live status by default and reveal Disconnect on hover

Affected areas

  • Desktop app (Electron shell)
  • Controller (backend / API)
  • Web dashboard (React UI)
  • OpenClaw runtime
  • Skills
  • Shared schemas / packages
  • Build / CI / Tooling

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • pnpm generate-types run (if API routes/schemas changed)
  • No credentials or tokens in code or logs
  • No any types introduced (use unknown with narrowing)

Notes for reviewers

  • Verified with targeted checks for the web app only:
    • pnpm --filter @nexu/web typecheck
    • pnpm exec biome check apps/web/src/pages/home.tsx
    • pnpm --filter @nexu/web exec vitest run tests/home.test.tsx
  • No API or shared schema changes are involved in this fix.

Summary by CodeRabbit

  • Bug Fixes
    • Polling for channel live status now remains active when a channel is pending connection, ensuring timely updates.
    • Pending channels are shown with a consistent "connecting" status so live status indicators (label/color/pulse) reflect connection progress.
    • Disconnect control behavior improved: label/title and hover state now clearly reflect whether a channel is connected or in-progress.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 11cb1d8c-8a0a-493e-8f6e-4d5b396d14c2

📥 Commits

Reviewing files that changed from the base of the PR and between 85ba849 and 4a27c77.

📒 Files selected for processing (1)
  • apps/web/src/pages/home.tsx

📝 Walkthrough

Walkthrough

HomePage enables "channels-live-status" polling when any channel is connected or a channel is pending connection. For pending-channel rows, an effectiveStatus coerces missing/disconnected live status to "connecting". The disconnect button uses context-aware labels and a hover-controlled label when the channel is connected.

Changes

Cohort / File(s) Summary
HomePage polling and status logic
apps/web/src/pages/home.tsx
Polling now runs if any channel is connected OR a channel is pending. Added effectiveStatus to treat a pending channel with missing/disconnected live status as "connecting". Updated disconnect button aria/title and hover label behavior (adds group class) to reflect effectiveStatus.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hop through rows of code and light,

Pending sprouts now show connecting bright,
Polling hums while states refine,
Button labels dance on hover's sign,
A tiny change, a clearer sight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(home): keep pending channel live status polling' directly and clearly summarizes the main change—ensuring live status polling continues while channels are pending.
Description check ✅ Passed The PR description covers all essential sections (What, Why, How) with good detail, includes the affected areas checkbox, and provides comprehensive notes for reviewers. Only pnpm lint is unchecked.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d67c73a and 85ba849.

📒 Files selected for processing (1)
  • apps/web/src/pages/home.tsx

Comment thread apps/web/src/pages/home.tsx
@hkslover hkslover requested a review from mrcfps March 27, 2026 07:36
@hkslover
Copy link
Copy Markdown
Contributor Author

@mrcfps @lefarcen PR is ready: all required checks are green and review is approved. Could a maintainer help merge? Thanks!

Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean fix for a real UX issue.

What it does right:

  • Extends live-status polling to cover the pendingChannelId phase. Before this, newly connected channels showed stale "disconnected" status until the first successful poll — could take up to 3s with no feedback.
  • The effectiveStatus override (connecting when 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:

  • pendingChannelId is correctly nulled on success/error (lines 521, 529)
  • Polling stops when both hasChannel and pendingChannelId are false
  • aria-label and title attributes correctly reflect the effective state

@lefarcen lefarcen merged commit dfa3c53 into nexu-io:main Mar 30, 2026
11 checks passed
@lefarcen
Copy link
Copy Markdown
Collaborator

@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.

@lefarcen lefarcen mentioned this pull request Mar 30, 2026
@hkslover hkslover deleted the fix/home-channel-live-status branch March 30, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants