fix(app): stabilize todo dock e2e with composer probe#17267
Merged
Hona merged 5 commits intoanomalyco:devfrom Mar 13, 2026
Merged
fix(app): stabilize todo dock e2e with composer probe#17267Hona merged 5 commits intoanomalyco:devfrom
Hona merged 5 commits intoanomalyco:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a lightweight, test-only driver/probe mechanism to make the session “todo dock” behavior observable and controllable in Playwright E2E, reducing reliance on UI/DOM timing for state assertions.
Changes:
- Introduces
packages/app/src/testing/session-composer.tsto support an E2E composer driver (inject state) and probe (read state) keyed bysessionID. - Wires the probe into
SessionTodoDockand adds a driver override path increateSessionComposerStatefor deterministic todo/live state during E2E. - Updates E2E fixtures to enable the composer driver and rewrites the todo dock E2E test to use driver/probe polling; extends E2E guidance docs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/app/src/testing/session-composer.ts | Adds composer driver/probe state storage under window.__opencode_e2e.composer and a shared composerEvent. |
| packages/app/src/pages/session/composer/session-todo-dock.tsx | Adds sessionID prop and reports dock state via the new composer probe. |
| packages/app/src/pages/session/composer/session-composer-state.ts | Listens for composerEvent and optionally overrides todos/live from the E2E driver. |
| packages/app/src/pages/session/composer/session-composer-region.tsx | Passes sessionID down to SessionTodoDock and refactors useSessionKey usage. |
| packages/app/e2e/session/session-composer-dock.spec.ts | Replaces todo-dock DOM assertions with driver/probe-based state assertions. |
| packages/app/e2e/fixtures.ts | Enables the composer E2E hook via addInitScript alongside the existing terminal hook. |
| packages/app/e2e/AGENTS.md | Documents best practices for waiting on observable state and adding minimal test hooks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+89
to
+96
| createEffect(() => { | ||
| probe.set({ | ||
| mounted: true, | ||
| collapsed: store.collapsed, | ||
| hidden: store.collapsed || off(), | ||
| count: props.todos.length, | ||
| states: props.todos.map((todo) => todo.status), | ||
| }) |
Comment on lines
+64
to
+75
| const sync = () => { | ||
| const next = composerDriver(id) | ||
| if (!next) { | ||
| setTest({ on: false, live: undefined, todos: undefined }) | ||
| return | ||
| } | ||
| setTest({ | ||
| on: true, | ||
| live: next.live, | ||
| todos: next.todos?.map((todo) => ({ ...todo })), | ||
| }) | ||
| } |
Comment on lines
+77
to
+85
| sync() | ||
| const onEvent = (event: Event) => { | ||
| const detail = (event as CustomEvent<{ sessionID?: string }>).detail | ||
| if (detail?.sessionID !== id) return | ||
| sync() | ||
| } | ||
| window.addEventListener(composerEvent, onEvent) | ||
| onCleanup(() => window.removeEventListener(composerEvent, onEvent)) | ||
| }) |
shellmind112
pushed a commit
to shellmind112/opencode
that referenced
this pull request
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
todoDock(...)helper instead of wall-clock and lifecycle racespackages/app/e2e/AGENTS.mdTesting