diff --git a/sickdays/pyproject.toml b/sickdays/pyproject.toml index a777569..a9ce88f 100644 --- a/sickdays/pyproject.toml +++ b/sickdays/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "sickdays" -version = "0.3.0" +version = "0.4.0" description = "Shared sick-day pool: per-date, uncapped, synced; every gate respects it" requires-python = ">=3.14" # Deliberately NOT gatelock (its __init__ imports tkinter); the HMAC lives in diff --git a/sickdays/sickdays/__init__.py b/sickdays/sickdays/__init__.py index c75e58d..be93fe9 100644 --- a/sickdays/sickdays/__init__.py +++ b/sickdays/sickdays/__init__.py @@ -45,6 +45,7 @@ from sickdays._constants import ( LOCKER_ALARM, LOCKER_BOOK, LOCKER_DIET, + LOCKER_FOCUS, LOCKER_LEETCODE, LOCKER_WORKOUT, LOCKERS, @@ -70,6 +71,7 @@ __all__ = [ "LOCKER_ALARM", "LOCKER_BOOK", "LOCKER_DIET", + "LOCKER_FOCUS", "LOCKER_LEETCODE", "LOCKER_WORKOUT", "AlreadySickError", diff --git a/sickdays/sickdays/_constants.py b/sickdays/sickdays/_constants.py index e75b07e..fc2e04a 100644 --- a/sickdays/sickdays/_constants.py +++ b/sickdays/sickdays/_constants.py @@ -68,10 +68,13 @@ LOCKER_DIET: Final = "diet" #: The phone ring, the PC fallback ring, the RTC self-wake and the #: missed-alarm penalty -- one switch, because they are one alarm. LOCKER_ALARM: Final = "alarm" +#: The focus-project daily-minutes lock (focus-guard). +LOCKER_FOCUS: Final = "focus" LOCKERS: Final = ( LOCKER_WORKOUT, LOCKER_LEETCODE, LOCKER_BOOK, LOCKER_DIET, LOCKER_ALARM, + LOCKER_FOCUS, ) diff --git a/sickdays/sickdays/gui/_text.py b/sickdays/sickdays/gui/_text.py index 9c14657..5b13780 100644 --- a/sickdays/sickdays/gui/_text.py +++ b/sickdays/sickdays/gui/_text.py @@ -18,6 +18,7 @@ from sickdays._constants import ( LOCKER_ALARM, LOCKER_BOOK, LOCKER_DIET, + LOCKER_FOCUS, LOCKER_LEETCODE, LOCKER_WORKOUT, ) @@ -34,6 +35,7 @@ LOCKER_LABELS: Final = { LOCKER_BOOK: "Book", LOCKER_DIET: "Diet", LOCKER_ALARM: "Wake alarm", + LOCKER_FOCUS: "Focus", } SHEET_HELP: Final = ( diff --git a/sickdays/sickdays/tests/test_gui_text.py b/sickdays/sickdays/tests/test_gui_text.py index 43a08a9..d9a3ca9 100644 --- a/sickdays/sickdays/tests/test_gui_text.py +++ b/sickdays/sickdays/tests/test_gui_text.py @@ -26,6 +26,7 @@ def test_labels_match_the_phone() -> None: "Book", "Diet", "Wake alarm", + "Focus", ] diff --git a/sickdays/sickdays/tests/test_keep_api.py b/sickdays/sickdays/tests/test_keep_api.py index ce32448..664d77f 100644 --- a/sickdays/sickdays/tests/test_keep_api.py +++ b/sickdays/sickdays/tests/test_keep_api.py @@ -200,3 +200,11 @@ def test_the_keep_edit_refusals() -> None: remove_sick_day(TOMORROW, now=TODAY) with pytest.raises(NotSickError): set_kept_lockers(TOMORROW, ["book"], now=TODAY) + + +def test_focus_is_a_locker_a_sick_day_stands_down_unless_kept() -> None: + add_sick_day(TOMORROW, now=TODAY) + assert stands_down("focus", TOMORROW) + set_kept_lockers(TOMORROW, ["focus"], now=TODAY) + assert not stands_down("focus", TOMORROW) + assert stands_down("workout", TOMORROW)