8000 fix(reader): scroll a conversation painted while hidden once it shows by Dandiccf · Pull Request #463 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

fix(reader): scroll a conversation painted while hidden once it shows - #463

Closed
Dandiccf wants to merge 1 commit into
hyprlab:mainfrom
Dandiccf:fix/reader-scroll-after-map
Closed

Dandiccf wants to merge 1 commit into
hyprlab:mainfrom
Dandiccf:fix/reader-scroll-after-map

Conversation

@Dandiccf
Copy link
Copy Markdown
Contributor

A conversation opened at its top instead of its new mail

Seen on a seven-message conversation with two unread replies: clicking it showed the oldest message at the top instead of scrolling to the new ones.

Cause. Tracing the reader's renders showed two documents 7 ms apart on every such open:

  1. Show: the conversation, with the open scroll (data-hylki-noscroll absent).
  2. Mapped: the same conversation again, because the first was handed over while the WebView was not mapped (the loading cover was up), which bug: conversations don't render after clicking on an incoming mail notification #332 repaints once the view is on screen.

The second render found did_autoscroll already set, so it was stamped no-scroll; with no saved_anchor reported yet, the new document stayed at scroll 0.

Fix. On Mapped, before that repaint, did_autoscroll is cleared unless the reader has a saved place, so the document that actually shows gets the open scroll to the first unread or newest message. A place the user scrolled to is still kept.

Testing

  • cargo test: 785 passed. Clippy: nothing on the changed lines.
  • Reproduced offline with a copy of the affected profile (two replies marked unread in the copy): before, the second render was noscroll=true anchor=None and the reader stayed on the first card; after, it is noscroll=false, the anchor then reports the unread reply, and the reader shows the new messages.

This PR was prepared with AI assistance (Claude Code) and reviewed by me.

🤖 Generated with Claude Code

A document handed over while the reader was not on screen is loaded again when it maps (hyprlab#332). That second paint counted as a later render of the same conversation, so it kept the reader's place, and with no place saved yet it stayed at the top instead of scrolling to the first unread or newest message. Unless the reader has a saved place, the repaint now gets the open scroll.
hyprlab added a commit that referenced this pull request Oct 16, 2026
A conversation opened behind the loading cover spent its scroll to the first unread or newest message on a document never painted, and the repaint once on screen (#332) kept that unseen place, the top. The scroll is now owed to the first document loaded on screen, unless the reader has been scrolled by then.

Co-Authored-By: Christian Dandachi <9442922+Dandiccf@users.noreply.github.com>
@hyprlab
hyprlab commented Oct 18, 2026
Copy link
Copy Markdown
Owner

Agentic reply:

Your fix is in the 1.45.0-beta.1 release (x86_64 only), changed so the scroll is only owed after a load behind the cover: a hidden repaint with nothing saved no longer jumps the conversation when the window comes back. Please test it there and report anything that doesn't look right. It reaches the stable channel with the next stable release.

The beta build is in the repo now: flatpak update picks it up.

@hyprlab hyprlab closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0