Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9a719ca
feat(agent): stage assets separately from inline prompt references
ryan-di Oct 5, 2026
0c44361
refactor(agent): separate composer menu presentation
ryan-di Oct 5, 2026
b32e959
refactor: simplify mention navigation and submission test cases
ryan-di Oct 5, 2026
358daca
test(agent): align attachment regressions with tray interactions
ryan-di Oct 5, 2026
f8410e4
fix(agent): redraw canvas after removing an inline node reference
ryan-di Oct 5, 2026
d890ae8
chore(agent): remove unrelated dead-code baseline additions
ryan-di Oct 5, 2026
f596139
refactor(agent): derive node mentions from the viewed graph
ryan-di Oct 5, 2026
b05895e
[automated] Apply ESLint and Oxfmt fixes
actions-user Oct 5, 2026
5df0338
feat(agent): share video posters and add media hover playback
ryan-di Oct 5, 2026
61ae254
refactor: isolate local asset preview creation from uploads
ryan-di Oct 5, 2026
55f3713
test(agent): include playable media URL in list drag payload
ryan-di Oct 5, 2026
ad7455d
test(agent): simplify media preview regression fixtures
ryan-di Oct 5, 2026
e27178b
fix(agent): release invalidated submission assets
ryan-di Oct 5, 2026
c0c4336
Merge updated composer asset tray core into media previews
ryan-di Oct 5, 2026
c986991
fix(agent): address asset media review feedback
ryan-di Oct 5, 2026
6181b6d
merge: resolve asset tray conflicts with latest main
ryan-di Oct 7, 2026
7eaa868
merge: synchronize media previews with conflict-resolved asset tray
ryan-di Oct 7, 2026
767114f
fix(agent): make tray assets accessible without hover
ryan-di Oct 7, 2026
359d00c
Merge core tray accessibility fixes into media previews
ryan-di Oct 7, 2026
b5900b3
test(agent): cover media playback and constrained tray layout
ryan-di Oct 7, 2026
7267ef2
test: boot app before asset tray touch regression
ryan-di Oct 7, 2026
1284eb8
Merge branch 'codex/agent-asset-tray-upgrade' into codex/agent-asset-…
ryan-di Oct 7, 2026
21405c5
test: locate decorative media posters in composer regression
ryan-di Oct 7, 2026
ec5369d
fix: stop asset playback when preview closes
ryan-di Oct 7, 2026
bd77fdf
feat(agent): add shared media thumbnails and hover playback (#20157)
ryan-di Oct 7, 2026
6f41ff9
fix: deduplicate repeated composer asset drops
ryan-di Oct 8, 2026
2b7f693
Merge branch 'codex/agent-asset-tray-upgrade' into codex/agent-asset-…
ryan-di Oct 8, 2026
75be3b9
merge: reconcile asset fixes with merged media PR
ryan-di Oct 8, 2026
6f09f4c
feat(agent): notify when duplicate attachments are skipped
ryan-di Oct 8, 2026
3bb707d
fix(agent): keep one asset tray preview open
ryan-di Oct 8, 2026
1910d5c
test(agent): reuse shared tray test timers
ryan-di Oct 8, 2026
fb4a565
merge: reconcile asset tray with latest main
ryan-di Oct 8, 2026
6a657b1
test(agent): cover exclusive previews and duplicate notices
ryan-di Oct 8, 2026
8efd53e
refactor(agent): clarify preview and deferred upload transitions
ryan-di Oct 8, 2026
ee7adf0
merge: sync latest main before asset tray delivery
ryan-di Oct 8, 2026
099485d
test: align agent recordings with horizontal asset tray
ryan-di Oct 8, 2026
c8bf432
test(agent): reopen node mentions through fresh input
ryan-di Oct 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added browser_tests/assets/silence.wav
Binary file not shown.
62 changes: 60 additions & 2 deletions browser_tests/fixtures/components/AgentPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class AgentPanel {
public readonly workflowPicker: Locator
public readonly fileInput: Locator
public readonly composerAssetSection: Locator
public readonly scrollAssetsRight: Locator
public readonly attachmentChips: Locator
public readonly composer: Locator
public readonly composerPromptArea: Locator
Expand Down Expand Up @@ -64,6 +65,9 @@ export class AgentPanel {
})
this.fileInput = this.root.getByTestId('agent-file-input')
this.composerAssetSection = this.root.getByTestId('composer-asset-section')
this.scrollAssetsRight = this.root.getByRole('button', {
name: enMessages.g.scrollRight
})
this.attachmentChips = this.root.getByTestId('agent-attachment-chip')
this.composer = this.root.getByRole('textbox', { name: /^Describe ideas/ })
this.composerPromptArea = this.root.getByTestId('composer-inline-input')
Expand All @@ -86,13 +90,67 @@ export class AgentPanel {
.getByRole('listitem')
}

async scrollAssetsToEnd(): Promise<void> {
const count = await this.attachmentChips.count()
for (
let step = 0;
step < count && (await this.scrollAssetsRight.isEnabled());
step++
) {
const target = await this.composerAssetSection.evaluate((element) =>
Math.min(
element.scrollWidth - element.clientWidth,
element.scrollLeft + element.clientWidth
)
)
await this.scrollAssetsRight.click()
await expect
.poll(() =>
this.composerAssetSection.evaluate((element) => element.scrollLeft)
)
.toBeCloseTo(target, 0)
}
await expect(this.scrollAssetsRight).toBeDisabled()
}

activityRow(label: string): Locator {
return this.activityRows.getByText(label, { exact: true })
}

assetPreview(name: string): Locator {
return this.page.getByRole('dialog', { name, exact: true })
}

previewAssetButton(name: string): Locator {
return this.attachmentChip(name).getByRole('button', {
name: enMessages.agent.previewAsset.replace('{name}', name),
exact: true
})
}

async expectAttachmentFullyVisible(name: string): Promise<void> {
const tray = this.root.getByRole('region', {
name: enMessages.assetBrowser.assets,
exact: true
})
await expect
.poll(async () => {
const [card, viewport] = await Promise.all([
this.attachmentChip(name).boundingBox(),
tray.boundingBox()
])
return (
!!card &&
!!viewport &&
card.y >= viewport.y &&
card.y + card.height <= viewport.y + viewport.height
)
})
.toBe(true)
}

/**
* The composer attachment carrying `name`. Matches on the chip's own
* attribute rather than its text, which truncates at `max-w-32`.
* The composer attachment carrying `name`.
*
* `name` is a filename and may legitimately contain a quote or backslash, so
* it is escaped for the double-quoted CSS string rather than interpolated
Expand Down
11 changes: 11 additions & 0 deletions browser_tests/fixtures/data/assetFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ export const AGENT_VIDEO_ASSET: Asset = createOutputAsset({
last_access_time: '2026-09-18T00:00:00.000Z'
})

export const AGENT_AUDIO_ASSET: Asset = createOutputAsset({
id: '33333333-3333-4333-a333-333333333333',
hash: 'blake3:3333333333333333333333333333333333333333333333333333333333333333',
name: 'agent_generated_audio.wav',
mime_type: 'audio/wav',
size: 24_044,
created_at: '2026-09-18T00:00:00.000Z',
updated_at: '2026-09-18T00:00:00.000Z',
last_access_time: '2026-09-18T00:00:00.000Z'
})

export const STALE_TEMP_FILENAME = 'ComfyUI_temp_thsmm_00001_.png'
export const STALE_TEMP_CARD_TEXT = STALE_TEMP_FILENAME.replace(/\.[^.]+$/, '')
export const STALE_TEMP_ASSET: Asset = createOutputAsset({
Expand Down
26 changes: 24 additions & 2 deletions browser_tests/fixtures/helpers/DragDropHelper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from 'fs'
import { readFileSync, statSync } from 'fs'
import { basename } from 'path'

import type { Page } from '@playwright/test'
import type { Locator, Page } from '@playwright/test'

import type { Position } from '@e2e/fixtures/types'
import { getMimeType } from '@e2e/fixtures/utils/mimeTypeUtil'
Expand All @@ -11,6 +11,28 @@ import { nextFrame } from '@e2e/fixtures/utils/timing'
export class DragDropHelper {
constructor(private readonly page: Page) {}

async dropFilesOn(target: Locator, filePaths: string[]): Promise<void> {
const files = filePaths.map((filePath) => ({
bytes: Array.from(readFileSync(filePath)),
name: basename(filePath),
type: getMimeType(basename(filePath)),
lastModified: statSync(filePath).mtimeMs
}))
const transfer = await this.page.evaluateHandle((files) => {
const transfer = new DataTransfer()
for (const { bytes, name, type, lastModified } of files)
transfer.items.add(
new File([new Uint8Array(bytes)], name, { type, lastModified })
)
return transfer
}, files)
try {
await target.dispatchEvent('drop', { dataTransfer: transfer })
} finally {
await transfer.dispose()
}
}

async dragAndDropExternalResource(
options: {
fileName?: string
Expand Down
107 changes: 107 additions & 0 deletions browser_tests/tests/agent/agentAssetPreviewPlayback.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import assert from 'node:assert/strict'

import { expect } from '@playwright/test'

import {
agentTest as test,
bootAgentApp
} from '@e2e/fixtures/agentPanelFixture'
import { AgentPanel } from '@e2e/fixtures/components/AgentPanel'
import { AssetsSidebarTab } from '@e2e/fixtures/components/SidebarTab'
import {
AGENT_AUDIO_ASSET,
AGENT_VIDEO_ASSET
} from '@e2e/fixtures/data/assetFixtures'
import { assetPath } from '@e2e/fixtures/utils/paths'

test.describe('Asset preview playback', { tag: '@cloud' }, () => {
for (const { kind, asset, file, contentType } of [
{
kind: 'video',
asset: AGENT_VIDEO_ASSET,
file: 'plain_video.mp4',
contentType: 'video/mp4'
},
{
kind: 'audio',
asset: AGENT_AUDIO_ASSET,
file: 'silence.wav',
contentType: 'audio/wav'
}
] as const) {
test(`stops ${kind} at close and reopens paused during the exit animation`, async ({
page,
agentFlagEnabled
}) => {
await page.route(`**/api/assets/${asset.id}/content**`, (route) =>
route.fulfill({ path: assetPath(file), contentType })
)
await bootAgentApp(page, agentFlagEnabled, {
assets: { assets: [asset], total: 1, has_more: false }
})
const panel = new AgentPanel(page)
await panel.open()
const assets = new AssetsSidebarTab(page)
await assets.open()
await assets.assetCards.first().dragTo(panel.root)
await panel.composer.fill('Keep this draft')
const trigger = panel.previewAssetButton(asset.name)
await trigger.press('Enter')
const player = panel.assetPreview(asset.name).locator(kind)
await expect(player).toBeFocused()
await expect
.poll(() =>
player.evaluate((media: HTMLMediaElement) => media.readyState)
)
.toBeGreaterThanOrEqual(2)
await player.press('Space')
await expect
.poll(() => player.evaluate((media: HTMLMediaElement) => media.paused))
.toBe(false)
const playingElement = await player.elementHandle()
assert(playingElement)
try {
await page.keyboard.press('Escape')
expect(
await playingElement.evaluate(
(media) => media instanceof HTMLMediaElement && media.paused
)
).toBe(true)
await page.keyboard.press('Enter')
await expect(trigger).toHaveAttribute('aria-expanded', 'true')
await expect(player).toBeFocused()
await expect
.poll(() =>
player.evaluate(
(media: HTMLMediaElement) =>
media.paused && media.currentTime === 0
)
)
.toBe(true)
await player.press('Space')
await expect
.poll(() =>
player.evaluate((media: HTMLMediaElement) => media.paused)
)
.toBe(false)
const reopenedElement = await player.elementHandle()
assert(reopenedElement)
try {
await panel.composer.click()
expect(
await reopenedElement.evaluate(
(media) => media instanceof HTMLMediaElement && media.paused
)
).toBe(true)
} finally {
await reopenedElement.dispose()
}
await expect(trigger).toHaveAttribute('aria-expanded', 'false')
await expect(panel.composer).toBeFocused()
await expect(panel.composer).toContainText('Keep this draft')
} finally {
await playingElement.dispose()
}
})
}
})
140 changes: 140 additions & 0 deletions browser_tests/tests/agent/agentAssetPreviewSwitching.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import assert from 'node:assert/strict'

import { expect } from '@playwright/test'

import {
agentTest as test,
bootAgentApp
} from '@e2e/fixtures/agentPanelFixture'
import { AgentPanel } from '@e2e/fixtures/components/AgentPanel'
import { AssetsSidebarTab } from '@e2e/fixtures/components/SidebarTab'
import {
AGENT_AUDIO_ASSET,
AGENT_VIDEO_ASSET
} from '@e2e/fixtures/data/assetFixtures'
import { assetPath } from '@e2e/fixtures/utils/paths'

test.describe('Single asset tray preview', { tag: '@cloud' }, () => {
test.beforeEach(async ({ page, agentFlagEnabled }) => {
await page.route(
`**/api/assets/${AGENT_AUDIO_ASSET.id}/content**`,
(route) =>
route.fulfill({
path: assetPath('silence.wav'),
contentType: 'audio/wav'
})
)
await page.route(
`**/api/assets/${AGENT_VIDEO_ASSET.id}/content**`,
(route) =>
route.fulfill({
path: assetPath('plain_video.mp4'),
contentType: 'video/mp4'
})
)
await bootAgentApp(page, agentFlagEnabled, {
assets: {
assets: [AGENT_AUDIO_ASSET, AGENT_VIDEO_ASSET],
total: 2,
has_more: false
}
})
const panel = new AgentPanel(page)
await panel.open()
const assets = new AssetsSidebarTab(page)
await assets.open()
await assets.waitForAssets(2)
await assets.getAssetCardByName('agent_generated_audio').dragTo(panel.root)
await expect(panel.attachmentChip(AGENT_AUDIO_ASSET.name)).toBeVisible()
await assets.getAssetCardByName('agent_generated_video').dragTo(panel.root)
await expect(panel.attachmentChips).toHaveCount(2)
await panel.composer.fill('Keep this draft')
})

test('replaces a clicked preview on hover and preserves keyboard switching and dismissal', async ({
page
}) => {
const panel = new AgentPanel(page)
const audio = panel.previewAssetButton(AGENT_AUDIO_ASSET.name)
const video = panel.previewAssetButton(AGENT_VIDEO_ASSET.name)
await audio.click()
await expect(panel.assetPreview(AGENT_AUDIO_ASSET.name)).toBeVisible()
await video.hover()
await expect(panel.assetPreview(AGENT_VIDEO_ASSET.name)).toBeVisible()
await expect(panel.assetPreview(AGENT_AUDIO_ASSET.name)).toHaveCount(0)
await expect(audio).toHaveAttribute('aria-expanded', 'false')
await panel.composer.hover()
await expect(panel.assetPreview(AGENT_VIDEO_ASSET.name)).toHaveCount(0)

await audio.press('Enter')
await expect(
panel.assetPreview(AGENT_AUDIO_ASSET.name).locator('audio')
).toBeFocused()
await video.press('Space')
await expect(
panel.assetPreview(AGENT_VIDEO_ASSET.name).locator('video')
).toBeFocused()
await expect(panel.assetPreview(AGENT_AUDIO_ASSET.name)).toHaveCount(0)
await page.keyboard.press('Escape')
await expect(panel.assetPreview(AGENT_VIDEO_ASSET.name)).toHaveCount(0)
await expect(video).toBeFocused()
await expect(panel.composer).toContainText('Keep this draft')
})

for (const { kind, asset, nextAsset } of [
{ kind: 'audio', asset: AGENT_AUDIO_ASSET, nextAsset: AGENT_VIDEO_ASSET },
{ kind: 'video', asset: AGENT_VIDEO_ASSET, nextAsset: AGENT_AUDIO_ASSET }
] as const) {
test(`stops native ${kind} playback when hover replaces it and reopens paused`, async ({
page
}) => {
const panel = new AgentPanel(page)
const trigger = panel.previewAssetButton(asset.name)
await trigger.click()
const player = panel.assetPreview(asset.name).locator(kind)
await expect(player).toBeFocused()
await expect
.poll(() =>
player.evaluate((media: HTMLMediaElement) => media.readyState)
)
.toBeGreaterThanOrEqual(2)
await player.press('Space')
await expect
.poll(() => player.evaluate((media: HTMLMediaElement) => media.paused))
.toBe(false)
const playing = await player.elementHandle()
assert(playing)
try {
await panel.previewAssetButton(nextAsset.name).hover()
await expect(panel.assetPreview(nextAsset.name)).toBeVisible()
await expect
.poll(() =>
playing.evaluate(
(media) =>
media instanceof HTMLMediaElement &&
media.paused &&
media.currentTime === 0
)
)
.toBe(true)
await expect(panel.assetPreview(asset.name)).toHaveCount(0)
await trigger.press('Enter')
await expect(player).toBeFocused()
await expect
.poll(() =>
player.evaluate(
(media: HTMLMediaElement) =>
media.paused && media.currentTime === 0
)
)
.toBe(true)
await expect(panel.assetPreview(nextAsset.name)).toHaveCount(0)
await page.keyboard.press('Escape')
await expect(trigger).toBeFocused()
await expect(panel.assetPreview(asset.name)).toHaveCount(0)
} finally {
await playing.dispose()
}
})
}
})
Loading
Loading