simulate(tui): unify up/down navigation#922
Open
u9g wants to merge 2 commits into
Open
Conversation
The running view had two navigation models: i/k moved a cursor over the job list while up/down scrolled the whole page, and the summary/logs at the bottom weren't reachable by the cursor at all. Collapse both into a single up/down motion that moves the cursor through the job list and spills into page scrolling at each end, so the header/description above and the summary/logs below come into view continuously. Enter still opens the focused job's detail; i/j/k/l are removed.
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.
What
Simplifies keyboard navigation in the
lk agent simulaterunning view.Previously the view had two overlapping navigation models:
i/kmoved a cursor over the job list while the arrow keys scrolled the whole page, and the summary/logs at the bottom weren't reachable by the cursor at all — so which key did what depended on where you were looking.This collapses everything into a single motion:
Detail view, expanded-description, and PgUp/PgDn (fast page/log scroll) are unchanged.
Implementation
navVertical(delta)— cursor movement with end-of-list scroll spill, reusing the existingfollowCursor/cursorViewLinemachinery to keep the cursor visible while it drives and pin the viewport once you scroll past an end. It reads the last render's window height via a newpageWinRowsfield.scrollBy/moveCursorsplit; cursor movement no longer wraps, so hitting the last job triggers the spill.Testing
go build ./...and the simulate/TUI tests pass. Per the repo's no-TUI-output-test convention, no assertions on rendered output were added — verified by hand against a finished run.