🐛 fix: 防止下载检测按钮和状态标签纵向换行

* 保持单文件检测按钮和状态标签单行,避免窄列挤成竖排
* 补充浏览器按钮高度与标签换行断言,关闭移动菜单后检查布局
This commit is contained in:
orion committed 2026-09-19 01:44:56 +08:00
commit a0907fd240
3 files changed
+8 -3

No files matched your search

@@ -1,5 +1,5 @@
<template> <template>
<div class="space-y-1" role="status"> <div class="shrink-0 whitespace-nowrap space-y-1" role="status">
<span class="inline-flex items-center rounded-full px-2 py-1 text-xs font-medium" :class="badgeClass"> <span class="inline-flex items-center rounded-full px-2 py-1 text-xs font-medium" :class="badgeClass">
<RefreshCw v-if="result.status === 'checking'" class="mr-1 h-3 w-3 animate-spin" /> <RefreshCw v-if="result.status === 'checking'" class="mr-1 h-3 w-3 animate-spin" />
{{ labels[result.status] }} {{ labels[result.status] }}
+2 -2
View File
@@ -385,7 +385,7 @@
</div> </div>
<div class="mt-2 flex items-center justify-between gap-2"> <div class="mt-2 flex items-center justify-between gap-2">
<DownloadCheckStatus :result="downloadStatusFor(file.id)" :dark="isDarkMode" /> <DownloadCheckStatus :result="downloadStatusFor(file.id)" :dark="isDarkMode" />
<BaseButton variant="outline" size="sm" :disabled="checkingDownloads" @click="checkDownloadIds([file.id])">检测可下载状态</BaseButton> <BaseButton variant="outline" size="sm" class="shrink-0 whitespace-nowrap" :disabled="checkingDownloads" @click="checkDownloadIds([file.id])">检测可下载状态</BaseButton>
</div> </div>
<div class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1 text-xs" :class="[mutedTextClass]"> <div class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1 text-xs" :class="[mutedTextClass]">
<span>{{ file.code }} · {{ file.displaySize }}</span> <span>{{ file.code }} · {{ file.displaySize }}</span>
@@ -722,7 +722,7 @@
<td class="px-6 py-4" :class="primaryTextClass"> <td class="px-6 py-4" :class="primaryTextClass">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<DownloadCheckStatus :result="downloadStatusFor(file.id)" :dark="isDarkMode" /> <DownloadCheckStatus :result="downloadStatusFor(file.id)" :dark="isDarkMode" />
<BaseButton variant="outline" size="sm" :disabled="checkingDownloads" @click="checkDownloadIds([file.id])">检测可下载状态</BaseButton> <BaseButton variant="outline" size="sm" class="shrink-0 whitespace-nowrap" :disabled="checkingDownloads" @click="checkDownloadIds([file.id])">检测可下载状态</BaseButton>
</div> </div>
</td> </td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
+5
View File
@@ -40,6 +40,9 @@ const site = process.env.FCB_TEST_URL || 'https://filetest.orionc.me'
await expect(rows).toHaveCount(10) await expect(rows).toHaveCount(10)
await expect(page.getByLabel('自动检测当前页')).toHaveValue('0') await expect(page.getByLabel('自动检测当前页')).toHaveValue('0')
assert.equal(calls.length, 0) assert.equal(calls.length, 0)
const singleButton = rows.first().getByRole('button', { name: '检测可下载状态', exact: true })
assert.ok((await singleButton.boundingBox()).height < 60, 'Single-file check button must stay on one line')
assert.equal(await rows.first().getByRole('status').evaluate(el => getComputedStyle(el).whiteSpace), 'nowrap')
await table.getByRole('button', { name: '刷新列表', exact: true }).click();await expect(rows).toHaveCount(10) await table.getByRole('button', { name: '刷新列表', exact: true }).click();await expect(rows).toHaveCount(10)
await table.getByRole('button', { name: '下一页', exact: true }).click();await expect(rows.first()).toContainText('TEST1011') await table.getByRole('button', { name: '下一页', exact: true }).click();await expect(rows.first()).toContainText('TEST1011')
await page.clock.install();await page.clock.fastForward(3600000);await page.clock.resume();assert.equal(calls.length, 0) await page.clock.install();await page.clock.fastForward(3600000);await page.clock.resume();assert.equal(calls.length, 0)
@@ -57,6 +60,8 @@ const site = process.env.FCB_TEST_URL || 'https://filetest.orionc.me'
await expect.poll(() => active).toBe(0);assert.equal(calls.length, 1) await expect.poll(() => active).toBe(0);assert.equal(calls.length, 1)
await page.setViewportSize({ width: 390, height: 844 });await expect(page.getByTitle('检测全部文件,包括未显示的分页')).toBeVisible() await page.setViewportSize({ width: 390, height: 844 });await expect(page.getByTitle('检测全部文件,包括未显示的分页')).toBeVisible()
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1)) assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1))
const closeMenu = page.getByRole('button', { name: '关闭菜单', exact: true })
if (await closeMenu.first().isVisible()) await closeMenu.first().click()
await page.screenshot({ path: '/tmp/fcb-manual-check-mobile.png' }) await page.screenshot({ path: '/tmp/fcb-manual-check-mobile.png' })
await page.setViewportSize({ width: 1440, height: 1000 });await page.screenshot({ path: '/tmp/fcb-manual-check-desktop.png' }) await page.setViewportSize({ width: 1440, height: 1000 });await page.screenshot({ path: '/tmp/fcb-manual-check-desktop.png' })
assert.deepEqual(errors, []);console.log('PASS: no checks on entry/refresh/pagination/time; single, selected, all 25 across pages, serial requests, cancel, mobile layout.') assert.deepEqual(errors, []);console.log('PASS: no checks on entry/refresh/pagination/time; single, selected, all 25 across pages, serial requests, cancel, mobile layout.')