Repository navigation
Form scroll after a late error row; look tests wait for the footer - #58
Merged
Merged
Conversation
This was referenced Nov 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
No roadmap task number; a "-" row in Done. Two intermittent CI failures and their close relatives:
test_an_error_above_the_focused_field_keeps_it_in_viewfailed on ubuntu-latest in runs 45134828365 and 45137084908. The defect is in the app:MachineForm._validateshows an error row and queues_show_focused_fieldwithcall_after_refresh, but the error row's layout reaches the screen only when the row's own message loop goes idle. When the screen runs its queued callbacks first, the scroll runs on the old layout and nothing scrolls again, so the focused field ends one row below the fields area. The form now also watches#form-fields'svirtual_sizeand scrolls to the focused field again after the new layout, as the key picker already does for its body.test_empty_screen_scrolls_to_its_last_linefailed on windows-latest in run 45095854850. The defect is in the test: it measured after onepilot.pause(), before the footer had its keys, while the panes were still three rows taller. It now waits until the footer has its keys, as do four tests with the same startup pattern. Two existing waits, intest_footer_rows_follow_widthandtest_size_matrix_holds, were true when the footer had no keys at all; they now need at least one.For the user: on a small terminal, the form keeps the field being typed in visible when an error row appears above it.
Acceptance
test_an_error_laid_out_after_the_scroll_keeps_the_field_in_view) fails before the form fix and passes after ittest_empty_screen_scrolls_to_its_last_line,test_empty_screen_is_muted_with_a_footer_style_key, the three result-line height tests,test_footer_rows_follow_widthandtest_size_matrix_holdspass atTEXTUAL_FPS=45andTEXTUAL_FPS=30, with waits added and no assertion changedapp.pyThe new test patches two Textual internals,
Widget._check_refreshandScreen._invoke_and_clear_callbacks, to hold the layout of the form's fields until the screen has run its queued callbacks; the form itself is not patched. It fails with a message naming the hook if either internal is gone, or if nothing was held.TEXTUAL_FPSwas a diagnostic only; no test or CI step sets it.Checks
ruff check,ruff format --check,pytest,uv buildandcheck_package.pypassdocs/validation.md): headless only; see the validation entryCommits: the new form test is its own commit before the fix and fails there (10 of 10 runs); after the fix it passes (10 of 10). The test changes for the footer are in a separate test-only commit.
What remains untested: the form in a real terminal; a Windows machine (the Windows CI runner is the coverage); whether the list scroll after a rebuild in
app.py, which uses the samecall_after_refreshpattern, can run before the rebuilt list is laid out (backlog row).test_initial_selection_order_and_keyboard_detailsstill fails at times withTEXTUAL_FPS=30, onmainas well; it is a backlog row and is not changed here.Docs