refactor: enhance TimerPage layout and functionality; update theme and tokens for improved design consistency
- Refactored TimerPage component to improve layout and user experience. - Updated theme configuration to utilize design tokens for better maintainability. - Introduced new tokens for colors and typography to align with design principles. - Simplified state management and improved timer functionality. - Enhanced accessibility and responsiveness of UI elements.
This commit is contained in:
84 files changed
+4501
-2682
No files matched your search
@@ -60,3 +60,38 @@ def test_events_are_grouped_for_the_report(session, settings):
|
||||
summary = blocker_service.events_for_day(session, settings)
|
||||
assert summary["total"] == 4
|
||||
assert summary["by_target"][0] == {"target": "youtube.com", "count": 3}
|
||||
|
||||
|
||||
def test_masked_subdomains_are_expanded(session, settings):
|
||||
"""A hosts file has no wildcards, so `*.x` has to become real names."""
|
||||
settings.blocker.blocked_domains = ["*.google.com"]
|
||||
settings.blocker.subdomain_expansions = ["www", "mail"]
|
||||
hosts = blocker_service.expand_domains(settings)
|
||||
assert hosts == ["google.com", "www.google.com", "mail.google.com"]
|
||||
|
||||
|
||||
def test_allow_masks_carve_holes_in_block_masks(session, settings):
|
||||
settings.blocker.blocked_domains = ["*.google.com", "reddit.com"]
|
||||
settings.blocker.subdomain_expansions = ["www", "docs"]
|
||||
settings.blocker.allowed_domains = ["docs.*", "m.reddit.com"]
|
||||
hosts = blocker_service.expand_domains(settings)
|
||||
assert "docs.google.com" not in hosts
|
||||
assert "m.reddit.com" not in hosts
|
||||
assert "www.google.com" in hosts and "reddit.com" in hosts
|
||||
|
||||
|
||||
def test_patterns_a_hosts_file_cannot_express_are_reported(session, settings):
|
||||
settings.blocker.blocked_domains = ["*gram*", "youtube.com", "*.x.com"]
|
||||
assert blocker_service.unexpandable_masks(settings) == ["*gram*"]
|
||||
hosts = blocker_service.expand_domains(settings)
|
||||
assert "youtube.com" in hosts and "x.com" in hosts
|
||||
|
||||
|
||||
def test_app_masks_are_passed_through_untouched(session, settings):
|
||||
"""Process matching happens on the desktop, where globs work directly."""
|
||||
settings.blocker.enabled = True
|
||||
settings.blocker.mode = "always"
|
||||
settings.blocker.blocked_apps = ["steam*", "*discord*"]
|
||||
settings_service.save_settings(session, settings)
|
||||
policy = blocker_service.policy(session, settings)
|
||||
assert policy["apps"] == ["steam*", "*discord*"]
|
||||
Reference in new issue
Block a user