Skip to content

Commit dbe306f

Browse files
fix(clients): question option previews keep their line breaks
Previews are drafts and plain text, so a single newline separates lines ("Body:" from its text). Render them with the Markdown renderers' existing hard-line-break modes on web and mobile. AI-assisted; verified with the tests and tools listed above.
1 parent 0896472 commit dbe306f

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎apps/mobile/src/features/threads/PendingUserInputCard.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ function QuestionText(props: {
8181
readonly threadId: ThreadId;
8282
readonly workspaceRoot: string | null;
8383
readonly setDirection: TextDirection | undefined;
84+
readonly preserveSoftBreaks?: boolean;
8485
}) {
8586
const styles = useMarkdownPreviewStyles();
8687
const markdown = useLiveThreadLinkLabels(props.markdown, props.environmentId);
@@ -113,6 +114,7 @@ function QuestionText(props: {
113114
Platform.OS === "android" ? undefined : props.setDirection === "rtl" ? "right" : "left"
114115
}
115116
onLinkPress={openLink}
117+
preserveSoftBreaks={props.preserveSoftBreaks}
116118
/>
117119
);
118120
}
@@ -324,6 +326,7 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
324326
threadId={props.threadId}
325327
workspaceRoot={props.workspaceRoot}
326328
setDirection={setDirection}
329+
preserveSoftBreaks
327330
/>
328331
</View>
329332
) : null}

‎apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
329329
text={option.preview}
330330
cwd={cwd}
331331
threadRef={threadRef}
332+
lineBreaks
332333
className="ps-9 pe-2 pb-1.5 text-xs text-foreground/70 sm:ps-8"
333334
/>
334335
) : null}

0 commit comments

Comments
 (0)