summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-12-15 06:52:54 -0600
committerAdam <[email protected]>2025-12-15 10:20:19 -0600
commitdf2ebfac7d3dca6c2262258e6ee85a3c22cc53c3 (patch)
tree674699ff283eb8af9ddd087cbca81407020cc06d /packages/ui/src
parent5fbcb203f5a2cab13c2f7468430b25be4989063b (diff)
downloadopencode-df2ebfac7d3dca6c2262258e6ee85a3c22cc53c3.tar.gz
opencode-df2ebfac7d3dca6c2262258e6ee85a3c22cc53c3.zip
wip(desktop): progress
Diffstat (limited to 'packages/ui/src')
-rw-r--r--packages/ui/src/components/session-turn.tsx20
1 files changed, 17 insertions, 3 deletions
diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx
index 54dd01091..807092d03 100644
--- a/packages/ui/src/components/session-turn.tsx
+++ b/packages/ui/src/components/session-turn.tsx
@@ -24,6 +24,8 @@ export function SessionTurn(
props: ParentProps<{
sessionID: string
messageID: string
+ stepsExpanded?: boolean
+ onStepsExpandedChange?: (expanded: boolean) => void
classes?: {
root?: string
content?: string
@@ -222,10 +224,17 @@ export function SessionTurn(
const [store, setStore] = createStore({
status: rawStatus(),
- stepsExpanded: working(),
+ stepsExpanded: props.stepsExpanded ?? working(),
duration: duration(),
})
+ // Sync with controlled prop
+ createEffect(() => {
+ if (props.stepsExpanded !== undefined) {
+ setStore("stepsExpanded", props.stepsExpanded)
+ }
+ })
+
createEffect(() => {
const timer = setInterval(() => {
setStore("duration", duration())
@@ -262,6 +271,7 @@ export function SessionTurn(
const isWorking = working()
if (prev && !isWorking && !state.userScrolled) {
setStore("stepsExpanded", false)
+ props.onStepsExpandedChange?.(false)
}
return isWorking
}, working())
@@ -278,7 +288,7 @@ export function SessionTurn(
<div data-slot="session-turn-message-header">
<div data-slot="session-turn-message-title">
<Switch>
- <Match when={working()}>
+ <Match when={working() && message().id === userMessages().at(-1)?.id}>
<Typewriter as="h1" text={message().summary?.title} data-slot="session-turn-typewriter" />
</Match>
<Match when={true}>
@@ -298,7 +308,11 @@ export function SessionTurn(
data-slot="session-turn-collapsible-trigger-content"
variant="ghost"
size="small"
- onClick={() => setStore("stepsExpanded", !store.stepsExpanded)}
+ onClick={() => {
+ const next = !store.stepsExpanded
+ setStore("stepsExpanded", next)
+ props.onStepsExpandedChange?.(next)
+ }}
>
<Show when={working()}>
<Spinner />