mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-21 04:12:08 +03:00
fix(app): make the browser tests pass after the beta merge (#59160)
This commit is contained in:
committed by
GitHub
Unverified
parent
c54677bece
commit
6adc1ae7b0
@@ -1,7 +1,9 @@
|
||||
import { expect, story } from "../../stories/playwright/story"
|
||||
|
||||
story("shows how long each background item has been running, ticking while open", async ({ mount, page }) => {
|
||||
// Time moves only when the test advances it, so waiting for fonts cannot add a tick.
|
||||
await page.clock.install({ time: new Date("2026-10-19T12:00:00Z") })
|
||||
await page.clock.pauseAt(new Date("2026-10-19T12:00:00Z"))
|
||||
await mount("session-activity-chips--subagents-and-shells")
|
||||
|
||||
await page.locator('[data-slot="session-activity-chip"]').click()
|
||||
@@ -9,6 +11,8 @@ story("shows how long each background item has been running, ticking while open"
|
||||
|
||||
// The story starts its subagents 12 s and 65 s ago, and its shells 62 min and 341 s ago.
|
||||
await expect(elapsed).toHaveText(["12s", "1m 05s", "1h 02m", "5m 41s"])
|
||||
// A late Inter swap widens the panel; measure after fonts settle.
|
||||
await page.evaluate(() => document.fonts.ready.then(() => undefined))
|
||||
const width = await page.locator('[data-slot="session-activity-panel"]').evaluate((node) => node.clientWidth)
|
||||
|
||||
await page.clock.runFor(1_000)
|
||||
|
||||
@@ -472,7 +472,7 @@ story("grows suggestions while preserving visible timeline context", async ({ mo
|
||||
const boundary = component.locator('[data-slot="composer-suggestion-boundary-story"]')
|
||||
const suggestions = component.locator('[data-component="composer-suggestions"]')
|
||||
|
||||
await expect(suggestions).toHaveCSS("max-height", "166px")
|
||||
await expect(suggestions).toHaveCSS("max-height", "164px")
|
||||
await expect(suggestions).toHaveCSS("scroll-padding-bottom", "18px")
|
||||
await expect.poll(() => suggestions.evaluate((element) => element.scrollHeight > element.clientHeight)).toBe(true)
|
||||
await expect
|
||||
@@ -497,12 +497,12 @@ story("grows suggestions while preserving visible timeline context", async ({ mo
|
||||
await boundary.evaluate((element) => {
|
||||
element.style.height = "400px"
|
||||
})
|
||||
await expect(suggestions).toHaveCSS("max-height", "306px")
|
||||
await expect(suggestions).toHaveCSS("max-height", "304px")
|
||||
})
|
||||
|
||||
story("ignores a detached suggestion boundary", async ({ mount }) => {
|
||||
const component = await mount("opencode-composer-flow--detached-command-suggestion-boundary")
|
||||
await expect(component.locator('[data-component="composer-suggestions"]')).toHaveCSS("max-height", "306px")
|
||||
await expect(component.locator('[data-component="composer-suggestions"]')).toHaveCSS("max-height", "304px")
|
||||
})
|
||||
|
||||
// ThemeProvider writes resolved token values into a <style> block, so toggling data-color-scheme by hand
|
||||
|
||||
@@ -59,53 +59,51 @@ for (const input of [
|
||||
{ name: "offset-only", count: 1, rowHeight: 600, reveal: { scrollTop: 0 } },
|
||||
{ name: "zero-height", count: 4, rowHeight: 60, reveal: {} },
|
||||
]) {
|
||||
story(
|
||||
`reveals ready measured rows after an ${input.name} reconnect${input.name === "offset-only" ? " @quarantine" : ""}`,
|
||||
async ({ page }) => {
|
||||
await page.evaluate(
|
||||
async ({ fixture, input }) => {
|
||||
const { mountTimelineVirtualizer } = await import(fixture)
|
||||
mountTimelineVirtualizer(input)
|
||||
},
|
||||
{ fixture, input },
|
||||
)
|
||||
const root = page.getByTestId("timeline-virtualizer-fixture")
|
||||
const content = root.locator("[data-timeline-virtual-content]")
|
||||
await expect(root).toHaveAttribute("data-observed-height", "180")
|
||||
await expect(content).toHaveCSS("visibility", "hidden")
|
||||
await expect(content.locator("[data-timeline-key]")).toHaveCount(1)
|
||||
story(`reveals ready measured rows after an ${input.name} reconnect`, async ({ page }) => {
|
||||
await page.evaluate(
|
||||
async ({ fixture, input }) => {
|
||||
const { mountTimelineVirtualizer } = await import(fixture)
|
||||
mountTimelineVirtualizer(input)
|
||||
},
|
||||
{ fixture, input },
|
||||
)
|
||||
const root = page.getByTestId("timeline-virtualizer-fixture")
|
||||
const content = root.locator("[data-timeline-virtual-content]")
|
||||
await expect(root).toHaveAttribute("data-observed-height", "180")
|
||||
await expect(content).toHaveCSS("visibility", "hidden")
|
||||
await expect(content.locator("[data-timeline-key]")).toHaveCount(1)
|
||||
|
||||
if (input.name === "offset-only") {
|
||||
await expect(root).toHaveAttribute("data-last-scroll-top", "484")
|
||||
await root.locator("[data-scrollable]").dispatchEvent("wheel", { deltaY: -1 })
|
||||
await expect(root.getByTestId("timeline-controls")).toHaveAttribute("data-pinned", "false")
|
||||
}
|
||||
if (input.name === "offset-only") {
|
||||
// Pinned to the end: the 600px row and the virtualizer's 82px tail, less the 180px viewport.
|
||||
await expect(root).toHaveAttribute("data-last-scroll-top", "502")
|
||||
await root.locator("[data-scrollable]").dispatchEvent("wheel", { deltaY: -1 })
|
||||
await expect(root.getByTestId("timeline-controls")).toHaveAttribute("data-pinned", "false")
|
||||
}
|
||||
|
||||
if (input.name === "zero-height") {
|
||||
await root.getByRole("button", { name: "Hide viewport", exact: true }).click()
|
||||
// Wait for ResizeObserver to clear the actual range, not just for display:none.
|
||||
await expect(root).toHaveAttribute("data-observed-height", "0")
|
||||
await expect(content.locator("[data-timeline-key]")).toHaveCount(0)
|
||||
}
|
||||
if (input.name === "zero-height") {
|
||||
await root.getByRole("button", { name: "Hide viewport", exact: true }).click()
|
||||
// Wait for ResizeObserver to clear the actual range, not just for display:none.
|
||||
await expect(root).toHaveAttribute("data-observed-height", "0")
|
||||
await expect(content.locator("[data-timeline-key]")).toHaveCount(0)
|
||||
}
|
||||
|
||||
await expect(root).not.toHaveAttribute("data-first-reveal")
|
||||
const resizes = await root.getAttribute("data-viewport-resizes")
|
||||
await root.getByRole("button", { name: "Reconnect ready rows", exact: true }).click()
|
||||
await expect(content).toHaveCSS("visibility", "visible")
|
||||
await expect(root).toHaveAttribute("data-first-reveal", /.+/)
|
||||
expect(await root.evaluate((element) => JSON.parse(element.dataset.firstReveal!))).toMatchObject({
|
||||
rows: input.count === 1 ? [0] : [0, 1, 2, 3],
|
||||
pendingMarkdown: 0,
|
||||
clipped: [],
|
||||
viewportHeight: 180,
|
||||
...input.reveal,
|
||||
})
|
||||
await expect(root).not.toHaveAttribute("data-first-reveal")
|
||||
const resizes = await root.getAttribute("data-viewport-resizes")
|
||||
await root.getByRole("button", { name: "Reconnect ready rows", exact: true }).click()
|
||||
await expect(content).toHaveCSS("visibility", "visible")
|
||||
await expect(root).toHaveAttribute("data-first-reveal", /.+/)
|
||||
expect(await root.evaluate((element) => JSON.parse(element.dataset.firstReveal!))).toMatchObject({
|
||||
rows: input.count === 1 ? [0] : [0, 1, 2, 3],
|
||||
pendingMarkdown: 0,
|
||||
clipped: [],
|
||||
viewportHeight: 180,
|
||||
...input.reveal,
|
||||
})
|
||||
|
||||
if (input.name === "offset-only") {
|
||||
// This repair must not depend on another native scroll or resize delivery.
|
||||
await expect(root).toHaveAttribute("data-scrolls", "0")
|
||||
await expect(root).toHaveAttribute("data-viewport-resizes", resizes!)
|
||||
}
|
||||
},
|
||||
)
|
||||
if (input.name === "offset-only") {
|
||||
// This repair must not depend on another native scroll or resize delivery.
|
||||
await expect(root).toHaveAttribute("data-scrolls", "0")
|
||||
await expect(root).toHaveAttribute("data-viewport-resizes", resizes!)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -51,39 +51,36 @@ story("sizes provider options to their content", async ({ mount, page }) => {
|
||||
for (const width of [360, 1200]) {
|
||||
for (const direction of ["ltr", "rtl"]) {
|
||||
for (const theme of ["light", "dark"]) {
|
||||
story(
|
||||
`selects and confirms a provider at ${width}px in ${direction} ${theme}${width === 360 ? " @quarantine" : ""}`,
|
||||
async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width, height: 900 })
|
||||
story(`selects and confirms a provider at ${width}px in ${direction} ${theme}`, async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width, height: 900 })
|
||||
|
||||
const component = await mount("app-current-session-surface--web-search-request", {
|
||||
globals: { theme, direction },
|
||||
})
|
||||
const component = await mount("app-current-session-surface--web-search-request", {
|
||||
globals: { theme, direction },
|
||||
})
|
||||
|
||||
const card = component.getByRole("region", { name: "Third-party web search" })
|
||||
const select = card.getByRole("button", { name: /^Search provider/ })
|
||||
await expect(select).toBeEnabled()
|
||||
await expect(card).toHaveCSS("direction", direction)
|
||||
expect(await card.evaluate((node) => node.scrollWidth <= node.clientWidth)).toBe(true)
|
||||
await select.focus()
|
||||
await select.press("Enter")
|
||||
const list = page.getByRole("listbox", { name: "Search provider", exact: true })
|
||||
await expect(list).toHaveCSS("direction", direction)
|
||||
await list.getByRole("option", { name: "Parallel", exact: true }).click()
|
||||
await expect(select).toHaveText("Parallel")
|
||||
await expect(card).toBeVisible()
|
||||
await expect(component.getByRole("status")).toHaveText("Ready")
|
||||
await expect(select).toBeFocused()
|
||||
await select.press("Tab")
|
||||
await expect(card.getByRole("button", { name: "Don’t use search", exact: true })).toBeFocused()
|
||||
await page.keyboard.press("Tab")
|
||||
const enable = card.getByRole("button", { name: "Enable", exact: true })
|
||||
await expect(enable).toBeFocused()
|
||||
await enable.press("Enter")
|
||||
await expect(component.getByRole("status")).toHaveText("Web search selection (local only): parallel")
|
||||
await expect(card).toHaveCount(0)
|
||||
},
|
||||
)
|
||||
const card = component.getByRole("region", { name: "Third-party web search" })
|
||||
const select = card.getByRole("button", { name: /^Search provider/ })
|
||||
await expect(select).toBeEnabled()
|
||||
await expect(card).toHaveCSS("direction", direction)
|
||||
expect(await card.evaluate((node) => node.scrollWidth <= node.clientWidth)).toBe(true)
|
||||
await select.focus()
|
||||
await select.press("Enter")
|
||||
const list = page.getByRole("listbox", { name: "Search provider", exact: true })
|
||||
await expect(list).toHaveCSS("direction", direction)
|
||||
await list.getByRole("option", { name: "Parallel", exact: true }).click()
|
||||
await expect(select).toHaveText("Parallel")
|
||||
await expect(card).toBeVisible()
|
||||
await expect(component.getByRole("status")).toHaveText("Ready")
|
||||
await expect(select).toBeFocused()
|
||||
await select.press("Tab")
|
||||
await expect(card.getByRole("button", { name: "Don’t use search", exact: true })).toBeFocused()
|
||||
await page.keyboard.press("Tab")
|
||||
const enable = card.getByRole("button", { name: "Enable", exact: true })
|
||||
await expect(enable).toBeFocused()
|
||||
await enable.press("Enter")
|
||||
await expect(component.getByRole("status")).toHaveText("Web search selection (local only): parallel")
|
||||
await expect(card).toHaveCount(0)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,12 @@
|
||||
# Quarantined browser tests
|
||||
|
||||
Beta pull request and push runs skip the 23 tests tagged `@quarantine` (`--grep-invert @quarantine`). Most failed in every beta run, so they gave no signal and slowed every leg with retries. `dev` runs are unchanged.
|
||||
Beta pull request and push runs skip tests tagged `@quarantine` (`--grep-invert @quarantine`), so a test that fails in every run stops slowing every leg with retries. `dev` runs are unchanged.
|
||||
|
||||
To run only the quarantined tests, use `gh workflow run check-test.yml --ref beta -f quarantine=true`. Their legs report without failing the e2e checks. `nightly-beta.yml` dispatches that run, plus a full beta run, every night. GitHub fires schedules only from the default branch (`dev`), so the nightly run starts once that workflow is on `dev`; until then, dispatch by hand.
|
||||
To run only the quarantined tests, use `gh workflow run check-test.yml --ref beta -f quarantine=true`. Their legs report without failing the e2e checks. `nightly-beta.yml` dispatches that run, plus a full beta run, every night.
|
||||
|
||||
**Rule:** fix a quarantined test or delete it within 14 days of quarantine. When a fix lands, remove the tag and its row in the same pull request. Never quarantine a test that fails because of your own change; fix the test or the change.
|
||||
|
||||
Quarantined 2026-10-21, so the deadline is **2026-11-04**; the rows first seen red on 2026-10-22 were added that day and are due **2026-11-05**. "First red" is the earliest beta run seen failing; runs before 2026-10-20 05:32 UTC were not collected. "Unowned" means `git blame` points at the history import (#53822).
|
||||
No tests are quarantined. When you quarantine one, list it below with its failure signature, the date it was first seen red, and its owner.
|
||||
|
||||
## App e2e (`packages/app/e2e`)
|
||||
|
||||
| Test | Failure signature | First red | Owner |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------ | ----------- |
|
||||
| `regression/timeline-cache.spec.ts` › focuses Find in the selected cached timeline | `timeline-search-bar input` `toBeFocused()`: inactive | ≤ 2026-10-20 05:32 | unowned |
|
||||
| `regression/timeline-cache.spec.ts` › disposes the old workspace's shell while destination history is loading | `[data-session-title]` text has a `smoke-project/` prefix | ≤ 2026-10-20 05:32 | unowned |
|
||||
| `regression/mobile-timeline-scroll.spec.ts` › Pixel 7 › returns Home after scrolling the touch target out of view (touchEnd) | `Part 66.` `not.toBeInViewport()`: still in viewport | ≤ 2026-10-20 05:32 | unowned |
|
||||
| `regression/mobile-timeline-scroll.spec.ts` › Pixel 7 › returns Home after scrolling the touch target out of view (touchCancel) | same | ≤ 2026-10-20 05:32 | unowned |
|
||||
| `regression/mobile-timeline-scroll.spec.ts` › iPhone 13 › returns Home after scrolling the touch target out of view (touchEnd) | same | ≤ 2026-10-20 05:32 | unowned |
|
||||
| `regression/mobile-timeline-scroll.spec.ts` › iPhone 13 › returns Home after scrolling the touch target out of view (touchCancel) | same | ≤ 2026-10-20 05:32 | unowned |
|
||||
| `regression/new-session.spec.ts` › keeps the user message blue for a managed worktree | `user-message-text` color `rgb(245, 248, 255)`, received `rgb(242, 242, 242)` | ≤ 2026-10-20 11:29 | Luke Parker |
|
||||
| `regression/new-session.spec.ts` › keeps the user message blue for the main root written with Windows case and separators | same | ≤ 2026-10-20 11:29 | Luke Parker |
|
||||
| `regression/review.spec.ts` › open file tab browses, searches, and tracks missing files | file search request has an unexpected `directory` field | ≤ 2026-10-20 11:29 | unowned |
|
||||
| `regression/review.spec.ts` › rereads a file each time an artifact link opens it | `first draft` never visible in `#review-panel` | ≤ 2026-10-20 11:29 | unowned |
|
||||
| `regression/session-queue.spec.ts` › keeps finished tools above a pending steer follow-up | pending steer color `rgb(242, 242, 242)`, received `rgb(250, 250, 250)` | ≤ 2026-10-20 11:29 | unowned |
|
||||
| `regression/tabs.spec.ts` › switching between busy sessions keeps the busy indicators and the activity capsule at rest | `html` keeps `data-test-capsule-missing` | ≤ 2026-10-20 05:32 | Kit Langton |
|
||||
| `regression/review.spec.ts` › restores review state and the side-panel tab per session | heading `Alpha review state` not found | ≤ 2026-10-22 16:26 | unowned |
|
||||
| `regression/session-queue.spec.ts` › reverting to another prompt replaces the file chips of an earlier restore | `Rewind to here` resolves to 2 buttons (strict mode) | ≤ 2026-10-22 16:26 | unowned |
|
||||
| `regression/session-queue.spec.ts` › waiting steers group under one Pending line, each keeping its own actions beside its bubble | `Move to queue` resolves to 2 buttons (strict mode) | ≤ 2026-10-22 16:26 | Kit Langton |
|
||||
| `regression/session-timeline-accessibility.spec.ts` › shows the agent name in message meta when agents are on | meta `Pending·Build·…`, expected `/^Build\s·\s/` | ≤ 2026-10-22 16:26 | Kit Langton |
|
||||
| `regression/timeline-stream.spec.ts` › static projection › renders current protocol notices in CLI order | `session-timeline-notice` classes differ | ≤ 2026-10-22 16:26 | unowned |
|
||||
| `regression/timeline-stream.spec.ts` › background shortcut › holds a revealed shell from far below just under its stuck group header | predicate expected `0`, received `1` (10 s) | ≤ 2026-10-22 16:26 | unowned |
|
||||
|
||||
## App component tests (`packages/app/component-tests`)
|
||||
|
||||
| Test | Failure signature | First red | Owner |
|
||||
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ------------------ | ------- |
|
||||
| `websearch.spec.ts` › selects and confirms a provider at 360px in ltr light | 60 s timeout clicking the `Parallel` option: element is not stable | ≤ 2026-10-20 06:39 | unowned |
|
||||
| `websearch.spec.ts` › selects and confirms a provider at 360px in ltr dark | same | ≤ 2026-10-20 06:39 | unowned |
|
||||
| `websearch.spec.ts` › selects and confirms a provider at 360px in rtl light | same | ≤ 2026-10-20 06:39 | unowned |
|
||||
| `websearch.spec.ts` › selects and confirms a provider at 360px in rtl dark | same | ≤ 2026-10-20 06:39 | unowned |
|
||||
| `timeline-virtualizer.spec.ts` › reveals ready measured rows after an offset-only reconnect | `data-last-scroll-top` `484`, received `502` | ≤ 2026-10-20 06:39 | unowned |
|
||||
| Test | Failure signature | First red | Owner |
|
||||
| ---- | ----------------- | --------- | ----- |
|
||||
|
||||
@@ -647,9 +647,7 @@ for (const device of ["Pixel 7", "iPhone 13"]) {
|
||||
const cause =
|
||||
detach === "scroll" ? "scrolling the touch target out of view" : "streaming replaces the touch target"
|
||||
|
||||
test(`returns Home after ${cause} (${release})${detach === "scroll" ? " @quarantine" : ""}`, async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
test(`returns Home after ${cause} (${release})`, async ({ page }, testInfo) => {
|
||||
const image = Promise.withResolvers<void>()
|
||||
const url = new URL(`/${detach}-target-image.svg`, testInfo.project.use.baseURL).href
|
||||
await page.route(url, async (route) => {
|
||||
@@ -722,18 +720,22 @@ for (const device of ["Pixel 7", "iPhone 13"]) {
|
||||
|
||||
if (detach === "scroll") {
|
||||
const bounds = (await scroller.boundingBox())!
|
||||
const touched = page.getByText("Part 66.", { exact: true })
|
||||
// The timeline scrolls on under the composer, and rows behind it stay mounted, so the drag must carry the
|
||||
// touched row past the bottom of the screen before virtualization removes it.
|
||||
const touched = page.getByText("Part 68.", { exact: true })
|
||||
await expect(touched).toBeInViewport()
|
||||
const box = (await touched.boundingBox())!
|
||||
const point = { x: bounds.x + 100, y: box.y + box.height / 2 }
|
||||
await devtools.send("Input.dispatchTouchEvent", {
|
||||
type: "touchStart",
|
||||
touchPoints: [{ x: bounds.x + 100, y: bounds.y + 70 }],
|
||||
touchPoints: [point],
|
||||
timestamp: restingTimestamp(),
|
||||
})
|
||||
|
||||
for (let step = 1; step <= 23; step++)
|
||||
await devtools.send("Input.dispatchTouchEvent", {
|
||||
type: "touchMove",
|
||||
touchPoints: [{ x: bounds.x + 100, y: bounds.y + 70 + step * 30 }],
|
||||
touchPoints: [{ x: point.x, y: point.y + step * 30 }],
|
||||
timestamp: restingTimestamp(),
|
||||
})
|
||||
await expect(touched).not.toBeInViewport()
|
||||
@@ -765,7 +767,7 @@ for (const device of ["Pixel 7", "iPhone 13"]) {
|
||||
await expect(hidden).toHaveCount(1)
|
||||
}
|
||||
|
||||
const anchor = page.getByText(detach === "scroll" ? "Part 47." : "Reading 20.", { exact: true })
|
||||
const anchor = page.getByText(detach === "scroll" ? "Part 48." : "Reading 20.", { exact: true })
|
||||
await expect(anchor).toBeInViewport()
|
||||
const before = await anchor.evaluate((element) => element.getBoundingClientRect().top)
|
||||
image.resolve()
|
||||
|
||||
@@ -154,6 +154,7 @@ test("branch search keeps results on screen while a query is pending", async ({
|
||||
const observer = new MutationObserver(() => {
|
||||
if (!list.querySelector('[role="option"]')) list.setAttribute("data-emptied", "")
|
||||
})
|
||||
|
||||
observer.observe(list, { childList: true, subtree: true })
|
||||
})
|
||||
|
||||
@@ -704,7 +705,7 @@ for (const row of [
|
||||
accent: false,
|
||||
},
|
||||
]) {
|
||||
test(`keeps the user message blue for ${row.name} @quarantine`, async ({ page }) => {
|
||||
test(`keeps the user message grey for ${row.name}`, async ({ page }) => {
|
||||
const inventory: WorktreeDirectory[] = [{ directory: accentRoot }, { directory: accentWorkspace, strategy: "git" }]
|
||||
|
||||
const listed = page.waitForResponse(
|
||||
@@ -750,8 +751,8 @@ for (const row of [
|
||||
await expectBackground(send, "icon-button-contrast")
|
||||
const message = page.locator('[data-slot="user-message-text"]')
|
||||
await expect(message).toHaveText("Check this fixture workspace.")
|
||||
await expectToken(message, "background-color", "--v2-blue-100")
|
||||
await expectToken(message, "color", "--v2-blue-700")
|
||||
await expectToken(message, "background-color", "--v2-background-bg-layer-02")
|
||||
await expectToken(message, "color", "--v2-text-text-base")
|
||||
|
||||
if (!row.accent) return
|
||||
|
||||
|
||||
@@ -123,8 +123,8 @@ test("a rejected Git init releases its session's button without showing an error
|
||||
await expect(init).toBeEnabled()
|
||||
})
|
||||
|
||||
test("open file tab browses, searches, and tracks missing files @quarantine", async ({ page }) => {
|
||||
const searches: { query: string; dirs?: string; limit?: number }[] = []
|
||||
test("open file tab browses, searches, and tracks missing files", async ({ page }) => {
|
||||
const searches: { query: string; dirs?: string; limit?: number; directory: string }[] = []
|
||||
const directory = "C:/OpenCode/ReviewOpenFile"
|
||||
const files = Array.from({ length: 80 }, (_, index) => `file-${String(index).padStart(2, "0")}.ts`)
|
||||
|
||||
@@ -216,7 +216,7 @@ test("open file tab browses, searches, and tracks missing files @quarantine", as
|
||||
await expect(tab("nested.ts")).toHaveAttribute("aria-selected", "true")
|
||||
await expect(sidebarToggle).toBeEnabled()
|
||||
await expect(panel.getByText("contents:src/nested.ts", { exact: true })).toBeVisible()
|
||||
expect(searches).toContainEqual({ query: "nested", dirs: "file", limit: 200 })
|
||||
expect(searches).toContainEqual({ query: "nested", dirs: "file", limit: 200, directory })
|
||||
|
||||
await browseFiles(page)
|
||||
await expect(tab("nested.ts")).toHaveCount(1)
|
||||
@@ -252,6 +252,9 @@ test("open file tab browses, searches, and tracks missing files @quarantine", as
|
||||
await expect
|
||||
.poll(() => viewport.evaluate((element) => element.scrollHeight - element.clientHeight - element.scrollTop))
|
||||
.toBeLessThanOrEqual(1)
|
||||
// The tree ignores the pointer until a scroll settles. A click before then hits the scroller, and Playwright's retry
|
||||
// scrolls the row into view itself, which moves the position this case guards.
|
||||
await expect(viewport.locator("[data-file-tree-virtualized-list]")).not.toHaveAttribute("data-is-scrolling")
|
||||
const scrolled = await viewport.evaluate((element) => element.scrollTop)
|
||||
expect(scrolled).toBeGreaterThan(0)
|
||||
await root.evaluate((element) => void (element.dataset.e2eProbe = "original"))
|
||||
@@ -586,7 +589,7 @@ test("file tree expands Windows paths and scrolls long names in both directions"
|
||||
await expect(panel.getByText("contents:frontend/app.ts", { exact: true })).toBeVisible()
|
||||
})
|
||||
|
||||
test("rereads a file each time an artifact link opens it @quarantine", async ({ page }) => {
|
||||
test("rereads a file each time an artifact link opens it", async ({ page }) => {
|
||||
// Enough lines to scroll the code view, ending in the draft's name.
|
||||
const draft = (name: string) => [...Array.from({ length: 200 }, (_, index) => `item ${index + 1}`), name].join("\n")
|
||||
const file = { content: draft("first draft") }
|
||||
@@ -613,17 +616,27 @@ test("rereads a file each time an artifact link opens it @quarantine", async ({
|
||||
const link = page.getByRole("link", { name: "shopping.txt", exact: true })
|
||||
const panel = page.locator("#review-panel")
|
||||
const tab = panel.getByRole("tab", { name: "shopping.txt" })
|
||||
const code = panel.locator("[data-scrollable]", { has: page.locator('[data-component="file"]') })
|
||||
|
||||
// A long file mounts only the rows near the viewport, so its last line needs a scroll. A reopened tab may restore its
|
||||
// earlier scroll position, so this starts from wherever the view is once its rows overflow.
|
||||
const scrollToEnd = async () => {
|
||||
await expect.poll(() => code.evaluate((element) => element.scrollHeight - element.clientHeight)).toBeGreaterThan(0)
|
||||
await code.hover()
|
||||
await page.mouse.wheel(0, 100_000)
|
||||
await expect
|
||||
.poll(() => code.evaluate((element) => element.scrollHeight - element.clientHeight - element.scrollTop))
|
||||
.toBeLessThanOrEqual(1)
|
||||
}
|
||||
|
||||
await link.click()
|
||||
await expect(tab).toHaveAttribute("aria-selected", "true")
|
||||
// The first open starts at the top.
|
||||
await expect(panel.getByText("item 1", { exact: true })).toBeVisible()
|
||||
await scrollToEnd()
|
||||
await expect(panel.getByText("first draft", { exact: true })).toBeVisible()
|
||||
|
||||
// Rereading the open file updates it in place: the code view keeps its node and never jumps back to the top.
|
||||
const code = panel.locator("[data-scrollable]", { has: page.locator('[data-component="file"]') })
|
||||
await code.hover()
|
||||
await page.mouse.wheel(0, 100_000)
|
||||
await expect
|
||||
.poll(() => code.evaluate((element) => element.scrollHeight - element.clientHeight - element.scrollTop))
|
||||
.toBeLessThanOrEqual(1)
|
||||
const scrolled = await code.evaluate((element) => element.scrollTop)
|
||||
expect(scrolled).toBeGreaterThan(0)
|
||||
await code.evaluate((element) => void (element.dataset.e2eProbe = "original"))
|
||||
@@ -638,6 +651,7 @@ test("rereads a file each time an artifact link opens it @quarantine", async ({
|
||||
await expect(tab).toHaveCount(0)
|
||||
await link.click()
|
||||
await expect(tab).toHaveAttribute("aria-selected", "true")
|
||||
await scrollToEnd()
|
||||
await expect(panel.getByText("third draft", { exact: true })).toBeVisible()
|
||||
await expect(panel.getByText("second draft", { exact: true })).toHaveCount(0)
|
||||
|
||||
@@ -985,7 +999,7 @@ test("video files stream into the viewer behind a loading state, open into the p
|
||||
expect(await page.evaluate(() => document.fullscreenElement)).toBeNull()
|
||||
})
|
||||
|
||||
test("restores review state and the side-panel tab per session @quarantine", async ({ page }) => {
|
||||
test("restores review state and the side-panel tab per session", async ({ page }) => {
|
||||
const sessions = [
|
||||
{ id: "ses_review_state_a", title: "Alpha review state" },
|
||||
{ id: "ses_review_state_b", title: "Beta review state" },
|
||||
@@ -1082,6 +1096,8 @@ test("restores review state and the side-panel tab per session @quarantine", asy
|
||||
await toggle.click()
|
||||
await selectedTab("README.md")
|
||||
|
||||
// Opening moves focus into the side panel once its motion lands; from there Close Tab closes the side tab.
|
||||
await expect(panel).toBeFocused()
|
||||
await page.keyboard.press("Control+w")
|
||||
await expect(panel.getByRole("tab", { name: "README.md", exact: true })).toHaveCount(0)
|
||||
await expect(review).toHaveAttribute("aria-selected", "true")
|
||||
|
||||
@@ -851,7 +851,7 @@ for (const delivery of ["queue", "steer"] as const) {
|
||||
})
|
||||
}
|
||||
|
||||
test("reverting to another prompt replaces the file chips of an earlier restore @quarantine", async ({ page }) => {
|
||||
test("reverting to another prompt replaces the file chips of an earlier restore", async ({ page }) => {
|
||||
const mock = createQueueMock(
|
||||
[],
|
||||
[
|
||||
@@ -1012,7 +1012,7 @@ for (const [action, status] of [
|
||||
})
|
||||
}
|
||||
|
||||
test("waiting steers group under one Pending line, each keeping its own actions beside its bubble @quarantine", async ({
|
||||
test("waiting steers group under one Pending line, each keeping its own actions beside its bubble", async ({
|
||||
page,
|
||||
}) => {
|
||||
const mock = createQueueMock(
|
||||
@@ -1028,7 +1028,7 @@ test("waiting steers group under one Pending line, each keeping its own actions
|
||||
await expect(first.locator('[data-component="user-message"]')).toHaveAttribute("data-pending", "true")
|
||||
|
||||
// The run's last steer carries the one Pending line; the first folds its line away.
|
||||
await expect(last.locator('[data-slot="user-message-meta"]')).toContainText("Pending")
|
||||
await expect(last.locator('[data-slot="user-message-meta"]')).toContainText("Pending", { useInnerText: true })
|
||||
await expect(first.locator('[data-slot="user-message-meta"]')).toBeHidden()
|
||||
|
||||
await first.locator('[data-slot="user-message-text"]').hover()
|
||||
@@ -1084,7 +1084,7 @@ test("/undo returns a pending steer's review comment to the composer", async ({
|
||||
})
|
||||
|
||||
for (const delivery of ["steer", "queue"] as const) {
|
||||
test(`keeps finished tools above a pending ${delivery === "queue" ? "queue-to-steer" : "steer"} follow-up${delivery === "steer" ? " @quarantine" : ""}`, async ({
|
||||
test(`keeps finished tools above a pending ${delivery === "queue" ? "queue-to-steer" : "steer"} follow-up`, async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
const model = { id: "queue-model", providerID: "opencode" }
|
||||
@@ -1171,7 +1171,10 @@ for (const delivery of ["steer", "queue"] as const) {
|
||||
await expect(bubble).toHaveCSS("color", colors.pending.text)
|
||||
await expect(bubble).toHaveCSS("transition-duration", "0s")
|
||||
await expect(pending.locator('[data-slot="user-message-copy-wrapper"]')).toHaveCSS("opacity", "1")
|
||||
await expect(pending.locator('[data-slot="user-message-meta"]')).toHaveText(/^Pending\s*·\s*Queue Model$/)
|
||||
// Pending stands in for the time of a steer that has not been sent.
|
||||
await expect(pending.locator('[data-slot="user-message-meta"]')).toHaveText(/^Pending\s*·\s*Queue Model$/, {
|
||||
useInnerText: true,
|
||||
})
|
||||
await bubble.evaluate((element) => (element.dataset.deliveryMarker = "pending"))
|
||||
}
|
||||
|
||||
@@ -1253,7 +1256,9 @@ for (const delivery of ["steer", "queue"] as const) {
|
||||
|
||||
if (colors) {
|
||||
await expect(bubble).toHaveAttribute("data-delivery-marker", "pending")
|
||||
await expect(pending.locator('[data-slot="user-message-meta"]')).toHaveText("Queue Model")
|
||||
await expect(pending.locator('[data-slot="user-message-meta"]')).toHaveText(/^Queue Model\s*·\s*Just now$/, {
|
||||
useInnerText: true,
|
||||
})
|
||||
await expect(bubble).toHaveCSS("background-color", colors.delivered.background)
|
||||
await expect(bubble).toHaveCSS("color", colors.delivered.text)
|
||||
// Only delivery animates the colour; reduced motion switches instantly.
|
||||
|
||||
@@ -75,7 +75,7 @@ function lines(count: number) {
|
||||
}
|
||||
|
||||
for (const visible of [false, true]) {
|
||||
test(`${visible ? "shows" : "omits"} the agent name in message meta when agents are ${visible ? "on @quarantine" : "off"}`, async ({
|
||||
test(`${visible ? "shows" : "omits"} the agent name in message meta when agents are ${visible ? "on" : "off"}`, async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
await setupTimeline(page, {
|
||||
@@ -93,7 +93,8 @@ for (const visible of [false, true]) {
|
||||
const meta = [user.locator('[data-slot="user-message-meta"]'), assistant.locator('[data-slot="text-part-meta"]')]
|
||||
|
||||
for (const item of meta) {
|
||||
if (visible) await expect(item).toContainText(/^Build\s·\s/)
|
||||
// A delivered message keeps its hidden Pending label in the DOM, so read only the rendered text.
|
||||
if (visible) await expect(item).toContainText(/^Build\s*·/, { useInnerText: true })
|
||||
else await expect(item).not.toContainText("Build")
|
||||
}
|
||||
})
|
||||
|
||||
@@ -32,6 +32,7 @@ test("recently closed shows ten sessions and searches older closures in close or
|
||||
id: `ses_closed_${index}`,
|
||||
title: `Closed session ${index}`,
|
||||
}))
|
||||
|
||||
await mockWorkspace(page, {
|
||||
name: "ClosedTabs",
|
||||
sessions,
|
||||
@@ -86,6 +87,7 @@ test("recently closed fills remaining slots in Home order without open or duplic
|
||||
title: `Other session ${index}`,
|
||||
time: { created: 1700000000000, updated: 1700000000000 + (12 - index) * 1000 },
|
||||
}))
|
||||
|
||||
await mockWorkspace(page, {
|
||||
name: "OtherTabs",
|
||||
sessions: [
|
||||
@@ -858,9 +860,7 @@ test("inactive tabs stay busy while work waits in their inbox, and pulse on a ne
|
||||
await expect(tab(a.id).locator('[data-slot="tab-prompt-pulse"]')).toHaveCount(0)
|
||||
})
|
||||
|
||||
test("switching between busy sessions keeps the busy indicators and the activity capsule at rest @quarantine", async ({
|
||||
page,
|
||||
}) => {
|
||||
test("switching between busy sessions keeps the busy indicators and the activity capsule at rest", async ({ page }) => {
|
||||
const children = [
|
||||
{ id: "ses_tab_a_child", title: "Map the orchard", parentID: a.id },
|
||||
{ id: "ses_tab_b_child", title: "Chart the harbor", parentID: b.id },
|
||||
@@ -882,11 +882,12 @@ test("switching between busy sessions keeps the busy indicators and the activity
|
||||
await expect(capsule).toHaveText("1 subagent")
|
||||
await expect(capsule).toHaveCSS("opacity", "1")
|
||||
|
||||
// Record any capsule animation or any moment without a capsule, and mark the indicators to compare them later.
|
||||
// Record any capsule animation or any moment without a capsule, and mark the indicators to compare them later. The
|
||||
// capsule's spinner always runs its own phase-synced loop, so only an animation of the capsule itself counts.
|
||||
await page.evaluate(() => {
|
||||
const record = document.documentElement
|
||||
document.addEventListener("animationstart", (event) => {
|
||||
if (event.target instanceof Element && event.target.closest('[data-slot="session-activity-chip"]'))
|
||||
if (event.target instanceof Element && event.target.matches('[data-slot="session-activity-chip"]'))
|
||||
record.setAttribute("data-test-capsule-animated", "")
|
||||
})
|
||||
new MutationObserver(() => {
|
||||
|
||||
@@ -334,7 +334,7 @@ test("recovers from a failed cold history load when another session is selected"
|
||||
await expect(page.getByRole("heading", { name: "Something went wrong", exact: true })).toHaveCount(0)
|
||||
})
|
||||
|
||||
test("focuses Find in the selected cached timeline @quarantine", async ({ page }) => {
|
||||
test("focuses Find in the selected cached timeline", async ({ page }) => {
|
||||
await openTabs(page, { pageMessages: placeholderHistory })
|
||||
await page.goto(sessionHref(fixture.sourceID))
|
||||
await expect(page.getByText(`History for ${fixture.sourceID}`, { exact: true })).toBeVisible()
|
||||
@@ -355,7 +355,7 @@ test("focuses Find in the selected cached timeline @quarantine", async ({ page }
|
||||
await expect(search).toHaveCount(0)
|
||||
})
|
||||
|
||||
test("disposes the old workspace's shell while destination history is loading @quarantine", async ({ page }) => {
|
||||
test("disposes the old workspace's shell while destination history is loading", async ({ page }) => {
|
||||
const destination = "C:/OpenCode/OtherProject"
|
||||
const requested = Promise.withResolvers<void>()
|
||||
const release = Promise.withResolvers<void>()
|
||||
@@ -426,7 +426,7 @@ test("disposes the old workspace's shell while destination history is loading @q
|
||||
try {
|
||||
await tab(page, fixture.targetID).click()
|
||||
await requested.promise
|
||||
await expect(page.locator("[data-session-title]")).toHaveText(fixture.expected.targetTitle)
|
||||
await expect(page.locator("[data-session-title] h1")).toHaveText(fixture.expected.targetTitle)
|
||||
output.text += "Output after returning\n"
|
||||
await tab(page, fixture.sourceID).click()
|
||||
await expect(shell.locator('[data-slot="bash-result"]')).toContainText("Output after returning")
|
||||
@@ -759,9 +759,7 @@ async function sampleTabPaint(page: Page, sessionID: string) {
|
||||
return {
|
||||
async firstPaint() {
|
||||
await expect.poll(read).toBeDefined()
|
||||
await expect
|
||||
.poll(() => page.evaluate(() => window.__tabPaint!.settled))
|
||||
.toBe(true)
|
||||
await expect.poll(() => page.evaluate(() => window.__tabPaint!.settled)).toBe(true)
|
||||
|
||||
return (await read())!
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@ const completed = {
|
||||
} satisfies SessionMessageAssistant
|
||||
|
||||
test.describe("static projection", () => {
|
||||
test("renders current protocol notices in CLI order @quarantine", async ({ page }) => {
|
||||
test("renders current protocol notices in CLI order", async ({ page }) => {
|
||||
const ownerWarnings: string[] = []
|
||||
page.on("console", (message) => {
|
||||
if (message.text().includes("computations created outside a `createRoot` or `render`"))
|
||||
@@ -80,8 +80,13 @@ test.describe("static projection", () => {
|
||||
await expect(notices.nth(1)).toContainText("Explore finished · Search code")
|
||||
await expect(notices.nth(2)).toContainText("Continuing after restart")
|
||||
await expect(notices.nth(3)).toContainText("Skill · Review")
|
||||
await expect(notices).toHaveClass([/text-text-weak/, /text-text-weak/, /text-text-weak/, /text-text-weak/])
|
||||
await expect(notices.locator(".text-text-strong")).toHaveCount(0)
|
||||
await expect(notices).toHaveClass([
|
||||
/text-v2-text-text-faint/,
|
||||
/text-v2-text-text-faint/,
|
||||
/text-v2-text-text-faint/,
|
||||
/text-v2-text-text-faint/,
|
||||
])
|
||||
await expect(notices.locator(".text-v2-text-text-base")).toHaveCount(0)
|
||||
expect(ownerWarnings).toEqual([])
|
||||
})
|
||||
|
||||
@@ -612,7 +617,10 @@ test("shows a background subagent's outcome as its own row where it finished", a
|
||||
}),
|
||||
inboxDelivered({ sessionID, inboxID: "msg_outcome" }),
|
||||
stepStarted(after),
|
||||
...partUpdated({ ...toolPart("call_read_after", "read", "completed", { filePath: "AGENTS.md" }), messageID: after.id }),
|
||||
...partUpdated({
|
||||
...toolPart("call_read_after", "read", "completed", { filePath: "AGENTS.md" }),
|
||||
messageID: after.id,
|
||||
}),
|
||||
messageUpdated(completedAssistantInfo(after)),
|
||||
])
|
||||
|
||||
@@ -661,6 +669,7 @@ test("holds undelivered input still while live status above it comes and goes",
|
||||
const working = page.locator('[data-component="session-working"]')
|
||||
const activity = page.locator('[data-timeline-key="activity"]')
|
||||
const lane = async () => (await activity.boundingBox())?.height
|
||||
|
||||
const outcome = (id: string, description: string) =>
|
||||
inboxEnqueued({
|
||||
sessionID,
|
||||
@@ -677,6 +686,7 @@ test("holds undelivered input still while live status above it comes and goes",
|
||||
})
|
||||
|
||||
const first = page.locator('[data-slot="session-timeline-notice"]').filter({ hasText: "Audit constraints" })
|
||||
|
||||
const gap = async () => {
|
||||
const [above, below] = await Promise.all([answer.boundingBox(), first.boundingBox()])
|
||||
|
||||
@@ -797,14 +807,15 @@ test.describe("Working", () => {
|
||||
await page.clock.install({ time: 1700000001000 })
|
||||
await page.reload()
|
||||
await timeline.transport.waitForConnection()
|
||||
await page.clock.pauseAt(1700000001000 + 492_000)
|
||||
|
||||
const working = page.locator('[data-component="session-working"]')
|
||||
const group = page.locator('[data-component="collapsed-tool-group"]')
|
||||
const trigger = group.locator('[data-component="context-tool-group-trigger"]')
|
||||
const elapsed = trigger.locator('[data-slot="basic-tool-tool-subtitle"]')
|
||||
await expect(group).toHaveAttribute("data-timeline-part-ids", `${assistantID}:reasoning:0`)
|
||||
// The jump below fires the 60 s timeout of any request still in flight, so the busy status must land first.
|
||||
await expect(trigger).toHaveAttribute("aria-label", "Thinking")
|
||||
await page.clock.pauseAt(1700000001000 + 492_000)
|
||||
await expect(trigger.locator('[data-component="text-shimmer"]')).toHaveAttribute("data-active", "true")
|
||||
await expect(elapsed).toHaveText("8m 12s")
|
||||
await expect(working).toHaveCount(0)
|
||||
@@ -902,7 +913,9 @@ test.describe("Working", () => {
|
||||
await expect(working).toBeVisible()
|
||||
|
||||
await timeline.send(partUpdated(toolPart("prt_read_four", "read", "running", { path: "src/four.ts" })))
|
||||
await expect(group.locator('[data-slot="basic-tool-tool-subtitle"]')).toHaveText("one.ts, two.ts, three.ts, four.ts")
|
||||
await expect(group.locator('[data-slot="basic-tool-tool-subtitle"]')).toHaveText(
|
||||
"one.ts, two.ts, three.ts, four.ts",
|
||||
)
|
||||
await expect(working).toBeVisible()
|
||||
|
||||
await timeline.send(partUpdated(toolPart("prt_read_four", "read", "completed", { path: "src/four.ts" })))
|
||||
@@ -1137,6 +1150,7 @@ test.describe("background shortcut", () => {
|
||||
.poll(async () => {
|
||||
const panel = (await list.boundingBox())!
|
||||
const anchor = (await capsule.boundingBox())!
|
||||
|
||||
const end = await list
|
||||
.getByRole("menuitem")
|
||||
.locator('[data-slot="session-activity-elapsed"]')
|
||||
@@ -1188,6 +1202,7 @@ test.describe("background shortcut", () => {
|
||||
],
|
||||
sessions: [session(), session({ id: childID, parentID: sessionID, title: "Stale task", agent: "explore" })],
|
||||
})
|
||||
|
||||
const capsule = page.locator('[data-slot="session-activity-chip"]')
|
||||
|
||||
await expect(page.locator('[data-timeline-part-id="call_stale"]')).toContainText("Stale task (background)")
|
||||
@@ -1409,9 +1424,7 @@ test.describe("background shortcut", () => {
|
||||
// Reaching the shell lands on the end of the timeline, which would otherwise follow new content again.
|
||||
{ name: "at the end of the timeline", before: 40, searches: 0, after: 0 },
|
||||
]) {
|
||||
test(`holds a revealed shell ${fixture.name} just under its stuck group header${fixture.name === "from far below" ? " @quarantine" : ""}`, async ({
|
||||
page,
|
||||
}) => {
|
||||
test(`holds a revealed shell ${fixture.name} just under its stuck group header`, async ({ page }) => {
|
||||
const timeline = await setupTimeline(page, {
|
||||
settings: { timelineDetail: detailed },
|
||||
sessionStatus: { [sessionID]: { type: "busy" } },
|
||||
@@ -1634,9 +1647,7 @@ test.describe("compaction", () => {
|
||||
await expect(compaction).not.toContainText("Partial automatic summary.")
|
||||
await expect(compaction).not.toContainText("Session compaction started")
|
||||
|
||||
await timeline.send(
|
||||
compactionEnded({ sessionID, reason: "auto", text: "## Checkpoint\n\nAutomatic details." }),
|
||||
)
|
||||
await timeline.send(compactionEnded({ sessionID, reason: "auto", text: "## Checkpoint\n\nAutomatic details." }))
|
||||
await expect(divider).toHaveAttribute("data-state", "done")
|
||||
await expect(divider).toHaveAccessibleName("Compacted")
|
||||
await expect(compaction).not.toContainText("Automatic details.")
|
||||
|
||||
@@ -3,8 +3,11 @@ import type { Page } from "@playwright/test"
|
||||
export type PromptPosition = { frame: number; top: number | null }
|
||||
|
||||
// Paint user bubbles a test-only blue that the frame reader can tell from everything else, whatever the theme colour.
|
||||
// The bubble's colour transition would otherwise paint the next frames in a blend of grey and blue.
|
||||
export async function markPrompt(page: Page) {
|
||||
await page.addStyleTag({ content: '[data-slot="user-message-text"] { background: rgb(0 0 255) !important; }' })
|
||||
await page.addStyleTag({
|
||||
content: '[data-slot="user-message-text"] { background: rgb(0 0 255) !important; transition: none !important; }',
|
||||
})
|
||||
}
|
||||
|
||||
// Records painted compositor frames; the returned stop function reads the prompt position in each frame.
|
||||
|
||||
@@ -64,7 +64,7 @@ const COMPOSER_SUGGESTION_ROW_HEIGHT = 28
|
||||
|
||||
const COMPOSER_SUGGESTION_ROW_PEEK = 18
|
||||
|
||||
const COMPOSER_SUGGESTION_TOP_PADDING = 8
|
||||
const COMPOSER_SUGGESTION_TOP_PADDING = 6
|
||||
|
||||
const COMPOSER_SUGGESTION_SEARCH_HEIGHT = 28
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ export function createSessionBackground(input: {
|
||||
const descends = (sessionID: string) => {
|
||||
const seen = new Set<string>()
|
||||
let parentID = parents.get(sessionID)
|
||||
|
||||
while (parentID && !seen.has(parentID)) {
|
||||
if (parentID === id) return true
|
||||
seen.add(parentID)
|
||||
@@ -107,6 +108,7 @@ export function createSessionBackground(input: {
|
||||
|
||||
// A call names its child once the child exists; until the call reports it, the child's title is its description.
|
||||
const calls = current.blocking.flatMap((item) => (item.type === "subagent" ? [item] : []))
|
||||
|
||||
const child = (item: (typeof calls)[number], info: SessionInfo) =>
|
||||
item.id ? info.id === item.id : !!item.label && info.parentID === id && info.title === item.label
|
||||
|
||||
@@ -143,7 +145,8 @@ export function createSessionBackground(input: {
|
||||
],
|
||||
)
|
||||
|
||||
return [...pending, ...running]
|
||||
// Work that blocks the run comes before work already in the background.
|
||||
return [...pending, ...running.filter((task) => task.partID), ...running.filter((task) => !task.partID)]
|
||||
})
|
||||
|
||||
// Background work: running subagents whose call no longer blocks the run, and the session's live shells outside
|
||||
|
||||
@@ -81,9 +81,8 @@ export function SessionHeaderLayout(
|
||||
</span>
|
||||
{props.children}
|
||||
</div>
|
||||
<Show when={props.actions}>
|
||||
<div class="session-header-actions">{props.actions}</div>
|
||||
</Show>
|
||||
{/* Each read of a JSX prop renders it again, so the actions render once, from the condition's value. */}
|
||||
<Show when={props.actions}>{(actions) => <div class="session-header-actions">{actions()}</div>}</Show>
|
||||
</div>
|
||||
</SessionHeaderCollapse.Provider>
|
||||
)
|
||||
|
||||
@@ -262,8 +262,9 @@ function SessionSurfaceState(props: SessionPreviewProps & { onReset: () => void
|
||||
showComposer: () => true,
|
||||
} satisfies SessionComposerRegionViewController
|
||||
|
||||
// Contain the composer region's z-index as the app's session chat panel does, so portaled menus open above it.
|
||||
return (
|
||||
<div class="mx-auto h-screen min-h-[640px] w-full max-w-[1440px]">
|
||||
<div class="mx-auto h-screen min-h-[640px] w-full max-w-[1440px] isolate">
|
||||
<SessionRouteFrame padded>
|
||||
<SessionPanelFrame raised>
|
||||
<main class="flex min-h-0 flex-1 flex-col">
|
||||
|
||||
@@ -501,7 +501,9 @@ export function createTimelineVirtualizer(input: Input) {
|
||||
),
|
||||
)
|
||||
|
||||
if (Math.abs(offset - root.scrollTop) > 1) virtualizer.scrollToOffset(offset)
|
||||
// Hand over every pin, even one the scroll already reaches: TanStack lands exactly on its last target once the
|
||||
// scroll is within a pixel of it, which would undo a compensation for a row above that resized since.
|
||||
virtualizer.scrollToOffset(offset)
|
||||
}
|
||||
|
||||
function releaseAnchor() {
|
||||
|
||||
@@ -448,7 +448,6 @@
|
||||
padding: 8px 12px;
|
||||
color: var(--v2-text-text-faint);
|
||||
font-weight: 500;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
td {
|
||||
|
||||
@@ -339,12 +339,13 @@
|
||||
visibility: hidden;
|
||||
margin-inline-end: calc(-1 * var(--user-message-transition-gap));
|
||||
|
||||
/* Labels and actions slide in as they arrive and leave at once, like the Pending label on delivery. */
|
||||
/* Labels and actions slide in as they arrive and leave at once, like the Pending label on delivery. Active ones
|
||||
inherit visibility, so a folded message's hidden footer also hides them. */
|
||||
&[data-active="true"] {
|
||||
grid-template-columns: 1fr;
|
||||
margin-inline-end: 0;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
visibility: inherit;
|
||||
transition:
|
||||
grid-template-columns 200ms ease-out,
|
||||
margin-inline-end 200ms ease-out,
|
||||
@@ -407,8 +408,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
&[data-run-meta-hidden] [data-slot="user-message-copy-wrapper"],
|
||||
&[data-run-meta-hidden] [data-slot="user-message-meta-tail"] {
|
||||
&[data-run-meta-hidden] [data-slot="user-message-copy-wrapper"] {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user