Skip to content

refactor: enhance announcement dialog logic and improve load more functionality#461

Merged
chenyme merged 1 commit into
devfrom
loading
Jul 10, 2026
Merged

refactor: enhance announcement dialog logic and improve load more functionality#461
chenyme merged 1 commit into
devfrom
loading

Conversation

@chenyme

@chenyme chenyme commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix sidebar conversation infinite scrolling failing after the initial 50 conversations.

The load-more sentinel could be rendered after its effect had already run because the real list content is mounted asynchronously by LoadingReveal. Since changes to ref.current do not trigger effects, the observer was never attached until the recent section was collapsed and expanded.

Update useLoadMoreSentinel to return a callback ref so observer setup runs whenever the sentinel DOM element is mounted. Migrate existing consumers to the same lifecycle-safe API without changing pagination behavior.

Change type

  • Bug fix
  • Feature
  • Documentation
  • Refactor
  • Configuration / deployment
  • Security hardening
  • Other

Affected areas

  • Frontend / UI
  • Backend / API
  • Authentication / authorization
  • Conversations / streaming
  • Files / RAG / extraction
  • Model routing / providers
  • MCP / tools
  • Billing / payments
  • Admin console
  • Deployment / Docker / configuration
  • Documentation

Verification

  • cd frontend && pnpm lint
  • git diff --check
  • Browser regression with an account containing more than 50 conversations was not run because suitable test data was unavailable.
  • Build was not run because this change only updates frontend observer lifecycle handling.

Screenshots, API examples, or logs

No visual changes.

Expected regression flow:

  1. Open an account containing more than 50 conversations.
  2. Scroll to the bottom of the sidebar without collapsing the recent section.
  3. Confirm that the next page loads automatically.

Configuration, migration, and compatibility notes

No configuration, API, database, deployment, or migration changes.

The shared load-more hook now returns a callback ref instead of accepting a target ref object. All existing internal consumers were migrated.

Documentation

  • Documentation is not needed for this change.
  • Documentation was updated.
  • Documentation still needs to be updated.

Security and privacy

  • No secrets, tokens, credentials, local config, or personal data are included.
  • User data access remains scoped by authenticated user context unless an admin-only path explicitly requires broader access.
  • Security-sensitive behavior was reviewed, including authentication, authorization, provider routing, file processing, billing, and admin APIs where relevant.

Checklist

  • I searched existing issues and pull requests.
  • Changes are focused and do not include unrelated refactors.
  • Tests or static verification were run where practical.
  • User-facing behavior, deployment steps, API contracts, or configuration changes are documented.
  • Generated artifacts are included only when this project explicitly requires them.
  • Caches, build output, .pyc files, .env files, and local storage data are not committed.

@chenyme chenyme self-assigned this Jul 10, 2026
@chenyme chenyme linked an issue Jul 10, 2026 that may be closed by this pull request
3 tasks
@chenyme
chenyme merged commit 2e29fd1 into dev Jul 10, 2026
10 checks passed
@chenyme
chenyme deleted the loading branch July 10, 2026 07:44
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.

[Bug]: 侧边栏向下滚动无法加载更多对话

1 participant