Skip to content

feat(quiet-hours): let the pet hush overnight - #28

Draft
JOhnsonKC201 wants to merge 1 commit into
mainfrom
claude/github-access-5msfnl
Draft

feat(quiet-hours): let the pet hush overnight#28
JOhnsonKC201 wants to merge 1 commit into
mainfrom
claude/github-access-5msfnl

Conversation

@JOhnsonKC201

Copy link
Copy Markdown
Owner

What does this change?

Adds Quiet Hours — a daily do-not-disturb window during which the pet stays silent. Inside the window there's no meow/purr and no desktop toast, but the speech bubble still appears, so a reminder that lands overnight is waiting for you when you look. Off by default; a 22:00 → 08:00 default when first switched on.

How it fits together:

  • src/quiet-hours.js (new) — a pure clock check with no Electron dependency, shared by the config schema and the notify path. Handles a window that wraps past midnight (start > end) and treats start === end as an empty window ("never") rather than "always", so a mis-set pair can't silence the pet around the clock.
  • src/config.js — normalizes quietHours { on, start, end } with HH:MM validation, falling back to the defaults on garbage input.
  • src/main.js — gates sound + OS toast at the single notify() choke point that every alert flows through, with an opts.ignoreQuiet escape hatch for anything urgent.
  • src/settings.html / src/settings-renderer.js — a toggle plus From/To time pickers in the Sound card, wired through the existing load/save path.
  • tests/quiet-hours.test.js — covers the window maths (wrap-around, same-day, boundaries, empty/off) and the config normalization.

Checklist

  • npm test is green (147 passing)
  • npx eslint src/ tests/ is clean
  • If this touches rendering: ran npm run sheet and either the contact-sheet hash is unchanged (refactor) or a before/after crop is included below (intentional change) — N/A, no rendering changes
  • If this touches src/cat-sprite.js: re-copied it to site/cat-sprite.js (the sync test enforces this) — N/A, cat-sprite.js untouched
  • All art/sound in this PR is original or procedural (nothing copied from other pets or copyrighted sources)

🤖 Generated with Claude Code


Generated by Claude Code

Add a daily do-not-disturb window. Inside it the pet stays silent -
no meow/purr and no desktop toast - while the speech bubble still
appears, so a reminder that lands overnight is waiting when you look.

- quiet-hours.js: a pure clock check, shared by the config schema and
  the notify path, that handles a window wrapping past midnight and
  treats start === end as an empty window (never) rather than always.
- config.js: normalize quietHours { on, start, end } with HH:MM
  validation and a 22:00->08:00 default.
- main.js: gate sound + OS toast at the single notify() choke point,
  with an opts.ignoreQuiet escape hatch for anything urgent.
- settings: a toggle and From/To time pickers in the Sound card.
- tests for the window maths and the config normalization.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4gosv8NMKDptN5pTUUz7w
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pixelcat Ready Ready Preview Aug 13, 2026 11:37pm

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