You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
search: the detail pane never scrolls, because wrap_lines disables get_vertical_scroll #309
alt+up and alt+down change SearchTui.detail_scroll, and the detail
pane on the screen does not move. Observed on a real terminal, 160x45,
against nixosConfigurations.hetztop: twelve alt+down presses on nixpkgs.pkgs left the pane on the same first line.
Why
_build_detail_window builds the window with both of these:
_scroll_when_linewrapping does not read it at all.
So the hook is dead code, and the only thing that moves the pane is prompt_toolkit keeping the cursor visible. The cursor of that window
never moves.
Since when
Since b2b4edcd, the commit that added the interface. Both lines have
been there from the start.
Why it matters more now
Issue #305 draws default and exampleunder the description. An
option with a long description therefore hides its own default, and no
key reaches it. nixpkgs.pkgs is the example: 18 lines of description
in a pane of 20 rows.
The tests do not catch it
test_alt_arrow_scrolls_the_detail_pane asserts tui.detail_scroll == 2.
That is the state variable, and the state variable was never the problem.
A test that catches this has to read what the window drew.
Two ways to fix it
Move the cursor of the detail window, and let the scroll offsets
put it at the top._scroll_when_linewrapping clamps vertical_scroll to at most the cursor line, and clamps it from
below by height - scroll_offsets.bottom. A bottom offset of height - 1 makes both bounds the cursor line exactly, so the
cursor line becomes the top line. ScrollOffsets takes a callable,
so the offset can read the measured window height.
Wrap the text here, and set wrap_lines=False.get_vertical_scroll
then works as written, and the arithmetic is ours. The Markdown
renderer and package_tui already wrap to the width; a declaration
path and a printed default value do not, so this needs a
width-aware pass over StyleAndTextTuples that keeps the styles.
Acceptance
alt+down moves what the window draws, and not only the state.
A test reads the drawn window rather than detail_scroll.
Activity
test(search): start the interface before writing a key to it
fix(search): make the detail pane really scroll
test(search): start the interface before writing a key to it