?
TRCKR-182
bug testing
Created: 2025-12-10 Updated: 2025-12-16
Relationships Loading...
Attachments
Loading...
Comments (1)
agent · 2025-12-10
## Investigation Results The flaky TUI keyboard navigation tests have already been fixed in commit a390bb5 ("Fix all test failures" from Dec 9, 2025). ## Root Cause The tests were flaky because they were directly manipulating the `tabs.active` property instead of simulating user keyboard input. This bypassed Textual's async rendering and focus management, causing timing-dependent failures. ## Fix Applied (in commit a390bb5) Changed from direct property assignment to using hotkey presses via the pilot: **tests/test_tui.py lines 583-586:** - Before: `tabs.active = "projects-tab"` - After: `await pilot.press("p"); await pilot.pause()` **tests/test_tui.py lines 606-616:** - Before: `tabs.active = "projects-tab"` and `tabs.active = "milestones-tab"` - After: `await pilot.press("p")` and `await pilot.press("m")` with proper pauses **tests/tui_tests/test_navigation.py (identical changes):** - Lines 88-91: Use `await pilot.press("p")` - Lines 141-155: Use `await pilot.press("p")` and `await pilot.press("m")` ## Verification Ran all 4 previously-failing tests multiple times: - tests/test_tui.py::TestKeyboardNavigation::test_left_arrow_at_first_column_switches_to_prev_tab - tests/test_tui.py::TestKeyboardNavigation::test_table_focused_after_tab_switch - tests/tui_tests/test_navigation.py::TestKeyboardNavigation::test_left_arrow_at_first_column_switches_to_prev_tab - tests/tui_tests/test_navigation.py::TestKeyboardNavigation::test_table_focused_after_tab_switch All tests pass consistently. The full TUI test suite also passes. ## Conclusion The issue has been resolved. The fix ensures proper async rendering and focus management by simulating actual user keyboard input rather than directly manipulating widget state.