Commit e016702
committed
feat(chat): re-add native LegendList for the message thread
Replaces the inverted FlatList + KeyboardChatScrollView native thread with a
non-inverted KeyboardAwareLegendList, on top of the list-agnostic row fixes in
the parent commit.
- non-inverted list: rows render in natural order, so the sent-message
animation, separators, and header/footer components swap ends. Bottom
clearance for the input bar is reserved statically via contentContainerStyle,
with the keyboard composer inset seeded to 0 so the two don't stack.
- pagination: onStartReached/onEndReached replace the viewability-window
heuristic (useNativeSafeOnViewableItemsChanged is deleted).
- prepend jump: maintainScrollAtEnd's dataChange trigger re-pins on ANY data
change within maintainScrollAtEndThreshold of the end, so on short threads a
load-older prepend yanked the view to the bottom. The threshold stays wide
(0.5) because initialScrollAtEnd positions from estimatedItemSize and lands
short on our tall rows; instead the re-pin is suspended while a prepend is in
flight (prependActive).
- initial position: the list is not mounted until the thread is loaded, so its
first render always has data and initialScrollAtEnd lands at the newest
message. Previously, arriving from the inbox mounted the list empty and the
initial scroll ran against no data and never re-fired.
- centering: scrollToItem(viewPosition: 0.5) lands accurately here, so the
closed-loop offset corrector (viewable-range feedback, damped item-delta
scrolls) is deleted in favor of re-asserting across the pagination settle.
onScrollToIndexFailed goes with it — LegendList has no such prop.
- maintainVisibleContentPosition is on from mount so prepends hold position.
- fling cost: experimental_adaptiveRender lets rows shed their swipe pan
handlers during fast scroll, via useAdaptiveRender in long-pressable driving
the SwipeableRow `enabled` prop added in the parent commit. useAdaptiveRender
reads LegendList's state context and throws outside a LegendList, so it can
only be wired up here. The Swipeable stays mounted — toggling its tree would
remount children and flash images.
- stable renderItem: NativeRow reads the centered highlight itself, so
renderItem identity never changes and a highlight change doesn't re-render
every visible row.
Includes a temporary [LISTDBG] dump for the initial-load settle; remove before
merging.1 parent 1e868f5 commit e016702
3 files changed
Lines changed: 290 additions & 337 deletions
0 commit comments