fix(app): stabilize todo dock e2e with composer probe (#17267)

This commit is contained in:
Luke Parker
2026-03-13 12:21:50 +10:00
committed by GitHub
parent dcb17c6a67
commit 96b1d8f639
6 changed files with 350 additions and 74 deletions

View File

@@ -8,6 +8,7 @@ import { TextReveal } from "@opencode-ai/ui/text-reveal"
import { TextStrikethrough } from "@opencode-ai/ui/text-strikethrough"
import { Index, createEffect, createMemo, on, onCleanup } from "solid-js"
import { createStore } from "solid-js/store"
import { composerEnabled, composerProbe } from "@/testing/session-composer"
function dot(status: Todo["status"]) {
if (status !== "in_progress") return undefined
@@ -35,6 +36,7 @@ function dot(status: Todo["status"]) {
}
export function SessionTodoDock(props: {
sessionID?: string
todos: Todo[]
title: string
collapseLabel: string
@@ -69,6 +71,8 @@ export function SessionTodoDock(props: {
const off = createMemo(() => hide() > 0.98)
const turn = createMemo(() => Math.max(0, Math.min(1, value())))
const full = createMemo(() => Math.max(78, store.height))
const e2e = composerEnabled()
const probe = composerProbe(props.sessionID)
let contentRef: HTMLDivElement | undefined
createEffect(() => {
@@ -83,6 +87,23 @@ export function SessionTodoDock(props: {
onCleanup(() => observer.disconnect())
})
createEffect(() => {
if (!e2e) return
probe.set({
mounted: true,
collapsed: store.collapsed,
hidden: store.collapsed || off(),
count: props.todos.length,
states: props.todos.map((todo) => todo.status),
})
})
onCleanup(() => {
if (!e2e) return
probe.drop()
})
return (
<DockTray
data-component="session-todo-dock"