feat: configure minimum splash duration

This commit is contained in:
Marcel Peterkau
2026-06-21 18:48:08 +02:00
parent dadcdb8b4a
commit e1d2b87ca1
7 changed files with 66 additions and 1 deletions
+11
View File
@@ -10,6 +10,7 @@ def test_paths_and_automation_settings_round_trip(tmp_path, monkeypatch) -> None
gnucash_path=str(tmp_path / "club.gnucash"),
theme_mode="light",
run_housekeeper_on_startup=False,
splash_minimum_seconds=0,
birthday_days_before=10,
birthday_days_after=3,
anniversary_days_before=21,
@@ -26,6 +27,16 @@ def test_paths_and_automation_settings_round_trip(tmp_path, monkeypatch) -> None
raw = json.loads(expected.path.read_text(encoding="utf-8"))
assert raw["schema_version"] == 1
assert raw["monitor_bounds"] == [-1920, 0, 1920, 1080]
assert raw["splash_minimum_seconds"] == 0
def test_splash_minimum_defaults_to_five_and_is_clamped(tmp_path, monkeypatch) -> None:
monkeypatch.setenv("CCMA_CONFIG_DIR", str(tmp_path / "config"))
assert load_config().splash_minimum_seconds == 5.0
config = AppConfig(splash_minimum_seconds=-10)
config.save()
assert load_config().splash_minimum_seconds == 0.0
def test_legacy_c3ma_environment_variables_are_still_read(tmp_path, monkeypatch) -> None:
+8
View File
@@ -31,6 +31,14 @@ def test_splash_position_centers_on_pointer_and_stays_on_screen() -> None:
) == (0, 0)
def test_splash_minimum_time_only_waits_for_remaining_duration() -> None:
from ccma.ui.splash import _remaining_minimum_ms
assert _remaining_minimum_ms(100.0, 5.0, 102.25) == 2750
assert _remaining_minimum_ms(100.0, 5.0, 106.0) == 0
assert _remaining_minimum_ms(100.0, 0.0, 100.0) == 0
def test_event_labels_hide_board_actor_but_keep_automatic_marker() -> None:
from ccma.domain.models import Event
from ccma.ui.member_tab import _event_label