[Workshop #222] Visitor presence protocol — announce arrival and departure #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Epic: rockachopa/Timmy-time-dashboard#222 — The Workshop: Timmy as Presence
The Gap
Issue rockachopa/Timmy-time-dashboard#243 defines the bridge protocol with
visitor_entered,visitor_left, andvisitor_interactionmessages. None of these are implemented. The WS client connects and subscribes to agent channels, but never announces that a visitor has arrived.Timmy cannot "notice the door open" if nobody tells him the door opened.
What
Implement the visitor lifecycle messages in
websocket.jsso the backend knows when a human enters and leaves the Workshop.Acceptance Criteria
{type: "visitor_entered", device: "ipad|desktop|mobile", viewport: {w, h}, timestamp: ...}navigator.userAgent+ touch capability to classify as ipad/desktop/mobilebeforeunloadorvisibilitychange(hidden for >30s): send{type: "visitor_left", duration_seconds: N, timestamp: ...}visitor_enteredagain (Timmy sees them return)visitor_leftpayloadDesign Notes
This is the Workshop's "doorbell." When Timmy's sensory loop (#239) processes these events, he can greet visitors, react to their return, notice how long they stayed.
Depends on: config.js + websocket-live.js (PR #39)
Ref: rockachopa/Timmy-time-dashboard#243 (bridge protocol), #239 (sensory loop)
Implemented in PR #46.
visitor.jshandles the full visitor lifecycle:visitor_enteredsent 1.5s after load (lets WS connect first) with device type (ipad/desktop/mobile) and viewport dimensionsvisitor_leftsent onbeforeunloador after 30s hidden (visibilitychange— handles iPad Safari tab suspend)visitor_leftpayloadsendVisitorInteraction()exported for future tap-to-interact (#44)Resolved on main —
visitor.jsimplementsvisitor_entered,visitor_left, andvisitor_messageevents with device detection, viewport reporting, visibility change handling, and session duration tracking.