fix(mobile): auto-follow newly sent particles in stream view #226
Reference in New Issue
Block a user
Delete Branch "claude/gracious-brown-0f98m"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a user sends a particle while viewing the end of a stream, automatically navigate to the newly created particle so they stay caught up. This mirrors the desktop behavior and prevents the stream from appearing unseen after sending a message.
Changes
StreamView.tsx:
goToParticlefromuseStreamPlaybackhookhandleParticleCreatedcallback that navigates to a new particle if the user was viewing the last particle in the streamComposeDockcomponentComposeDock.tsx:
onParticleCreatedoptional prop to the component interface with documentationuploadMediaParticleandcreateTextParticlecallsonParticleCreatedcallback after successful particle creation (only when using default send paths, not custom overrides)Implementation Details
The auto-follow logic only triggers when:
currentIndex !== -1)currentIndex === children.length - 1)This ensures users browsing earlier particles aren't interrupted, while users at the end stay caught up with new content they just sent.
https://claude.ai/code/session_01DVUwNMicXV6CzzDtNpNYFz