Skip to content

fix(app): restore history loading after session switch - #34185

Closed
ytfh44 wants to merge 1 commit into
anomalyco:devfrom
ytfh44:dev
Closed

fix(app): restore history loading after session switch#34185
ytfh44 wants to merge 1 commit into
anomalyco:devfrom
ytfh44:dev

Conversation

@ytfh44

@ytfh44 ytfh44 commented Jun 27, 2026

Copy link
Copy Markdown

When switching back to a session whose message cache was evicted, only 2 messages were loaded (initialMessagePageSize). If those filled the viewport, fill() would bail out and never trigger loadOlder(), leaving the user stuck with no visible history.

Two fixes: fill() no longer skips loadOlder when message count is <= 2, even if the viewport is full. Added a scroll-to-top listener that triggers loadOlder when the user scrolls near the top (scrollTop < 200px), matching the existing onHistoryScroll continuation threshold.

Issue for this PR

Closes #34187

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

I thought an expected behaviour and unittested it

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

When switching back to a session whose message cache was evicted, only 2 messages were loaded (initialMessagePageSize). If those filled the viewport, fill() would bail out and never trigger loadOlder(), leaving the user stuck with no visible history.

Two fixes: fill() no longer skips loadOlder when message count is <= 2, even if the viewport is full. Added a scroll-to-top listener that triggers loadOlder when the user scrolls near the top (scrollTop < 200px), matching the existing onHistoryScroll continuation threshold.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jun 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

messages vanishing on desktop

1 participant