fix(ui): keep the help and catalogue menus inside the screen

This commit is contained in:
beefcarver committed 2026-11-04 08:56:04 -05:00
1 parent 43ddd8666b
commit 7ba2d50503
4 files changed
+151 -70

No files matched your search

+22
View File
@@ -164,3 +164,25 @@ def test_upcoming_rows_count_the_shows_they_had_to_hide() -> None:
listed = sum(1 for line in lines if "show " in line)
hidden = int(lines[-1].split("+")[1].split()[0])
assert listed + hidden == 30
@pytest.mark.asyncio
async def test_long_show_names_stay_inside_the_pane() -> None:
"""Regression: the schedule's row maths used to overshoot by two cells."""
app = BeefyPlayerApp(provider="tilderadio", offline=True, audio=False)
async with app.run_test(size=(80, 30)) as pilot:
await pilot.pause()
now = datetime.now(timezone.utc)
app.schedule = [
Broadcast(
name="A Very Long Show Name That Would Never Fit In The Pane",
start=now + timedelta(hours=index + 1),
end=now + timedelta(hours=index + 2),
)
for index in range(6)
]
app.schedule_loaded = True
panel = app.query_one(SchedulePanel)
rows = [line.plain for line in panel.render().renderables]
assert all(len(row) == panel.size.width for row in rows)
assert all(row.startswith(("│", "╭", "╰")) for row in rows)