Skip to content

[WIP] feat: integrate @legendapp/list for optimized chat rendering#355

Open
xcarpentier wants to merge 3 commits intomainfrom
feature/legendapp-list-poc
Open

[WIP] feat: integrate @legendapp/list for optimized chat rendering#355
xcarpentier wants to merge 3 commits intomainfrom
feature/legendapp-list-poc

Conversation

@xcarpentier
Copy link
Copy Markdown
Contributor

  • Added @legendapp/list as a dependency for improved performance in chat rendering.
  • Updated ChatSettingsContext to include useLegendList state management.
  • Modified ChatDetail and EmptyChatContainer components to utilize useLegendList.
  • Implemented MessageContainerSwitch to dynamically choose between the original FlatList and the new Legend List implementation.
  • Enhanced chat settings page to allow users to toggle optimized chat rendering.
  • Refactored MessageContainer and related components to support the new rendering strategy.

@xcarpentier xcarpentier requested a review from Copilot September 25, 2025 16:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates the @legendapp/list library as an alternative to React Native's FlatList for optimized chat rendering performance. The implementation provides users with a toggle to choose between the original FlatList and the new Legend List implementation.

  • Added @legendapp/list dependency and created MessageContainerSwitch for dynamic implementation selection
  • Enhanced chat settings to include a toggle for optimized rendering with persistent user preference storage
  • Refactored Item components by extracting shared DayWrapper logic into reusable ItemBase module

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/react-native-gifted-chat/src/components/Item/index.tsx Removed inline DayWrapper component and updated imports to use shared ItemBase
packages/react-native-gifted-chat/src/components/Item/ItemLegend.tsx New component implementing Legend List-specific item rendering
packages/react-native-gifted-chat/src/components/Item/ItemBase.tsx Shared base components and utilities for both FlatList and Legend List implementations
packages/react-native-gifted-chat/src/MessageContainerSwitch.tsx Dynamic switch component that selects between original and Legend List implementations
packages/react-native-gifted-chat/src/MessageContainerLegend.tsx Complete Legend List implementation with performance optimizations
packages/react-native-gifted-chat/src/MessageContainerConfig.ts Configuration file for default implementation selection
packages/react-native-gifted-chat/src/GiftedChat.tsx Updated to support useLegendList prop and use MessageContainerSwitch
packages/mobile/src/pages/profile/chat-settings.page.tsx Enhanced settings page with optimized rendering toggle
packages/mobile/src/hooks/chat/useChatSettings.ts Extended hook to manage Legend List preference
packages/mobile/src/components/Settings/ChatSettingsContext.tsx Updated context to include Legend List state management
packages/mobile/src/components/Chat/EmptyChatContainer.tsx Conditional styling based on Legend List usage
packages/mobile/src/components/Chat/ChatDetail.tsx Integrated useLegendList prop from context
package.json Added @legendapp/list dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@xcarpentier xcarpentier force-pushed the feature/legendapp-list-poc branch from 164b9d1 to 0e2e4ba Compare September 25, 2025 16:42
@xcarpentier xcarpentier requested a review from Copilot September 25, 2025 16:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

packages/react-native-gifted-chat/src/MessageContainerLegend.tsx:1

  • Commented-out console.log statements should be removed from production code to keep the codebase clean.
import {

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@xcarpentier xcarpentier force-pushed the feature/legendapp-list-poc branch from 5e5dd50 to 4a1ed9b Compare September 26, 2025 07:54
@xcarpentier xcarpentier force-pushed the feature/legendapp-list-poc branch from 4a1ed9b to 35b52c6 Compare October 6, 2025 09:13
@xcarpentier xcarpentier changed the title feat: integrate @legendapp/list for optimized chat rendering [WIP] feat: integrate @legendapp/list for optimized chat rendering Oct 6, 2025
@xcarpentier xcarpentier force-pushed the feature/legendapp-list-poc branch from 35b52c6 to 94a1da3 Compare October 13, 2025 19:42
@xcarpentier xcarpentier force-pushed the feature/legendapp-list-poc branch from 94a1da3 to 5715c7b Compare October 23, 2025 12:19
- Added @legendapp/list as a dependency for improved performance in chat rendering.
- Updated ChatSettingsContext to include useLegendList state management.
- Modified ChatDetail and EmptyChatContainer components to utilize useLegendList.
- Implemented MessageContainerSwitch to dynamically choose between the original FlatList and the new Legend List implementation.
- Enhanced chat settings page to allow users to toggle optimized chat rendering.
- Refactored MessageContainer and related components to support the new rendering strategy.
@xcarpentier xcarpentier force-pushed the feature/legendapp-list-poc branch from 5715c7b to 886426f Compare October 23, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants