fix(ui): reset paged flag at buffer bottom for non-chat windows #117
Closed
jabber.developer2
wants to merge 1 commits from
fix/paged-non-chat-windows into master
pull from: fix/paged-non-chat-windows
merge into: devs:master
devs:master
devs:feat/ai-api-type
devs:fix/editor-terminal-size
devs:ci/docker-hub-publishing
devs:feat/disco-ac
devs:feat/privacy-enhancements
devs:fix/clientid-regression
devs:fix/ai-chat-completions-followup
devs:feat/ai-custom
devs:fix/unencrypted-send
devs:rollback/pre-upstream-merge
devs:fix/autoping-warning-null-domain
devs:fix/pad-dead-space-reclaim
devs:feat/autoping-warning
devs:chore/untrack-gitversion
devs:fix/multiline-pad-clip
devs:fix/issue-112-followups
devs:fix/issue-128-migrate-v3-dedup
devs:fix/delay-timestamp-validation
devs:ref/light-cleanup
devs:fix/history-scroll-pad-redraw-storm
devs:fix/plugin-post-display-incoming-only
devs:merge/upstream-full
devs:merge-improve
devs:chore/remove-chatlog-stage-1
devs:fix/ai-json-encoding
devs:feat/no-db-backlog-114
devs:fix/scroll-non-chat-windows
devs:fix/ai-leaks
devs:feat/ai
devs:fix/ai-followups
devs:test/ai-coverage-unit-only
devs:test/ai-coverage
devs:refactor/scroll-mechanism
devs:fix/verify-per-contact-context
devs:feat/no-db-mode
devs:feat/ai-json
devs:feat/pikaur-parity-arch
devs:fix-pikaur-build
devs:feat/upstream-sync
devs:feat/functest-speedup
devs:fix/cwe-134-format-string-audit
devs:ci/separate-build-step
devs:test/autoping-functional-tests
devs:test/db-functional-tests
devs:fix/arch-build
devs:fix/xep-0030-disco-items-error-handling
devs:fix/xep-0030-empty-disco-items
devs:playground/fix/src_refactoring
devs:tests/disco
devs:fix/test-CI-stability
devs:feat/parallel-tests-clean
devs:feat/parallel-functional-tests
devs:fix/functional_tests_v2
devs:fix/functional_tests
devs:fix/connect_max_args
devs:feat/extended_debug_info
devs:playground/fix/scroll-stuck
devs:build/multicore
devs:build/reenable-fedora
devs:build/autoupdate
No Reviewers
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: devs/cproof#117
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "fix/paged-non-chat-windows"
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?
Problem
When the user scrolls up in a non-
WIN_CHATwindow (AI chat, MUC, MUC PM, console, plugin, vcard, xml-console),win_page_upsetswindow->layout->paged = 1. Subsequent_win_printfcalls then silently drop every new message:The reset back to
paged = 0lives only inside theWIN_CHAT-gated DB-fetch block inwin_page_down(lines 806–825): onlyWIN_CHATcan ever triggerWIN_SCROLL_REACHED_BOTTOM, which is the sole condition that flipspagedoff (line 847). For every other window type,pagedstays1for the rest of the session — even after the user pages all the way back down to the bottom.This is the bug behind the "AI window stops showing user messages after scrolling up" report, and the same mechanism breaks new-message rendering in MUC and console after a single page-up.
The existing
cl_ev_send_ai_msgworkaround onfeat/ai(commit010b2062a) only patches the user's own outgoing AI message: it resetspagedright beforewin_print_outgoing. Incoming AI streaming responses bypass_win_printf(they go throughwin_printlndirectly), which is why those still show — but thepagedmechanic itself remains broken for everything else.Fix
Add a generic bottom-reached reset at the end of
win_page_downfor non-chat window types:The
+ 1slack covers the past-end clamp branch a few lines above (*page_start = total_rows - page_space - 1), which landstotal_rows - *page_startonpage_space + 1even though the user is visually at the bottom.pagedwas only reset onWIN_CHAT, this extends it to every other window type that uses_win_printfWIN_SCROLL_REACHED_BOTTOMreset two lines up; same semantics, just unconditional on window typecl_ev_send_ai_msg(010b2062a) redundant — that commit can be reverted as cleanup once this landsOut of scope
_win_printfdropped whilepaged = 1) are still lost:_win_printfonly incrementsunread_msg, it does not buffer the dropped content. This is a pre-existing flaw shared with theWIN_SCROLL_REACHED_BOTTOMpath and is not introduced by this change. Recovering them is a separate task (either keep the message in the buffer + render later, or display below a "new messages" marker).win_scroll_state_tforWIN_CHATis not touched.Test plan
cl_ev_send_ai_msgresetWIN_CHAT: page-up + page-down behaviour unchanged (still uses DB-fetch path; no double reset)fix(ui): reset paged flag at buffer bottom for non-chat windowsto WIP: fix(ui): reset paged flag at buffer bottom for non-chat windowsc167f48714toe841e6ac0cWIP: fix(ui): reset paged flag at buffer bottom for non-chat windowsto fix(ui): reset paged flag at buffer bottom for non-chat windowse841e6ac0cto0096b11d24Pull request closed