Skip to content

fix(app): paint cold deep-link timeline after viewport layout#9

Draft
maschwenk wants to merge 1 commit into
devfrom
fix-cold-timeline-virtualizer
Draft

fix(app): paint cold deep-link timeline after viewport layout#9
maschwenk wants to merge 1 commit into
devfrom
fix-cold-timeline-virtualizer

Conversation

@maschwenk

Copy link
Copy Markdown

Summary

  • Fixes blank conversation on cold direct navigation (e.g. Forge task deep links) when the messages API returns quickly.
  • Root cause: TanStack Virtual attached scroll observers while the scroll viewport still had height 0, so outerSize stayed 0 and getVirtualItems() stayed empty despite a non-zero totalSize.
  • Bind ScrollView viewportRef synchronously; drop Number.MAX_SAFE_INTEGER initialOffset; remeasure/re-anchor once the scroll root has a real height (including forcing scrollRect when observers miss the layout settle).

Test plan

  • Hard-navigate to a Forge task URL with a ready OpenCode session and confirm the transcript paints without throttling
  • Click away to another task and back; transcript still paints
  • Slow the messages API (~5s) and confirm transcript still paints (previous workaround path)

Made with Cursor

TanStack Virtual attached scroll observers while the embedded flex pane
still had height 0, so outerSize stayed 0 and getVirtualItems() stayed
empty despite a non-zero totalSize. Bind ScrollView's viewportRef
synchronously, drop the MAX_SAFE_INTEGER initialOffset, and remeasure /
re-anchor once the scroll root has a real height.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

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.

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.

1 participant