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