fix: match filter pills row height to breadcrumb bar (45px)

Rework feedback: filter pills row used py-1.5 padding instead of a
fixed 45px height, causing visual misalignment with the breadcrumb bar.
Replace padding with explicit h-[45px] to match exactly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-03-18 10:32:29 +01:00
parent ce7b5f93d3
commit 027a85fb06
2 changed files with 41 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ const PILLS: { value: NoteListFilter; label: string }[] = [
function FilterPillsInner({ active, counts, onChange }: FilterPillsProps) {
return (
<div className="flex shrink-0 items-center gap-1 border-b border-border px-4 py-1.5" data-testid="filter-pills">
<div className="flex h-[45px] shrink-0 items-center gap-1 border-b border-border px-4" data-testid="filter-pills">
{PILLS.map(({ value, label }) => (
<button
key={value}

View File

@@ -0,0 +1,40 @@
import { test, expect } from '@playwright/test'
test.describe('Filter pills height matches breadcrumb bar', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/')
await page.waitForLoadState('networkidle')
})
test('filter pills row height equals breadcrumb bar height (45px)', async ({ page }) => {
// Click on the "Projects" type section in the sidebar
await page.getByText('Projects', { exact: true }).click()
// Filter pills should now be visible
const pills = page.getByTestId('filter-pills')
await expect(pills).toBeVisible()
// Verify height matches breadcrumb bar (45px)
const pillsBox = await pills.boundingBox()
expect(pillsBox).not.toBeNull()
expect(pillsBox!.height).toBe(45)
// Verify all three pills are present
await expect(page.getByTestId('filter-pill-open')).toBeVisible()
await expect(page.getByTestId('filter-pill-archived')).toBeVisible()
await expect(page.getByTestId('filter-pill-trashed')).toBeVisible()
// Open pill should be active by default
const openPill = page.getByTestId('filter-pill-open')
await expect(openPill).toHaveAttribute('aria-selected', 'true')
// Verify pills are keyboard accessible (Tab + Enter)
await openPill.focus()
await expect(openPill).toBeFocused()
await page.keyboard.press('Tab')
const archivedPill = page.getByTestId('filter-pill-archived')
await expect(archivedPill).toBeFocused()
await page.keyboard.press('Enter')
await expect(archivedPill).toHaveAttribute('aria-selected', 'true')
})
})