feat: add Cat Gatekeeper focus/break + bedtime companion#24
Merged
Conversation
A self-paced pomodoro companion for the live session viewer. A background focus timer (paused while the tab is blurred/hidden) triggers a full-screen cat overlay with a break countdown the user can't dismiss, then resumes a fresh focus cycle. A configurable bedtime shows a sleepy cat that locks pi-web for the rest of the session. Settings (enable, focus/break minutes, bedtime, sleep duration) live in the command menu and persist in localStorage; remaining focus survives short reloads.
Replace the drawn SVG cat with a looping, muted WebM clip served at /cat.webm (embedded via go:embed, range-served). The break and bedtime overlays reuse the same video; the sleepy variant is a CSS grayscale/dim filter. The asset is a user-supplied clip, so no third-party rights apply.
Mask the cat out of the clip with Apple's Vision foreground segmentation and re-encode as a VP9 WebM with alpha (yuva420p). The overlay now shows the cat as a floating cutout — no card/frame, just a soft drop shadow — on the dark backdrop.
… box Match the Cat Gatekeeper presentation: the cat fills the viewport and slides in from the side over ~2.8s, playback runs at 0.6x for a calmer vibe, and the countdown lives in its own translucent box at the top so text never overlaps the cat. The break overlay drops its descriptive message (timer only); the sleepy overlay keeps its short message.
A horizontal slide reads as the cat gliding across the screen, which looks wrong for a lounging (non-walking) cat. Replace it with a soft fade + rise + scale settle-in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a self-contained focus/break companion to the live session viewer, inspired by Cat Gatekeeper.
Implementation
web/src/session/cat-gatekeeper/:cat-settings.js— storage helpers + settings sheet (reusesfull-screen-sheet).cat-gatekeeper.js— tick-driven state machine, full-screen overlay, input blocking.internal/ui/live_templates/assets/cat.webm, alpha WebM) played full-screen at slower-than-realtime playback, with a top countdown box and a gentle fade entrance.session.jsstarts the controller; menu item added ininternal/ui/live_menu.go+ handled incommand-menu.js; overlay/cat CSS insession.css.Test plan
make checkgreen: frontend tests (incl. cat-gatekeeper unit tests) + Go tests + build + vet