Repository navigation
feat(fleet): grey out nodes with no settlement in the last 24h - #259
Conversation
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>
Deploying website with
|
| 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 |
There was a problem hiding this comment.
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 inlib/stats.tsand its unit tests covering the 24h boundary and thenullcase. - Update
FleetStatus.tsxto select the dot class (active / stale / empty) fromsettledInWindow, drop theidlelabel, and always render asettled …line when a timestamp exists. - Add
.fleet-pulse-stalestyling 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.
Summary
The fleet panel's per-node dot now reflects how recently the node settled:
settled 4 min agosettled 24 h ago,settled 3 d agosettledInWindow(lastSettled, now)inlib/stats.tsholds the rule, tied toFLEET_WINDOW_HOURSso the cutoff matches the panel's 24h aggregates.FleetStatus.tsxpicks the dot class from it and drops theidlelabel..fleet-pulse-staleinglobals.cssfills 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 noidletextpnpm typecheck,pnpm lint, prettier🤖 Generated with Claude Code