fix(filters): label the Days to Finish slider on the PlayEvent filter bar

RangeSlider does not render its own label — the field label is emitted by
the _filter_field wrapper. The PlayEvent filter bar added the Days to Finish
slider bare, so it showed no label. Wrap it in _filter_field like every
other slider (GameFilterBar/PurchaseFilterBar).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 12:05:39 +02:00
parent 31ff5ae83e
commit 8ec8ba6c8c
2 changed files with 26 additions and 10 deletions
+3
View File
@@ -1495,6 +1495,8 @@ def _playevent_fields(existing: dict) -> list:
),
],
),
_filter_field(
"Days to Finish",
RangeSlider(
label="Days to Finish",
input_name_prefix="filter-days-to-finish",
@@ -1506,6 +1508,7 @@ def _playevent_fields(existing: dict) -> list:
min_placeholder="e.g. 1",
max_placeholder="e.g. 30",
),
),
]
return fields
+13
View File
@@ -223,6 +223,19 @@ class FilterBarRenderingTest(TestCase):
)
self._assert_shell(html, "/presets/playevents/list", "/presets/playevents/save")
def test_playevent_filter_bar_labels_days_to_finish_slider(self):
"""The Days to Finish range slider must be wrapped in a labelled field —
RangeSlider does not render its own label, so a bare slider shows none."""
from common.components import PlayEventFilterBar
html = str(
PlayEventFilterBar(
filter_json="", preset_list_url="/l", preset_save_url="/s"
)
)
self.assertIn("Days to Finish", html)
self.assertNoEscapedTags(html)
def test_game_filter_bar_has_new_widgets(self):
"""The expanded games FilterBar exposes platform_group, device, playevent_note,
purchase_type / purchase_ownership_type, plus count and aggregate-playtime