Skip to content

Add day-of-week schedule blocking feature - #4

Open
aidankeighron wants to merge 1 commit into
mainfrom
claude/festive-carson-p21ttt
Open

Add day-of-week schedule blocking feature#4
aidankeighron wants to merge 1 commit into
mainfrom
claude/festive-carson-p21ttt

Conversation

@aidankeighron

Copy link
Copy Markdown
Owner

Summary

  • New feature: Schedule Blocks — completely block all target sites on specific days of the week and time windows. No session can bypass a schedule block (highest priority check in checkAccess).
  • UI: New "Schedule Blocks" section in Options with a day-picker modal (checkboxes for Sun–Sat, start/end time pickers, overnight detection hint).
  • Blocking screen: Custom prompt.js UI for schedule blocks shows the blocked days, time window, and overnight indicator with no bypass options.
  • Overnight support: Blocks that cross midnight are handled correctly — checks curDay for the after-start portion and prevDay for the before-end (early-morning) portion.
  • Tests: 12 new Jest unit tests in tests/schedule.test.js covering basic blocking, wrong-day pass-through, overnight ranges, session override, multiple blocks, and webNavigation integration.

Files changed

File Change
background.js Added getActiveScheduleBlock(), updated checkAccess to check schedule blocks first
options.html Added Schedule Blocks section + modal with day-picker
options.js Added saveScheduleBlock, renderScheduleBlockList, deleteScheduleBlock, modal open/close
options.css Added .day-picker, .day-label styles
prompt.js Added showScheduleBlockUI(), dispatched from init() on SCHEDULE_BLOCK message
manifest.json / manifest-firefox.json Version bump 1.24 → 1.25
tests/schedule.test.js 12 new unit tests (all 91 total pass)

Generated by Claude Code

Adds a new schedule blocks system that completely blocks access to target
sites on configured days + time windows, with no session bypass possible.

Changes:
- background.js: getActiveScheduleBlock() checks day-of-week + time window;
  checkAccess() checks schedule blocks first (highest priority, above time ranges
  and active sessions); scheduleBlocks loaded from chrome.storage.local
- options.html/js: Schedule Blocks section with day-picker checkboxes and
  time range modal; renderScheduleBlockList / saveScheduleBlock / deleteScheduleBlock
- prompt.js: showScheduleBlockUI() renders a hard-block page for SCHEDULE_BLOCK
  msg with day/time details and no session options
- options.css: .day-picker / .day-label styling for checkbox row
- manifest.json/manifest-firefox.json: version 1.24 → 1.25
- tests/schedule.test.js: 12 unit tests covering active/inactive day filter,
  time window filter, session override, multi-block, and onCommitted listener

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQsp29EKiRumSNnzZnewT1
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