Update files
This commit is contained in:
@@ -496,7 +496,16 @@ export function AgentStreamView({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={stylesheet.contentWrapper}>
|
<View style={stylesheet.contentWrapper}>
|
||||||
<View style={stylesheet.listHeaderContent}>
|
<View
|
||||||
|
style={[
|
||||||
|
stylesheet.listHeaderContent,
|
||||||
|
// In an inverted FlatList, the header is rendered at the visual bottom, so its
|
||||||
|
// top edge can sit directly against the newest timeline item. Add a small
|
||||||
|
// padding to prevent badges (e.g. Thinking/Setup) from butting up against
|
||||||
|
// the last user message when the streaming head is present.
|
||||||
|
hasHeadItems ? { paddingTop: tightGap } : null,
|
||||||
|
]}
|
||||||
|
>
|
||||||
{hasPermissions ? (
|
{hasPermissions ? (
|
||||||
<View style={stylesheet.permissionsContainer}>
|
<View style={stylesheet.permissionsContainer}>
|
||||||
{pendingPermissionItems.map((permission) => (
|
{pendingPermissionItems.map((permission) => (
|
||||||
@@ -534,6 +543,7 @@ export function AgentStreamView({
|
|||||||
client,
|
client,
|
||||||
streamHead,
|
streamHead,
|
||||||
renderStreamItemContent,
|
renderStreamItemContent,
|
||||||
|
tightGap,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const flatListExtraData = useMemo(
|
const flatListExtraData = useMemo(
|
||||||
@@ -544,6 +554,16 @@ export function AgentStreamView({
|
|||||||
[pendingPermissionItems.length, showWorkingIndicator]
|
[pendingPermissionItems.length, showWorkingIndicator]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// FlatList's ListHeaderComponent renders at the *bottom* when inverted.
|
||||||
|
// Without explicit spacing, the newest "head" rows (like Thinking/Setup tool badges)
|
||||||
|
// can butt up directly against the most recent stream item.
|
||||||
|
const headerGapStyle = useMemo(() => {
|
||||||
|
if (!listHeaderComponent) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return { marginBottom: tightGap };
|
||||||
|
}, [listHeaderComponent, tightGap]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ToolCallSheetProvider>
|
<ToolCallSheetProvider>
|
||||||
<View style={stylesheet.container}>
|
<View style={stylesheet.container}>
|
||||||
@@ -553,6 +573,7 @@ export function AgentStreamView({
|
|||||||
data={flatListData}
|
data={flatListData}
|
||||||
renderItem={renderStreamItem}
|
renderItem={renderStreamItem}
|
||||||
keyExtractor={(item) => item.id}
|
keyExtractor={(item) => item.id}
|
||||||
|
ListHeaderComponentStyle={headerGapStyle}
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
paddingVertical: 0,
|
paddingVertical: 0,
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user