diff --git a/packages/ui/src/components/session-turn.css b/packages/ui/src/components/session-turn.css index 2203b6033..6bead9b57 100644 --- a/packages/ui/src/components/session-turn.css +++ b/packages/ui/src/components/session-turn.css @@ -29,20 +29,32 @@ gap: 32px; } + [data-slot="session-turn-sticky-header"] { + position: sticky; + top: 0; + background-color: var(--background-stronger); + z-index: 20; + display: flex; + flex-direction: column; + gap: 8px; + padding-bottom: 8px; + } + [data-slot="session-turn-message-header"] { display: flex; align-items: center; gap: 8px; align-self: stretch; - position: sticky; - top: 0; - background-color: var(--background-stronger); - z-index: 20; height: 32px; } - [data-slot="session-turn-message-content"] { - margin-top: -24px; + /* [data-slot="session-turn-message-content"] { */ + /* } */ + + [data-slot="session-turn-response-trigger"] { + width: calc(100% + 9px); + margin-left: -9px; + padding-left: 9px; } [data-slot="session-turn-message-title"] { diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index f57a0509b..c09754a59 100644 --- a/packages/ui/src/components/session-turn.tsx +++ b/packages/ui/src/components/session-turn.tsx @@ -73,6 +73,12 @@ export function SessionTurn( } } + function handleInteraction() { + if (working()) { + setUserScrolled(true) + } + } + createEffect(() => { if (!working()) { setUserScrolled(false) @@ -90,7 +96,7 @@ export function SessionTurn( return (
-
+
{(message) => { const assistantMessages = createMemo(() => { @@ -233,35 +239,29 @@ export function SessionTurn( data-slot="session-turn-message-container" class={props.classes?.container} > - {/* Title */} -
-
- - - - - -

{message().summary?.title}

-
-
+ {/* Sticky Header */} +
+
+
+ + + + + +

{message().summary?.title}

+
+
+
-
-
- -
- {/* Response */} -
- setStore("detailsExpanded", open)} - data-slot="session-turn-collapsible" - > - + +
+
+ +
+ {/* Response */} + +
+ + {(assistantMessage) => { + const parts = createMemo(() => data.store.part[assistantMessage.id] ?? []) + const last = createMemo(() => + parts() + .filter((p) => p?.type === "text") + .at(-1), + ) + return ( + + + p?.id !== last()?.id)} + /> + + + + + + ) + }} + + + + {error()?.data?.message as string} + + +
+
{/* Summary */}