authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-07 03:05:57-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-07 03:05:57-07:00
logdc39615aec702ea6d402168f80b4d1613f4f2e0f
treebd8ffee09cc22855b61ea0087f4b2067b06dd946
parentb7175371d9f32f3b759a922cdbf727a3214c99a2
signature Signed by PGP key B5690EEEBB952194

fix(mobile): preserve chat rows when toggling commands (#10492)


1 files changed, 7 insertions(+), 1 deletions(-)

apps/mobile/src/features/threads/ThreadFeed.tsx+7-1
......@@ -210,6 +210,7 @@ function formatMessageTime(input: string): string {
210210// text fits at the current font settings. Larger accessibility text is measured.
211211const TURN_FOLD_HEIGHT = 42; // min-h-11 (38.5) + mb-1 (3.5), with the mobile 14px rem
212212const THREAD_FEED_LAYOUT_TRANSITION = LinearTransition.duration(THREAD_DISCLOSURE_TRANSITION_MS);
213const THREAD_FEED_IMMEDIATE_TRANSITION = LinearTransition.duration(0);
213214// Tailwind spacing on the mobile 14px rem: px-3.5 on the user bubble, px-1 on
214215// assistant rows. Images size their frame from these before their own layout.
215216const USER_BUBBLE_HORIZONTAL_PADDING = 3.5 * 3.5;
......@@ -2865,8 +2866,13 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
28652866 entry.type === "message" ? `message:${entry.message.role}` : entry.type
28662867 }
28672868 getFixedItemSize={getFixedItemSize}
2869 // LegendList swaps its position and size component types when this
2870 // becomes undefined, remounting the feed and replaying row entrances.
2871 // Keep those containers mounted while ordinary updates stay immediate.
28682872 itemLayoutAnimation={
2869 disclosureToggleSettling ? THREAD_FEED_LAYOUT_TRANSITION : undefined
2873 disclosureToggleSettling
2874 ? THREAD_FEED_LAYOUT_TRANSITION
2875 : THREAD_FEED_IMMEDIATE_TRANSITION
28702876 }
28712877 onItemSizeChanged={handleItemSizeChanged}
28722878 // Measure rows well before they scroll into view so estimate→actual