[#36] Use dynamic buffer size to prevent unnecessary buffer cleanups #37

Manually merged
jabber.developer merged 1 commits from fix/buffer-cleanup into master 2025-10-07 13:37:59 +00:00

Refactors buffer trimming to use dynamic line counts against PAD_SIZE (10k lines) instead of fixed entry limit (MAX_BUFFER_SIZE=200). This scales with rendered content, reducing unnecessary deletions that disrupt scrolling during history loads and mitigates stuck states.

Changes

  • Trim buffer only when total lines approach ncurses pad limit.
  • Remove unused MAX_BUFFER_SIZE variable

Header Updates (DX)

  • Detailed module overview: role (UI buffer vs. DB), features (trimming/metadata), NCurses integration.
  • Concise GPLv3 boilerplate with LICENSE pointer; add fork notice; preserve copyrights.

Partially addresses #36 (fewer cleanups); full scroll fix pending history queries.
See issue #36.

Refactors buffer trimming to use dynamic line counts against PAD_SIZE (10k lines) instead of fixed entry limit (MAX_BUFFER_SIZE=200). This scales with rendered content, reducing unnecessary deletions that disrupt scrolling during history loads and mitigates stuck states. ### Changes - Trim buffer only when total lines approach ncurses pad limit. - Remove unused MAX_BUFFER_SIZE variable ### Header Updates (DX) - Detailed module overview: role (UI buffer vs. DB), features (trimming/metadata), NCurses integration. - Concise GPLv3 boilerplate with LICENSE pointer; add fork notice; preserve copyrights. Partially addresses #36 (fewer cleanups); full scroll fix pending history queries. See issue #36.
jabber.developer added 1 commit 2025-10-07 13:17:38 +00:00
fix(buffer): use dynamic buffer size to prevent unnecessary buffer cleanups
All checks were successful
CI Code / Check spelling (pull_request) Successful in 22s
CI Code / Check coding style (pull_request) Successful in 38s
CI Code / Linux (arch) (pull_request) Successful in 13m4s
CI Code / Linux (debian) (pull_request) Successful in 13m32s
CI Code / Linux (ubuntu) (pull_request) Successful in 16m23s
CI Code / Check spelling (push) Successful in 19s
CI Code / Check coding style (push) Successful in 37s
CI Code / Linux (arch) (push) Successful in 13m8s
CI Code / Linux (ubuntu) (push) Successful in 16m2s
CI Code / Linux (debian) (push) Successful in 16m26s
6ad8a19053
Refactor buffer trimming logic to use dynamic line counts (_lines per entry)
against PAD_SIZE (10k) instead of fixed entry count (MAX_BUFFER_SIZE=200). This
prevents premature cleanups for short messages, reduces scrolling disruptions
during history loads, and scales better with rendered content size.

Delete oldest/newest entry from opposite end only when total lines approach
ncurses pad limit, minimizing unnecessary deletions.
Simplify overflow warning log by removing unused MAX_BUFFER_SIZE reference.

Update buffer.c header for improved DX:
- Add detailed module overview explaining role (in-memory UI buffer vs. DB
persistence), key features (trimming, metadata), and integration (ncurses).
- Shorten copyright/license boilerplate to concise pointer (LICENSE ref).
- Add fork notice; preserve original copyrights per GPLv3.

Partially addresses #36 (stuck scroll mitigation via fewer cleanups)
Related to #36
jabber.developer manually merged commit 6ad8a19053 into master 2025-10-07 13:37:59 +00:00
jabber.developer changed title from [36] Use dynamic buffer size to prevent unnecessary buffer cleanups to [#36] Use dynamic buffer size to prevent unnecessary buffer cleanups 2025-11-10 06:58:33 +00:00
Sign in to join this conversation.
No description provided.