[#7] Fix scrolling being stuck #9

Manually merged
jabber.developer merged 2 commits from fix/scrolling-issue into master 2025-07-01 21:23:16 +00:00
  • I ran valgrind when using my new feature

How to test the functionality

  • Use page up/page down and observe that paging is smooth

Fixes #7
Closes #7

<!--- Make sure to read CONTRIBUTING.md --> <!--- It mentions the rules to follow and helpful tools --> <!-- For completed items, change [ ] to [x]. --> - [x] I ran valgrind when using my new feature ### How to test the functionality - Use page up/page down and observe that paging is smooth Fixes #7 Closes #7
jabber.developer added 2 commits 2025-07-01 18:54:19 +00:00
f27fa98 commit introduced issue of scrolling seemingly randomly being stuck and the following message flood in the logs: "WRN: Ncurses Overflow..."

A pad is an off-screen buffer — larger than the visible terminal screen — that you can scroll, render parts of, or update selectively.

Unlike regular windows, a pad is not tied to screen size. You can create a pad that's 1,000 lines tall, even if your terminal is only 40 lines tall.

This commit addresses the issue by increasing PAD_SIZE to a reasonable number,
allowing messages from buffer to be displayed without overflowing NCurses' window size (maxy).

Minor change: add .cache folder to gitignore
Clarify and improve win_page_up() scrolling offset adjustment for smoother paging
All checks were successful
CI / Check spelling (pull_request) Successful in 17s
CI / Check coding style (pull_request) Successful in 29s
CI / Linux (ubuntu) (pull_request) Successful in 11m6s
CI / Linux (debian) (pull_request) Successful in 13m9s
CI / Linux (fedora) (pull_request) Successful in 15m14s
CI / Linux (arch) (pull_request) Successful in 37m59s
CI / Check spelling (push) Successful in 16s
CI / Check coding style (push) Successful in 32s
CI / Linux (debian) (push) Successful in 9m53s
CI / Linux (ubuntu) (push) Successful in 10m9s
CI / Linux (fedora) (push) Successful in 15m8s
CI / Linux (arch) (push) Successful in 15m28s
40b7a12543
This commit refines the existing logic in win_page_up() by:
- Improving comments to clearly explain the rationale behind adjusting
  the scroll offset relative to the first buffer entry’s visual position,
  helping future maintainers understand why this is necessary.
- Fixing offset recalculation to better handle cases where older messages
  with variable heights are loaded from the DB, improving scroll smoothness.
- Changing the logging of negative *page_start values from warning to debug,
  recognizing that this can be a normal scenario when insufficient history is loaded.
- Simplifying some conditionals and renaming variables for clearer intent.

No changes yet applied to win_page_down(), but similar improvements could
be considered in the future.

Overall, this enhances the robustness and user experience of scrolling up
in chat windows, while preserving existing functional logic.
jabber.developer manually merged commit 40b7a12543 into master 2025-07-01 21:23:16 +00:00
jabber.developer changed title from Fix scrolling to Fix scrolling being stuck 2025-07-02 08:21:01 +00:00
jabber.developer changed title from Fix scrolling being stuck to [#7] Fix scrolling being stuck 2025-11-10 06:59:36 +00:00
Sign in to join this conversation.
No description provided.