mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
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:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user