This commit is contained in:
@@ -27,7 +27,7 @@ function moveDrag(event: PointerEvent) {
|
||||
const deltaY = event.clientY - start.startY
|
||||
if (!dragging.value && !isFabDrag(deltaX, deltaY)) return
|
||||
dragging.value = true
|
||||
position.value = clampFabPosition(start.originX + deltaX, start.originY + deltaY, window.innerWidth, window.innerHeight, 58, 14, 84)
|
||||
position.value = clampFabPosition(start.originX + deltaX, start.originY + deltaY, window.innerWidth, window.innerHeight, 56, 14, 84)
|
||||
}
|
||||
function finishDrag(event: PointerEvent) {
|
||||
const start = pointer.value
|
||||
@@ -49,7 +49,6 @@ function activate(event: MouseEvent) {
|
||||
|
||||
<template>
|
||||
<button class="unified-fab" :class="{ dragging }" :style="buttonStyle" :aria-label="props.label" @pointerdown="startDrag" @pointermove="moveDrag" @pointerup="finishDrag" @pointercancel="finishDrag" @click="activate">
|
||||
<span class="unified-fab-aura" aria-hidden="true" />
|
||||
<span class="unified-fab-core"><Plus /></span>
|
||||
<Plus />
|
||||
</button>
|
||||
</template>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -96,6 +96,21 @@ describe('unified floating add interaction', () => {
|
||||
expect(css).toContain('@media(max-width:930px){.unified-fab{bottom:calc(82px + env(safe-area-inset-bottom))}')
|
||||
})
|
||||
|
||||
it('keeps the shared FAB visually simple', () => {
|
||||
expect(floatingAdd).not.toContain('unified-fab-aura')
|
||||
expect(floatingAdd).not.toContain('unified-fab-core')
|
||||
expect(css).not.toContain('.unified-fab:before')
|
||||
expect(css).not.toContain('@keyframes fab-aura')
|
||||
expect(css).not.toContain('@keyframes fab-pulse')
|
||||
expect(css).toMatch(/\.unified-fab\{[^}]*background:var\(--accent\)/)
|
||||
})
|
||||
|
||||
it('keeps the countdown close button but removes its orange circular background', () => {
|
||||
expect(countdownPanel).toContain('<button type="button" aria-label="关闭" @click="closeDialog"><X/></button>')
|
||||
expect(css).toMatch(/\.countdown-modal header button\{[^}]*background:transparent/)
|
||||
expect(css).toMatch(/\.countdown-modal header button\{[^}]*border-radius:8px/)
|
||||
})
|
||||
|
||||
it('removes inline create forms and opens the correct composer from the FAB', () => {
|
||||
expect(app).not.toContain('class="quick"')
|
||||
expect(mvpPanel).not.toContain('class="habit-create"')
|
||||
|
||||
Reference in New Issue
Block a user