Skip to content

feat(fleet): grey out nodes with no settlement in the last 24h - #259

Merged
alpergundogdu merged 1 commit into
mainfrom
claude/fleet-node-limit-f81a94
Sep 29, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
claude/fleet-node-limit-f81a94

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

The fleet panel's per-node dot now reflects how recently the node settled:

Newest settlement Dot Text
under 24h ago pulsing green settled 4 min ago
24h or older solid grey, still settled 24 h ago, settled 3 d ago
none in the indexer's recent window empty ring operator only
  • settledInWindow(lastSettled, now) in lib/stats.ts holds the rule, tied to FLEET_WINDOW_HOURS so the cutoff matches the panel's 24h aggregates.
  • FleetStatus.tsx picks the dot class from it and drops the idle label.
  • .fleet-pulse-stale in globals.css fills the dot with the ring's grey.

Test plan

  • pnpm test: unit cases for the 24h boundary, component cases for all three dot states and no idle text
  • pnpm typecheck, pnpm lint, prettier
  • Checked in the local dev server against live testnet stats

🤖 Generated with Claude Code

A node's dot pulses while its newest settlement is inside the panel's
24h window and turns solid grey once it falls outside, keeping the
"settled N ago" text. Rows with no settlement on file drop the "idle"
label and show the operator alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 12:27
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3bbfaf4
Status: ✅  Deploy successful!
Preview URL: https://4f7a6fde.website-70y.pages.dev
Branch Preview URL: https://claude-fleet-node-limit-f81a.website-70y.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The change is small, self-contained, and presentational, with correct unit handling and comprehensive unit/component tests covering all three dot states and the 24h boundary.

Review effort: Balanced
Findings: None

What changed in this PR

This PR enhances the Contact section's fleet panel so a node's per-row status dot reflects settlement recency rather than a simple settled/idle binary. A node whose newest settlement is within the 24h fleet window shows a pulsing green dot, one settled 24h+ ago shows a solid grey dot, and one with no settlement in the indexer's recent window shows an empty ring. The rule is centralized in settledInWindow in lib/stats.ts, tied to the existing FLEET_WINDOW_HOURS constant so the dot cutoff matches the panel's 24h aggregates.

Changes:

  • Add settledInWindow(lastSettled, now) helper in lib/stats.ts and its unit tests covering the 24h boundary and the null case.
  • Update FleetStatus.tsx to select the dot class (active / stale / empty) from settledInWindow, drop the idle label, and always render a settled … line when a timestamp exists.
  • Add .fleet-pulse-stale styling and expand the component test fixture/assertions for all three dot states.
File Description
lib/​stats.ts Adds the settledInWindow window-cutoff helper tied to FLEET_WINDOW_HOURS.
lib/​stats.test.ts Unit tests for the 24h boundary and null input of settledInWindow.
components/​site/​FleetStatus.tsx Picks the dot class from settledInWindow, removes the idle text.
components/​site/​FleetStatus.test.ts Extends fixtures/assertions to cover pulsing, stale, and empty dot states.
app/​globals.css Adds .fleet-pulse-stale to fill the dot with the ring's grey.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@alpergundogdu
alpergundogdu merged commit c3d5967 into main Sep 29, 2026
7 checks passed
@alpergundogdu
alpergundogdu deleted the claude/fleet-node-limit-f81a94 branch September 29, 2026 12:41
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.

2 participants