Skip to content

feat(ui): implement dynamic pad resizing#2122

Merged
jubalh merged 1 commit intomasterfrom
fix-2045
Mar 20, 2026
Merged

feat(ui): implement dynamic pad resizing#2122
jubalh merged 1 commit intomasterfrom
fix-2045

Conversation

@jubalh
Copy link
Copy Markdown
Member

@jubalh jubalh commented Mar 19, 2026

The ncurses pad used for rendering window history had a fixed height of 100 lines, which caused "Ncurses Overflow!" errors and broke scrolling once the content exceeded this limit.

This commit replaces the fixed limit with a dynamic resizing strategy. We use a minimum height of 100 lines.
If a pad reaches its threshold of 3000 lines, a full redraw is triggered to reclaim space from discarded messages and reset the pad height. Pads are shrunk back to the minimum height during every redraw to minimize memory usage for inactive windows.

Message history should always be smoothly scrollable now.

d7e46d6 set it from 1000 to 10000. f27fa98 set it from 1000 to 100. Probably also relevant is 4fe2c42.

Close: #2074
Fixes: #2045

I tested this by sending a lot of messages in a 1:1 chat. With this change I could scroll up fine. And Ncurses Overflow wasn't in the logs anymore.

The ncurses pad used for rendering window history had a fixed height of 100
lines, which caused "Ncurses Overflow!" errors and broke scrolling once
the content exceeded this limit.

This commit replaces the fixed limit with a dynamic resizing strategy.
We use a minimum height of 100 lines.
If a pad reaches its threshold of 3000 lines, a full redraw is triggered
to reclaim space from discarded messages and reset the pad height.
Pads are shrunk back to the minimum height during every redraw to
minimize memory usage for inactive windows.

Message history should always be smoothly scrollable now.

d7e46d6 set it from 1000 to 10000.
f27fa98 set it from 1000 to 100.
Probably also relevant is 4fe2c42.

Close: #2074
Fixes: #2045
@jubalh jubalh added this to the next milestone Mar 19, 2026
@jubalh jubalh requested a review from sjaeckel March 19, 2026 21:13
@jubalh jubalh self-assigned this Mar 19, 2026
@jubalh
Copy link
Copy Markdown
Member Author

jubalh commented Mar 20, 2026

Reminder: test in MUC

@jubalh
Copy link
Copy Markdown
Member Author

jubalh commented Mar 20, 2026

I tried it in a MUC and it seems to work fine as well.

@jubalh jubalh merged commit 53a980c into master Mar 20, 2026
7 checks passed
@jubalh jubalh deleted the fix-2045 branch March 20, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

101th history line (Buffer?) always get deleted

1 participant