Update files

This commit is contained in:
Mohamed Boudra
2026-02-04 13:31:30 +07:00
parent c4e37cb326
commit f1ef10dfee
2 changed files with 23 additions and 13 deletions
+2 -1
View File
@@ -388,11 +388,12 @@ const expandableBadgeStylesheet = StyleSheet.create((theme) => ({
borderWidth: theme.borderWidth[1], borderWidth: theme.borderWidth[1],
borderTopWidth: 0, borderTopWidth: 0,
borderColor: theme.colors.borderAccent, borderColor: theme.colors.borderAccent,
backgroundColor: theme.colors.surface0, backgroundColor: theme.colors.surface1,
padding: 0, padding: 0,
gap: 0, gap: 0,
flexShrink: 1, flexShrink: 1,
minWidth: 0, minWidth: 0,
overflow: "hidden",
}, },
pressableExpanded: { pressableExpanded: {
borderBottomLeftRadius: 0, borderBottomLeftRadius: 0,
@@ -159,12 +159,15 @@ export function ToolCallDetailsContent({
const sections: ReactNode[] = []; const sections: ReactNode[] = [];
const isFullBleed = display.type === "edit" || display.type === "shell"; const isFullBleed = display.type === "edit" || display.type === "shell";
const codeBlockStyle = isFullBleed ? styles.fullBleedBlock : styles.diffContainer;
if (display.type === "shell") { if (display.type === "shell") {
const hasOutput = Boolean(display.output); const command = display.command.replace(/\n+$/, "");
const output = display.output.replace(/^\n+/, "");
const hasOutput = output.length > 0;
sections.push( sections.push(
<View key="shell" style={styles.section}> <View key="shell" style={styles.section}>
<View style={styles.diffContainer}> <View style={codeBlockStyle}>
<ScrollView <ScrollView
style={[styles.codeVerticalScroll, { maxHeight }]} style={[styles.codeVerticalScroll, { maxHeight }]}
contentContainerStyle={styles.codeVerticalContent} contentContainerStyle={styles.codeVerticalContent}
@@ -180,8 +183,8 @@ export function ToolCallDetailsContent({
<View style={styles.codeLine}> <View style={styles.codeLine}>
<Text selectable style={styles.scrollText}> <Text selectable style={styles.scrollText}>
<Text style={styles.shellPrompt}>$ </Text> <Text style={styles.shellPrompt}>$ </Text>
{display.command} {command}
{hasOutput ? `\n${display.output}` : ""} {hasOutput ? `\n\n${output}` : ""}
</Text> </Text>
</View> </View>
</ScrollView> </ScrollView>
@@ -193,7 +196,7 @@ export function ToolCallDetailsContent({
sections.push( sections.push(
<View key="edit" style={styles.section}> <View key="edit" style={styles.section}>
{diffLines ? ( {diffLines ? (
<View style={styles.diffContainer}> <View style={codeBlockStyle}>
<DiffViewer diffLines={diffLines} maxHeight={maxHeight} /> <DiffViewer diffLines={diffLines} maxHeight={maxHeight} />
</View> </View>
) : null} ) : null}
@@ -399,13 +402,19 @@ const styles = StyleSheet.create((theme) => {
color: theme.colors.foregroundMuted, color: theme.colors.foregroundMuted,
fontSize: theme.fontSize.xs, fontSize: theme.fontSize.xs,
}, },
diffContainer: { diffContainer: {
borderWidth: theme.borderWidth[1], borderWidth: theme.borderWidth[1],
borderColor: theme.colors.border, borderColor: theme.colors.border,
borderRadius: theme.borderRadius.base, borderRadius: theme.borderRadius.base,
overflow: "hidden", overflow: "hidden",
backgroundColor: theme.colors.surface2, backgroundColor: theme.colors.surface2,
}, },
fullBleedBlock: {
borderWidth: 0,
borderRadius: 0,
overflow: "hidden",
backgroundColor: theme.colors.surface2,
},
codeVerticalScroll: {}, codeVerticalScroll: {},
codeVerticalContent: { codeVerticalContent: {
flexGrow: 1, flexGrow: 1,