Fix scroll/paging state and buffer handling #45
Reference in New Issue
Block a user
No description provided.
Delete Branch "playground/fix/scroll-stuck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary:
Fix for Scroll stuck on sending/receiving messages while scrolling the history according to issue #36
Changes:
Fixes several issues around UI buffer handling during scrolling/paging and unread message indicators.
Improves paging/unread tracking logic in the window UI to prevent missed unread indicators while scrolling.
Known issues:
Current implementation requires extra Page Down to quit from Scrolling state Issue #44
Testing
Resolves #44
130bb7d1a0tofbe73a07f3Generally LGTM, but please fix formatting for CI.
@@ -99,6 +99,7 @@ _buffer_add(ProfBuff buffer, const char* show_char, int pad_indent, GDateTime* t// With 10% margin to ensure overflow preventionwhile (buffer->lines >= PAD_SIZE - (PAD_SIZE / 10) && g_slist_length(buffer->entries) > 1) {log_debug("DELETING");If we keep this debug message in the prod, then maybe we can make it slightly more informative?
@@ -710,3 +713,3 @@// Scrolled down after reaching the bottom of the pageif ((*page_start > total_rows - page_space || (*page_start == page_space && *page_start >= total_rows)) && window->type == WIN_CHAT) {if (((*page_start > total_rows + window->layout->unread_msg - page_space) || ((*page_start == page_space + window->layout->unread_msg) && *page_start >= (total_rows + window->layout->unread_msg))) && window->type == WIN_CHAT) {At this point, it's really hard to track what this condition is doing. I suggest that we split it into variables with descriptive names so we can understand what's going on in the future
@@ -744,3 +747,3 @@// update only if position has changedif (page_start_initial != *page_start) {if ((page_start_initial != *page_start) || (window->layout->unread_msg)) {nit: I think that we can get rid of extra pair of parentheses.
@@ -749,3 +752,2 @@// switch off page if last line and space line visibleif (total_rows - *page_start == page_space) {/*switch off page if no messages left to readCould you apply our standard formatting (should apply automatically on
ctrl+shift+iin VSCode)? It will fix the CI@@ -1698,1 +1705,4 @@{/* Prevent printing and buffer update when user is viewing message history [SCROLLING]*/if ((window->layout->paged) && wins_is_current(window)) {Nice place for condition and logic.
I feel that readability could be slightly improved without extra pair of parentheses in
(window->layout->paged).LGTM! Just fix formatting for CI.
Could you rebase on master so we can see correct CI build?
8f9cc05113to395d77b38a395d77b38ato522db05090