fix(desktop): make overlays responsive

This commit is contained in:
2026-07-26 00:16:58 +08:00
parent 139e0d59ed
commit 93b671c746
2 changed files with 11 additions and 1 deletions

View File

@@ -54,6 +54,8 @@ const home = await page.evaluate(() => ({
completed: document.querySelectorAll('.task-row.done').length,
}))
await page.locator('.task-row').first().click()
await page.waitForSelector('.arco-modal')
const taskModalWidth = (await page.locator('.arco-modal').boundingBox())?.width ?? 0
const taskModal = await page.getByText('编辑任务').count()
await page.getByRole('button', { name: '取消' }).click()
await page.getByRole('button', { name: '探索' }).click()
@@ -102,11 +104,12 @@ if (home.navCount !== 0) failures.push(`all-projects view must hide the right ra
if (home.statCount !== 4) failures.push(`expected four summary cards, got ${home.statCount}`)
if (home.pending !== 1 || home.completed !== 0) failures.push(`all-project task sections incorrect: ${JSON.stringify(home)}`)
if (taskModal !== 1) failures.push('task editor did not open')
if (taskModalWidth > 396) failures.push(`task modal must fit the 420px window, got ${taskModalWidth}px`)
if (exploreSources !== 2 || exploreDetail !== 1) failures.push(`explore reader did not render: ${JSON.stringify({ exploreSources, exploreDetail })}`)
if (documents !== 1) failures.push(`expected one document, got ${documents}`)
if (documentActions !== 2 || markdownEditor !== 1 || markdownEditing !== 1) failures.push(`document actions did not render: ${JSON.stringify({ documentActions, markdownEditor, markdownEditing })}`)
if (experts !== 1 || aiSwitches !== 2 || aiHistory !== 1) failures.push(`AI session pages did not render: ${JSON.stringify({ experts, aiSwitches, aiHistory })}`)
if (profileMenu !== 1) failures.push('profile menu did not open')
if (errors.length) failures.push(`console errors: ${errors.join('; ')}`)
console.log(JSON.stringify({ home, documents, documentActions, markdownEditor, markdownEditing, markdownLayout, experts, aiSwitches, aiHistory, taskModal, exploreSources, exploreDetail, profileMenu, errors }, null, 2))
console.log(JSON.stringify({ home, documents, documentActions, markdownEditor, markdownEditing, markdownLayout, experts, aiSwitches, aiHistory, taskModal, taskModalWidth, exploreSources, exploreDetail, profileMenu, errors }, null, 2))
if (failures.length) throw new Error(failures.join('\n'))