Refactor connection indicator to patch with timestamp #11

Merged
ryan merged 1 commits from refactor/patch-connection-indicator into main 2026-03-03 20:32:11 +00:00
Owner

Summary

  • Server patches ConnectionIndicator element with current timestamp on each heartbeat
  • Client-side JS checks every second if timestamp is stale (>20s)
  • Indicator turns red when stale, green when fresh
  • Properly detects connection loss (indicator turns red if no patches received)

Previously used Datastar signals which required the client to have a lastPing signal defined.

## Summary - Server patches `ConnectionIndicator` element with current timestamp on each heartbeat - Client-side JS checks every second if timestamp is stale (>20s) - Indicator turns red when stale, green when fresh - Properly detects connection loss (indicator turns red if no patches received) Previously used Datastar signals which required the client to have a `lastPing` signal defined.
ryan added 1 commit 2026-03-03 20:25:11 +00:00
refactor: patch connection indicator with timestamp
All checks were successful
CI / Deploy / test (pull_request) Successful in 14s
CI / Deploy / lint (pull_request) Successful in 26s
CI / Deploy / deploy (pull_request) Has been skipped
19c48d593a
Server patches the ConnectionIndicator element with a timestamp on
each heartbeat. Client-side JS checks every second if the timestamp
is stale (>20s) and toggles red/green accordingly.

This properly detects connection loss since the indicator will turn
red if no patches are received.
ryan force-pushed refactor/patch-connection-indicator from 19c48d593a to 06b3839c3a 2026-03-03 20:30:59 +00:00 Compare
ryan merged commit 589d1f09e8 into main 2026-03-03 20:32:11 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/games#11