Skip to content

Fix admin log pagination after collapsed deletions - #73

Merged
omg-xtao merged 2 commits into
NextAlone:devfrom
People-11:Upstream-PR
Aug 5, 2026
Merged

Fix admin log pagination after collapsed deletions#73
omg-xtao merged 2 commits into
NextAlone:devfrom
People-11:Upstream-PR

Conversation

@People-11

@People-11 People-11 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Bug Fixes:

  • Fix admin log pagination not loading more messages when items are removed and the list becomes short after deletions.

@sourcery-ai

sourcery-ai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR ensures admin log pagination correctly triggers after deletions collapse the list, by invoking scroll-based load checks immediately after the adapter is updated.

Sequence diagram for admin log pagination after deletions

sequenceDiagram
    participant ChannelAdminLogActivity
    participant chatAdapter
    participant chatListView

    ChannelAdminLogActivity->>chatAdapter: notifyDataSetChanged()
    ChannelAdminLogActivity->>chatListView: post(checkScrollForLoad true)
    chatListView->>ChannelAdminLogActivity: checkScrollForLoad(true)
Loading

File-Level Changes

Change Details Files
Trigger scroll-based pagination check right after admin log list data is refreshed to fix cases where deletions collapse the list and prevent further loads.
  • After notifying the chat adapter of data changes, schedule a post on the chat list view to call the scroll check method
  • Invoke the existing scroll check logic with a flag indicating forced load evaluation to ensure pagination continues after structural list changes
TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider adding a brief comment near chatListView.post(() -> checkScrollForLoad(true)); to explain that the deferred scroll check is needed to handle pagination correctly after deletions, as this behavior is non-obvious from the code alone.
  • It may be safer to guard the chatListView.post(...) call with a null and attachment check (e.g., chatListView != null && chatListView.isAttachedToWindow()) to avoid posting runnables when the view is no longer active.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a brief comment near `chatListView.post(() -> checkScrollForLoad(true));` to explain that the deferred scroll check is needed to handle pagination correctly after deletions, as this behavior is non-obvious from the code alone.
- It may be safer to guard the `chatListView.post(...)` call with a null and attachment check (e.g., `chatListView != null && chatListView.isAttachedToWindow()`) to avoid posting runnables when the view is no longer active.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@omg-xtao

omg-xtao commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

没懂,解决了什么

@People-11

People-11 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

没懂,解决了什么

操作纪录里超过50条删除记录被折叠后不往下拉拉就不继续加载的问题

@omg-xtao omg-xtao added the bug Something isn't working label Aug 5, 2026
@omg-xtao
omg-xtao merged commit 8492f7f into NextAlone:dev Aug 5, 2026
0 of 4 checks passed
@People-11
People-11 deleted the Upstream-PR branch August 5, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants