🐛 fix: 合并 codex/fix-client-ip-card-hover 至 main

* 固定存储卡片外层命中区域与内层视觉过渡,保留 300ms/2px 效果
* 按减少动画及触屏规则抑制位移,新增回归覆盖
* 前端 83 项测试及生产构建通过
This commit is contained in:
orion committed 2026-10-29 17:22:37 +08:00
commit 124a53ad33
2 files changed
+58 -8

No files matched your search

+37 -8
View File
@@ -1409,16 +1409,20 @@
<div
v-for="item in detailStorageItems"
:key="item.label"
class="theme-2026-card-hover grid gap-1 rounded-[22px] border px-3 py-2.5 shadow-md transition-all duration-200 hover:shadow-lg sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center"
:class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-white']"
class="fcb-storage-hitbox"
>
<p class="text-xs leading-4" :class="[mutedTextClass]">{{ item.label }}</p>
<p
class="break-all text-sm font-medium leading-5"
:class="[item.mono ? 'font-mono' : '', primaryTextClass]"
<div
class="fcb-storage-card theme-2026-card-hover grid gap-1 rounded-[22px] border px-3 py-2.5 shadow-md transition-all duration-200 hover:shadow-lg sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center"
:class="[isDarkMode ? 'border-gray-700 bg-gray-700/30' : 'border-gray-200 bg-white']"
>
{{ item.value }}
</p>
<p class="text-xs leading-4" :class="[mutedTextClass]">{{ item.label }}</p>
<p
class="break-all text-sm font-medium leading-5"
:class="[item.mono ? 'font-mono' : '', primaryTextClass]"
>
{{ item.value }}
</p>
</div>
</div>
</div>
</section>
@@ -2569,6 +2573,31 @@ onUnmounted(() => {
</script>
<style scoped>
.fcb-storage-card {
transition: transform 300ms ease, box-shadow 300ms ease,
background-color 300ms ease, border-color 300ms ease !important;
}
.fcb-storage-hitbox:hover .fcb-storage-card {
transform: translateY(-2px) !important;
background: #f0f4f8 !important;
box-shadow: var(--fcb-card-shadow-hover) !important;
}
.dark .fcb-storage-hitbox:hover .fcb-storage-card {
background: #2f414a !important;
}
@media (prefers-reduced-motion: reduce), (hover: none) {
.fcb-storage-hitbox:hover .fcb-storage-card {
transform: none !important;
}
}
@media (prefers-reduced-motion: reduce) {
.fcb-storage-card { transition-duration: 0.01ms !important; }
}
.fcb-lifecycle-viewport {
overflow: visible;
}
+21
View File
@@ -107,3 +107,24 @@ test('all five expiration choices retain native multi-selection and shared actio
assert.ok(group.includes('type="checkbox"') && group.includes('v-model="config.expireStyle"'))
assert.ok(group.includes('fcb-action fcb-choice-face'))
})
test('storage detail cards animate visual properties without transitioning grid geometry', async () => {
const {default:postcss}=await import('postcss')
const {descriptor}=parse(readFileSync('src/views/manage/FileManageView.vue','utf8'))
assert.match(descriptor.template.content,/v-for="item in detailStorageItems"[\s\S]*?class="[^"]*fcb-storage-card/)
const css=postcss.parse(descriptor.styles.map(s=>s.content).join('\n'))
let transition
css.walkRules(r=>{if(r.selector==='.fcb-storage-card')r.walkDecls('transition',d=>transition=d.value)})
assert.ok(transition)
assert.ok(!/\ball\b/.test(transition))
for(const property of ['transform','box-shadow','background-color','border-color'])assert.ok(transition.includes(property))
})
test('storage card hover uses a stationary wrapper and disables movement for touch or reduced motion', async () => {
const {descriptor}=parse(readFileSync('src/views/manage/FileManageView.vue','utf8'))
const content=descriptor.template.content
assert.match(content,/v-for="item in detailStorageItems"[\s\S]*?class="fcb-storage-hitbox"[\s\S]*?<div\s+class="fcb-storage-card/)
const css=descriptor.styles.map(s=>s.content).join('\n')
assert.match(css,/\.fcb-storage-hitbox:hover\s+\.fcb-storage-card[\s\S]*?translateY\(-2px\)/)
assert.match(css,/@media \(prefers-reduced-motion: reduce\), \(hover: none\)/)
})