fix: restore Today floating add button
ci / gitleaks (push) Successful in 7s
ci / docker (push) Successful in 5m15s

This commit is contained in:
2026-09-19 18:50:43 +08:00
parent c17af0fd01
commit 915d690397
5 changed files with 12 additions and 24 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ test('Today plain-list composition has no overlap or horizontal overflow', async
}
const geometry = await page.locator('main').evaluate((main) => {
const selectors = ['.today-environment', '.today-page-title', '.today-remaining', '.today-inline-filter', '.today-section-toggle']
const selectors = ['.today-environment', '.today-heading', '.today-section-toggle']
const rects = selectors.map(selector => main.querySelector(selector)!.getBoundingClientRect())
const context = main.querySelector('.today-context')!
const contextRect = context.getBoundingClientRect()
+4 -11
View File
@@ -54,7 +54,8 @@ test('Today plain-list layout matches the approved responsive geometry', async (
environmentHeight: width >= 721 ? 55 : width === 375 ? 79 : 81,
})
await expect(page.locator('.today-heading')).toHaveCount(1)
await expect(page.locator('.today-inline-add')).toHaveCount(1)
await expect(page.locator('.today-inline-add')).toHaveCount(0)
await expect(page.locator('.unified-fab')).toHaveCount(1)
await expect(taskRowLocator).toHaveCount(1)
await expect(habitRowLocator).toHaveCount(1)
await expect(page.locator('.today-environment')).toBeVisible()
@@ -72,7 +73,6 @@ test('Today plain-list layout matches the approved responsive geometry', async (
const filter = document.querySelector<HTMLElement>('.today-inline-filter')!
const firstSection = document.querySelector<HTMLElement>('.today-section-toggle')!
const heading = document.querySelector<HTMLElement>('.today-heading')!
const inlineAdd = document.querySelector<HTMLElement>('.today-inline-add')!
const main = document.querySelector<HTMLElement>('main.today-main')!
const content = rect('.today-context')
const sectionTitle = firstSection.querySelector<HTMLElement>('.today-section-title')!
@@ -145,9 +145,6 @@ test('Today plain-list layout matches the approved responsive geometry', async (
headingAlignItems: getComputedStyle(heading).alignItems,
filterTop: filter.getBoundingClientRect().top,
filterRight: filter.getBoundingClientRect().right,
inlineAddPosition: getComputedStyle(inlineAdd).position,
inlineAddWidth: inlineAdd.getBoundingClientRect().width,
inlineAddBottom: inlineAdd.getBoundingClientRect().bottom,
viewportHeight: innerHeight,
titleFontSize: getComputedStyle(title).fontSize,
titleFontWeight: getComputedStyle(title).fontWeight,
@@ -206,13 +203,9 @@ test('Today plain-list layout matches the approved responsive geometry', async (
expect(metrics.styles.filterTop).toBeGreaterThanOrEqual(metrics.ordered[1].top)
expect(metrics.styles.filterTop).toBeLessThanOrEqual(metrics.ordered[1].bottom - metrics.styles.filterHeight)
expect(metrics.styles.filterRight).toBeCloseTo(metrics.content.right, 0)
expect(metrics.styles.inlineAddPosition).toBe('relative')
expect(metrics.styles.inlineAddWidth).toBeCloseTo(metrics.content.width, 0)
expect(metrics.styles.inlineAddBottom).toBeGreaterThanOrEqual(metrics.ordered[metrics.ordered.length - 1].bottom)
expect(metrics.styles.inlineAddBottom).toBeLessThanOrEqual(metrics.styles.viewportHeight + 1)
if (width <= 720) expect(metrics.styles.contextHeight).toBeLessThanOrEqual(210)
expect(metrics.styles.fabShadow).toBe('')
expect(metrics.styles.fabIconWidth).toBe(0)
expect(metrics.styles.fabShadow).toContain('8px 18px')
expect(metrics.styles.fabIconWidth).toBeCloseTo(30, 0)
if (width >= 721) {
expect(metrics.uniqueRows).toHaveLength(1)
expect(metrics.content.width).toBeCloseTo(width >= 1440 ? 1080 : 630, 0)