Skip to content

Conversation

@OmarAhmed-A
Copy link

Summary

This PR implements the "scroll into view" functionality when navigating the clipboard history using the keyboard (Up/Down or Left/Right arrows). Previously, the selection would move, but the list would not scroll to keep the selected item visible.

Changes

  • src/view.rs: Assigned a unique SCROLLABLE_ID to the scrollable widgets in both horizontal and vertical layouts, allowing them to be targeted by the application logic.
  • src/app.rs:
    • Updated focus_next and focus_previous to calculate the correct relative scroll offset based on the current page and item index.
    • Fixed the scroll clamping logic to ensure correct behavior.

Verification

  • Verified that pressing the arrow keys now correctly scrolls the list to show the currently selected item.

This PR starts from #160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants