feat: h/l focus navigation between project and session columns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 12:12:16 -04:00
parent 2a56d6584b
commit dfc7ffeaaf
2 changed files with 40 additions and 0 deletions
+32
View File
@@ -1983,3 +1983,35 @@ def test_policy_reflects_suboptions_when_sandbox_on():
assert policy is not None
assert policy.fs == "ro"
assert policy.net is False
# ---------------------------------------------------------------------------
# Task 3: h/l column focus navigation
# ---------------------------------------------------------------------------
@pytest.mark.asyncio
async def test_hl_focus_bindings_exist():
bindings = {b.key: b for b in HqtApp.BINDINGS}
assert bindings["h"].action == "focus_projects"
assert bindings["l"].action == "focus_sessions"
@pytest.mark.asyncio
async def test_h_focuses_projects_l_focuses_sessions(tmp_path):
app = HqtApp()
async with app.run_test(size=(120, 40)) as pilot:
d = tmp_path / "hl-proj"
d.mkdir()
app._project_service.create("hl", str(d))
app._load_projects()
await app.workers.wait_for_complete()
await pilot.pause()
await pilot.press("l")
await pilot.pause()
assert app.focused is app.query_one("#session-list")
await pilot.press("h")
await pilot.pause()
assert app.focused is app.query_one("#project-list")