|
|
@@ -1250,7 +1250,17 @@ function UserMessage(props: {
|
|
|
}) {
|
|
|
const ctx = use()
|
|
|
const local = useLocal()
|
|
|
- const text = createMemo(() => props.parts.flatMap((x) => (x.type === "text" && !x.synthetic ? [x] : []))[0])
|
|
|
+ const text = createMemo(() => {
|
|
|
+ const texts = props.parts
|
|
|
+ .map((x) => {
|
|
|
+ if (x.type === "text" && !x.synthetic) {
|
|
|
+ return x.text
|
|
|
+ }
|
|
|
+ return null
|
|
|
+ })
|
|
|
+ .filter(Boolean)
|
|
|
+ return texts.join("\n\n")
|
|
|
+ })
|
|
|
const files = createMemo(() => props.parts.flatMap((x) => (x.type === "file" ? [x] : [])))
|
|
|
const { theme } = useTheme()
|
|
|
const [hover, setHover] = createSignal(false)
|
|
|
@@ -1285,7 +1295,7 @@ function UserMessage(props: {
|
|
|
backgroundColor={hover() ? theme.backgroundElement : theme.backgroundPanel}
|
|
|
flexShrink={0}
|
|
|
>
|
|
|
- <text fg={theme.text}>{text()?.text}</text>
|
|
|
+ <text fg={theme.text}>{text()}</text>
|
|
|
<Show when={files().length}>
|
|
|
<box flexDirection="row" paddingBottom={metadataVisible() ? 1 : 0} paddingTop={1} gap={1} flexWrap="wrap">
|
|
|
<For each={files()}>
|