fix(ui): keep messages visible after scrolling in non-chat windows #123

Manually merged
jabber.developer merged 5 commits from fix/scroll-non-chat-windows into master 2026-05-16 15:48:09 +00:00

5 Commits

Author SHA1 Message Date
ac7d6c31f0 fix(ui): address PR review on WIN_CHAT scroll handling
All checks were successful
CI Code / Check coding style (pull_request) Successful in 36s
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Code Coverage (pull_request) Successful in 2m40s
CI Code / Linux (debian) (pull_request) Successful in 4m38s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m53s
CI Code / Linux (arch) (pull_request) Successful in 5m41s
- Drop DB_RESPONSE_ERROR -> REACHED_BOTTOM in win_page_down: a transient
  backend error (e.g. sqlite lock) should not force the scroll state
  forward, or the user would get stuck mid-conversation expecting more
  rows that did not load.
- Trim the _win_printf comment to a single WHY line; the rest belongs in
  the originating commit message.
2026-05-16 17:57:28 +03:00
0f24910685 fix(ui): preserve WIN_CHAT messages when DB cannot replay them
All checks were successful
CI Code / Check spelling (pull_request) Successful in 16s
CI Code / Check coding style (pull_request) Successful in 32s
CI Code / Code Coverage (pull_request) Successful in 2m45s
CI Code / Linux (debian) (pull_request) Successful in 4m39s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m56s
CI Code / Linux (arch) (pull_request) Successful in 5m45s
_win_printf skipped buffer/pad append for WIN_CHAT while the user was
scrolled, relying on chatwin_db_history() to replay missed messages on
scroll-down. That replay is unavailable when PREF_DBLOG is "off" (no
write) or "redact" ([REDACTED] body), or when the backend failed to
initialize — in those cases the message was lost.

Introduce log_database_can_recover_messages() and gate the WIN_CHAT
early return on it: when recovery is impossible, fall through and
append to the buffer just like non-chat windows do. Also treat
DB_RESPONSE_ERROR in win_page_down the same as DB_RESPONSE_EMPTY so
the [SCROLLED] indicator doesn't hang when the backend is dead.
2026-05-16 17:06:31 +03:00
506794474a fix(ui): handle ai window scrolling in titlebar
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Code Coverage (pull_request) Successful in 2m45s
CI Code / Linux (debian) (pull_request) Successful in 4m37s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m52s
CI Code / Linux (arch) (pull_request) Successful in 5m40s
Add missing scroll rendering for AI windows in
the title bar draw function. This ensures AI
windows display their scrolled state consistently
with other non-chat window types.
2026-05-16 12:24:36 +00:00
ef0dd74dc1 fix(ui): preserve messages in non-chat windows while scrolled
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 27s
CI Code / Code Coverage (pull_request) Successful in 2m44s
CI Code / Linux (debian) (pull_request) Successful in 4m42s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m57s
CI Code / Linux (arch) (pull_request) Successful in 5m50s
_win_printf used to drop the buffer append and pad render for any window
in paged state, but only WIN_CHAT can recover lost messages via
chatwin_db_history on scroll-down. WIN_MUC, WIN_PRIVATE and WIN_AI have
no such fallback, so incoming and outgoing messages were silently lost
when the user was viewing history. Suppress the buffer/render only for
WIN_CHAT; for the rest, still bump unread_msg but let the message land
in the buffer so it becomes visible on scroll-down.

This also removes the manual paged/unread_msg reset before printing the
user message in cl_ev_send_ai_msg — it was a local workaround for the
same drop and is no longer needed.

The buffer-bottom reset in win_page_down (c167f487) is still required:
it is the only path that clears paged and unread_msg for non-chat
windows when the user scrolls back to the bottom (WIN_SCROLL_REACHED_BOTTOM
is set only on the is_chat DB branch).
2026-05-15 19:46:12 +03:00
c12a1bc355 fix(ui): reset paged flag at buffer bottom for non-chat windows 2026-05-15 19:46:12 +03:00