feat: SessionList.set_mode swaps header for archived view

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 12:15:58 -04:00
parent dfc7ffeaaf
commit 8ee73ab8e3
2 changed files with 25 additions and 0 deletions
+20
View File
@@ -2015,3 +2015,23 @@ async def test_h_focuses_projects_l_focuses_sessions(tmp_path):
await pilot.press("h")
await pilot.pause()
assert app.focused is app.query_one("#project-list")
@pytest.mark.asyncio
async def test_session_list_header_reflects_archived_mode():
app = HqtApp()
async with app.run_test(size=(120, 40)) as pilot:
from hqt.tui.widgets.session_list import SessionList
from textual.widgets import Label
sl = app.query_one(SessionList)
header = sl.query_one("#session-header", Label)
assert str(header.render()) == "Sessions"
sl.set_mode(archived=True)
await pilot.pause()
assert "archived" in str(header.render()).lower()
sl.set_mode(archived=False)
await pilot.pause()
assert str(header.render()) == "Sessions"