Skip to content

fix(app): preserve session scroll position - #33875

Closed
tangtaizong666 wants to merge 3 commits into
anomalyco:devfrom
tangtaizong666:fix/app-session-scroll-restore
Closed

fix(app): preserve session scroll position#33875
tangtaizong666 wants to merge 3 commits into
anomalyco:devfrom
tangtaizong666:fix/app-session-scroll-restore

Conversation

@tangtaizong666

Copy link
Copy Markdown

Issue for this PR

Closes #33837

Type of change

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

What does this PR do?

Session tabs now save the main message timeline scroll position in the existing session layout scroll store. When returning to a saved session position, the page skips the automatic jump-to-latest path, restores the saved coordinates, and pauses auto-follow if that position is away from the bottom.

This keeps older messages in view when switching away from a desktop session tab and back.

How did you verify your code works?

  • bun test src/pages/session/session-scroll.test.ts src/pages/session/file-tab-scroll.test.ts src/context/layout-scroll.test.ts --timeout 10000
  • bun x prettier --check src/pages/session.tsx src/pages/session/timeline/message-timeline.tsx src/pages/session/session-scroll.ts src/pages/session/session-scroll.test.ts

Screenshots / recordings

N/A; no visual styling change.

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.

…ll-restore

# Conflicts:
#	packages/app/src/pages/session.tsx
…-restore

# Conflicts:
#	packages/app/src/pages/session.tsx
@github-actions github-actions Bot mentioned this pull request Jul 23, 2026
6 tasks
@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.

[Bug] Switching tabs in Opencode Desktop jumps to the latest message(切换标签页时总是跳转至最新消息位置)

1 participant