feat(tui): add PageUp/PageDown scrolling to all panes#1656
Merged
Conversation
|
All contributors have signed the DCO ✍️ ✅ |
Contributor
Author
|
I have read the DCO document and I hereby sign the DCO. |
Contributor
Author
|
recheck |
9e944ab to
9e41eb2
Compare
Add PageUp/PageDown key support to the policy, logs, and draft/rules views. All three panes now scroll by one viewport height per keypress. Also fix scroll_policy() clamping to stop at the last viewport of content instead of the last line, preventing a blank-screen overshoot on G and PageDown. Signed-off-by: Major Hayden <major@redhat.com>
9e41eb2 to
ef00759
Compare
Collaborator
|
/ok to test ef00759 |
johntmyers
approved these changes
Jun 1, 2026
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.
Summary
Add PageUp/PageDown key support to the policy, logs, and draft/rules views in
openshell term. All three scrollable panes now scroll by one viewport height per keypress, matching standard terminal conventions.Also fixes a pre-existing scroll clamping bug where pressing
G(go to bottom) or scrolling past the end would overshoot into a blank screen.Related Issue
N/A (user-reported usability gap, no tracking issue)
Changes
policy_viewport_heightfield toApp, set during draw bysandbox_policy::draw()(matches how logs/draft already store viewport height)KeyCode::PageDown/KeyCode::PageUpinhandle_policy_key(),handle_logs_key(), andhandle_draft_key()scroll_policy()max clamp to use viewport-aware bound (total - viewport) instead oftotal - 1Gkeybinding in policy view to use the same viewport-aware clampingsandbox_policy::draw()takes&mut App(consistent withsandbox_logs::draw()andsandbox_draft::draw())total > 0(consistent with PageDown)clamped_scroll()helper with 10 unit tests covering empty content, short/equal/long content, pre-first-draw viewport, and boundary clampingTesting
cargo build --release -p openshell-climise run pre-commitpasses (rust:format:check, rust:lint, helm:lint, markdown:lint, license:check all green)cargo test -p openshell-tuipasses (22 tests, including 10 new scroll tests)Checklist