Skip to content

fix: enforce scroll bounds to prevent scrolling past content#75

Merged
agavra merged 1 commit intoagavra:mainfrom
airscholar:main
Jan 13, 2026
Merged

fix: enforce scroll bounds to prevent scrolling past content#75
agavra merged 1 commit intoagavra:mainfrom
airscholar:main

Conversation

@airscholar
Copy link
Copy Markdown
Contributor

Summary

  • Fix horizontal scrolling allowing users to scroll infinitely right past visible content
  • Fix vertical scrolling allowing users to scroll past the bottom of the diff
  • Add proper bounds checking based on actual visible content dimensions

Changes

  • Added viewport_width and max_content_width fields to DiffState and FileListState
  • Calculate max content width from visible lines only during render
  • Auto-clamp scroll_x when content changes or after vertical scrolling
  • Apply consistent viewport_height.max(1) handling to prevent edge cases

@airscholar
Copy link
Copy Markdown
Contributor Author

fixes #11

Copy link
Copy Markdown
Owner

@agavra agavra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @airscholar this looks good to me!

@agavra agavra merged commit f75d6b3 into agavra:main Jan 13, 2026
4 checks passed
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.

2 participants