Files
deepseek-harness/apps/web/tests/deepseek-messages-chat.e2e.ts
T
Feiyu XiaandZrs000 5f01833f80 fix(client): align floating panels with the visual viewport (#6666)
* fix(ui-primitives): keep tall menus inside the mobile viewport

* fix(client): anchor model picker with Floating UI

Use Floating UI for fixed model-menu placement and automatic viewport updates. Preserve top-end alignment and defer automatic focus until placement is ready. Guard asynchronous results across updates and menu teardown.

* fix(client): preserve menu blur under pinned group titles

Keep the current provider title outside the native scroll viewport so
model rows cannot bleed through during fast scrolling. Preserve the
enclosing menu fill and backdrop filter, and update both model pickers,
lifecycle tests and ARIA goldens.

Validation: doc-sync, full build, final type checks, focused lint and
all 12 model-picker browser checks pass. The full unit run has 42,597
passing tests and four failures in unchanged gateway, third-party-
notices and Inspector tests. The Inspector case passes in isolation.

* fix(client): stabilize floating panels during browser zoom

* fix(client): keep portal menus aligned during Safari zoom

* fix(client): commit floating menu positions before paint

* fix(client): unify floating panel positioning

* fix(client): validate grouped menu headings

* fix(client): hide inactive pinned menu headings

* test(client): await floating menu layout across consumers

* test(ui-chat): await folded reply menu positioning

* test(client): align current consumers with asynchronous panel layout

* fix(client): prevent mobile model search focus zoom

* refactor(client): inject mobile device state from layout

* fix(client): keep anchored panel layout synchronous

* fix(client): address panel review coverage and documentation

* fix(client): keep viewport changes focused on iOS zoom

* fix(client): cover anchored panel lifecycle and scrollbar colors

* fix(client): preserve zoomed model menu scrolling and alignment

* fix(client): hide empty model menus and stabilize viewport pan tests

* test(web): use native wheel input for zoomed viewport panning

* fix(client): keep automation pickers scrollable when zoomed

* fix(client): allow horizontal gestures across clock columns

* fix(client): ellipsize overflowing floating-panel labels

* test(web): make clock overflow fixture independent of system fonts

---------

Co-authored-by: Zrs000 <[email protected]>
2026-10-30 11:33:46 +08:00

76 lines
3.6 KiB
TypeScript

/** Historical Messages provider replay preserves its recorded identity and DeepSeek model group. */
import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import { join } from 'node:path'
import { chromium, type Browser, type Page } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import {
assertFixtureInventory, captureStableAria, compareOrRefreshGolden, fixtureUserPrompts,
launchWebScaffold, selectedSessionFixture, watchConsole, webSnapshotMode, type WebScaffold,
} from './scaffold.ts'
import { connectFreshWorkspaceZh, saveFailureShot, ZH_BROWSER_LOCALE } from './support.ts'
const SNAPSHOT_DIR = fileURLToPath(new URL('../../../snapshots/web/deepseek-messages-chat', import.meta.url))
const FIXTURE = join(SNAPSHOT_DIR, 'session.v3.jsonl')
const MODE = webSnapshotMode()
describe.skipIf(MODE === 'record')('web e2e: DeepSeek Messages conversation', () => {
let scaffold: WebScaffold
let browser: Browser
let page: Page
let tripwire: ReturnType<typeof watchConsole>
let replayFixture: string
beforeAll(async () => {
replayFixture = await selectedSessionFixture(FIXTURE, false)
scaffold = await launchWebScaffold({
replayFixture,
paceMs: 5,
replayProviders: [{
id: 'deepseek-messages', name: 'DeepSeek',
models: [{
id: 'deepseek-v4-flash', name: 'DeepSeek-V4-Flash',
contextWindow: 1_000_000, defaultMaxTokens: 256_000,
reasoningEfforts: ['off', 'low', 'high', 'max'], defaultReasoningEffort: 'high',
}],
}],
})
await scaffold.ctx.agentDefaultModel.saveSelection({ provider: 'deepseek-messages', model: 'deepseek-v4-flash' })
browser = await chromium.launch()
page = await browser.newPage({ viewport: { width: 1680, height: 1000 }, locale: ZH_BROWSER_LOCALE })
tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await connectFreshWorkspaceZh(page, scaffold.workspaceCwd)
}, 120_000)
afterAll(async () => {
try { await browser?.close() } finally { await scaffold?.close() }
})
it('replays the historical Messages provider while displaying DeepSeek in the model selector', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-deepseek-messages-chat'))
const prompts = fixtureUserPrompts(await readFile(replayFixture, 'utf8'))
expect(prompts).toHaveLength(1)
expect(scaffold.ctx.agentDefaultModel.currentSelection()).toEqual({ provider: 'deepseek-messages', model: 'deepseek-v4-flash' })
await page.getByRole('button', { name: /^选择模型/ }).click()
await page.getByRole('menuitem', { name: /模型/ }).click()
await page.getByRole('group', { name: 'DeepSeek', exact: true }).waitFor()
await page.getByRole('button', { name: /^选择模型/ }).click()
const input = page.locator('[data-composer-input]').first()
const settled = scaffold.whenTurnSettled()
await input.fill(prompts[0]!)
await input.press('Enter')
const sessionId = await settled
const session = scaffold.ctx.sessions.get(sessionId)!
expect(session.requestHeader()?.config.provider).toBe('deepseek-messages')
await page.getByText('MESSAGES_WEB_READY', { exact: true }).waitFor()
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'ui.expected.md'),
await captureStableAria(page, '[class*="centerCol"]', scaffold.workspaceCwd), MODE)
expect(tripwire.pageErrors).toEqual([])
})
it('keeps the recorded-session inventory closed', async () => {
await assertFixtureInventory(SNAPSHOT_DIR, ['session.v3.jsonl', 'ui.expected.md'])
})
})