@@ -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}
@@ -279,43 +281,56 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
279281 const description =
280282 option . description !== option . label ? option . description : undefined ;
281283 return (
282- < Pressable
283- key = { optionValue }
284- accessibilityRole = { question . multiSelect ? "checkbox" : "radio" }
285- accessibilityState = { { checked : selected , disabled : responseDisabled } }
286- disabled = { responseDisabled }
287- className = { cn (
288- "min-h-12 w-full rounded-2xl border px-3.5 py-3" ,
289- selected ? "border-primary bg-primary/10" : "border-border bg-input" ,
290- ) }
291- onPress = { ( ) =>
292- props . onSelectOption (
293- props . pendingUserInput . requestId ,
294- question ,
295- optionValue ,
296- )
297- }
298- >
299- < View className = "min-w-0 flex-1 gap-0.5" >
300- < Text
301- className = { cn (
302- "font-t3-bold text-sm" ,
303- selected ? "text-foreground" : "text-foreground-secondary" ,
304- ) }
305- style = { proseDirectionStyle ( option . label , setDirection ) }
306- >
307- { option . label }
308- </ Text >
309- { description ? (
284+ < View key = { optionValue } className = "gap-1.5" >
285+ < Pressable
286+ accessibilityRole = { question . multiSelect ? "checkbox" : "radio" }
287+ accessibilityState = { { checked : selected , disabled : responseDisabled } }
288+ disabled = { responseDisabled }
289+ className = { cn (
290+ "min-h-12 w-full rounded-2xl border px-3.5 py-3" ,
291+ selected ? "border-primary bg-primary/10" : "border-border bg-input" ,
292+ ) }
293+ onPress = { ( ) =>
294+ props . onSelectOption (
295+ props . pendingUserInput . requestId ,
296+ question ,
297+ optionValue ,
298+ )
299+ }
300+ >
301+ < View className = "min-w-0 flex-1 gap-0.5" >
310302 < Text
311- className = "font-sans text-sm leading-5 text-foreground-muted"
312- style = { proseDirectionStyle ( description , setDirection ) }
303+ className = { cn (
304+ "font-t3-bold text-sm" ,
305+ selected ? "text-foreground" : "text-foreground-secondary" ,
306+ ) }
307+ style = { proseDirectionStyle ( option . label , setDirection ) }
313308 >
314- { description }
309+ { option . label }
315310 </ Text >
316- ) : null }
317- </ View >
318- </ Pressable >
311+ { description ? (
312+ < Text
313+ className = "font-sans text-sm leading-5 text-foreground-muted"
314+ style = { proseDirectionStyle ( description , setDirection ) }
315+ >
316+ { description }
317+ </ Text >
318+ ) : null }
319+ </ View >
320+ </ Pressable >
321+ { option . preview ? (
322+ < View className = "px-3.5" >
323+ < QuestionText
324+ markdown = { option . preview }
325+ environmentId = { props . environmentId }
326+ threadId = { props . threadId }
327+ workspaceRoot = { props . workspaceRoot }
328+ setDirection = { setDirection }
329+ preserveSoftBreaks
330+ />
331+ </ View >
332+ ) : null }
333+ </ View >
319334 ) ;
320335 } ) }
321336 </ View >
0 commit comments