feat(quiet-hours): let the pet hush overnight - #28
Draft
JOhnsonKC201 wants to merge 1 commit into
Draft
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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:00default 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 treatsstart === endas an empty window ("never") rather than "always", so a mis-set pair can't silence the pet around the clock.src/config.js— normalizesquietHours { on, start, end }withHH:MMvalidation, falling back to the defaults on garbage input.src/main.js— gates sound + OS toast at the singlenotify()choke point that every alert flows through, with anopts.ignoreQuietescape 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 testis green (147 passing)npx eslint src/ tests/is cleannpm run sheetand either the contact-sheet hash is unchanged (refactor) or a before/after crop is included below (intentional change) — N/A, no rendering changessrc/cat-sprite.js: re-copied it tosite/cat-sprite.js(the sync test enforces this) — N/A,cat-sprite.jsuntouched🤖 Generated with Claude Code
Generated by Claude Code