Fix message grouping and scroll behavior
Three critical fixes for message display and scrolling:
1. Message Grouping - Use step_id for tool call groupKeys
- Multiple tool calls can share the same message ID
- Each tool call has a unique step_id
- Changed groupKey from ${id}-tool_call to ${stepId}-tool_call
- Prevents tool calls from collapsing into single group in FlatList
2. Streaming Tool Calls - Show all tool calls during streaming
- Previously only showed first tool call (state.toolCalls[0])
- Now creates separate MessageGroup for each streaming tool call
- Each gets unique groupKey: streaming-tool_call-${toolCall.id}
- Tool calls accumulate in list instead of replacing each other
3. Reasoning Accumulation - Clear reasoning on phase transitions
- Fixed stored messages: Use LAST reasoning for tool calls when multiple exist
- Fixed streaming: Clear accumulated reasoning when first tool call arrives
- Prevents reasoning from assistant phase bleeding into tool call phase
4. Smart Scroll Behavior - Only auto-scroll when user is at bottom
- Tracks scroll position to determine if user is near bottom (100px threshold)
- Only auto-scrolls on content changes if user was already at bottom
- Prevents unwanted scroll jumps when streaming completes
- Allows manual scroll up to read history without interference
Technical details:
- createMessageGroup now selects reasoning intelligently based on message type
- createStreamingGroups returns array instead of single group
- useScrollToBottom tracks isNearBottomRef via onScroll handler
- ChatScreen passes onScroll and scrollEventThrottle={16} to FlatList