Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/ThreadFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ const markdownLinkStyles = StyleSheet.create({
height: 14,
marginHorizontal: 3,
transform: [{ translateY: 2 }],
flexShrink: 0,
},
favicon: {
borderRadius: 3,
Expand Down Expand Up @@ -772,7 +773,7 @@ function useMarkdownStyles(
>
{ordered ? `${start + index}.` : "•"}
</NativeText>
<View className="min-w-0 flex-1">
<View className="min-w-0 flex-1" style={{ flexShrink: 1, overflow: "hidden" }}>
<Renderer node={child} depth={1} inListItem parentIsText={false} />
</View>
</View>
Expand Down Expand Up @@ -1119,10 +1120,16 @@ function renderFeedEntry(
return null;
}

// Assistant messages hit the same Android unclamped-pass bug as user
// bubbles: wide markdown blocks cause children to be positioned at
// intrinsic width before the container is clamped, overlapping the
// timestamp/copy button row. Pinning the width removes that pass.
const assistantHasWideBlock = hasWideMarkdownBlock(message.text, WIDE_MARKDOWN_BLOCK_OPTIONS);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reuse the existing wide-block result

For every assistant-message render, this repeats the identical hasWideMarkdownBlock call already made in hasWideBlock above. On Android, ordinary long messages without an early match make the helper split and scan the entire message twice; while an assistant response is streaming, that redundant linear work and allocation recurs on every update in the performance-sensitive feed. Use the existing hasWideBlock value for the assistant width condition instead.

AGENTS.md reference: AGENTS.md:L15-L17

Useful? React with 👍 / 👎.

const enterAnimated = isFreshTimestamp(message.createdAt);
return (
<Animated.View
className={cn(showAssistantMeta ? "mb-5 px-1" : "mb-2 px-1")}
style={assistantHasWideBlock ? { width: "100%" } : undefined}
{...(enterAnimated ? { entering: FadeIn.duration(220) } : {})}
>
{message.text.trim().length > 0 ? (
Expand Down
Loading