fix(app): align thinking section scroll layout with other detail sections (#1884)

* feat(app): make thinking sections scrollable when expanded

* fix(app): align thinking section scroll layout with other detail sections
This commit is contained in:
Slava Goltser
2026-07-17 15:07:44 -04:00
committed by GitHub
parent a414f8ea85
commit a1de743ef6

View File

@@ -490,12 +490,19 @@ function FetchDetailSection({ url, result, ds }: FetchDetailProps) {
);
}
function PlainTextSection({ text }: { text: string }) {
function ScrollablePlainTextSection({ text, ds }: { text: string; ds: DetailStyles }) {
return (
<View style={styles.plainTextSection}>
<Text selectable style={styles.plainText}>
{text}
</Text>
<View style={styles.section}>
<ScrollView
style={ds.scrollAreaStyle}
contentContainerStyle={styles.scrollContent}
nestedScrollEnabled
showsVerticalScrollIndicator
>
<Text selectable style={styles.plainText}>
{text}
</Text>
</ScrollView>
</View>
);
}
@@ -576,13 +583,7 @@ function buildUnknownSections(detail: UnknownDetail, ds: DetailStyles, t: TFunct
typeof detail.input === "string" && detail.output === null ? detail.input : null;
if (plainInputText !== null) {
return [
<View key="unknown-plain-text" style={styles.plainTextSection}>
<Text selectable style={styles.plainText}>
{plainInputText}
</Text>
</View>,
];
return [<ScrollablePlainTextSection key="unknown-plain-text" text={plainInputText} ds={ds} />];
}
const sectionsFromTopLevel = [
@@ -698,7 +699,7 @@ function buildDetailSections(
}
if (detail.type === "plain_text") {
if (!detail.text) return [];
return [<PlainTextSection key="plain-text" text={detail.text} />];
return [<ScrollablePlainTextSection key="plain-text" text={detail.text} ds={ds} />];
}
if (detail.type === "unknown") {
return buildUnknownSections(detail, ds, t);
@@ -807,10 +808,6 @@ const styles = StyleSheet.create((theme) => {
flex: 1,
minHeight: 0,
},
plainTextSection: {
gap: theme.spacing[2],
padding: theme.spacing[3],
},
plainText: {
fontFamily: theme.fontFamily.ui,
fontSize: theme.fontSize.base,