fix(mobile): auto-follow newly sent particles in stream view #226

Merged
talksik merged 1 commits from claude/gracious-brown-0f98m into main 2026-05-30 18:09:44 +00:00
talksik commented 2026-05-30 17:32:03 +00:00 (Migrated from github.com)

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:

    • Extract goToParticle from useStreamPlayback hook
    • Add handleParticleCreated callback that navigates to a new particle if the user was viewing the last particle in the stream
    • Pass callback to ComposeDock component
  • ComposeDock.tsx:

    • Add onParticleCreated optional prop to the component interface with documentation
    • Capture particle IDs returned from uploadMediaParticle and createTextParticle calls
    • Invoke onParticleCreated callback after successful particle creation (only when using default send paths, not custom overrides)

Implementation Details

The auto-follow logic only triggers when:

  1. The user is currently viewing a valid particle (currentIndex !== -1)
  2. The user is viewing the last particle in the stream (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

## 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**: - Extract `goToParticle` from `useStreamPlayback` hook - Add `handleParticleCreated` callback that navigates to a new particle if the user was viewing the last particle in the stream - Pass callback to `ComposeDock` component - **ComposeDock.tsx**: - Add `onParticleCreated` optional prop to the component interface with documentation - Capture particle IDs returned from `uploadMediaParticle` and `createTextParticle` calls - Invoke `onParticleCreated` callback after successful particle creation (only when using default send paths, not custom overrides) ## Implementation Details The auto-follow logic only triggers when: 1. The user is currently viewing a valid particle (`currentIndex !== -1`) 2. The user is viewing the last particle in the stream (`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
Sign in to join this conversation.