chore: format

This commit is contained in:
Cursor Agent 2026-08-02 18:24:31 +00:00
parent 57b1790e12
commit 9f19fb2f88
No known key found for this signature in database
3 changed files with 6 additions and 11 deletions

View file

@ -24,6 +24,7 @@ flowchart TD
``` ```
**Opções consideradas:** **Opções consideradas:**
- **A:** Só esconder chevron mas manter estado open — rejeitada (viola aceite). - **A:** Só esconder chevron mas manter estado open — rejeitada (viola aceite).
- **B:** Mover sub-lista para fora do `SidebarMenuItem` de Municípios — rejeitada (quebra semântica de filho; mais churn). - **B:** Mover sub-lista para fora do `SidebarMenuItem` de Municípios — rejeitada (quebra semântica de filho; mais churn).
- **C (recomendada):** Remover disclosure no componente existente; apagar API de open; apertar `mt`/`py` no `SidebarMenuSub` localmente. - **C (recomendada):** Remover disclosure no componente existente; apagar API de open; apertar `mt`/`py` no `SidebarMenuSub` localmente.

View file

@ -50,9 +50,9 @@ export const MunicipalityNavSavedFilters = ({ onNavigate }: { onNavigate: () =>
const menuItem = row?.closest('[data-sidebar="menu-item"]') const menuItem = row?.closest('[data-sidebar="menu-item"]')
const successor = const successor =
savedFilters.length > 1 savedFilters.length > 1
? (row?.nextElementSibling ?? row?.previousElementSibling)?.querySelector<HTMLElement>( ? ((row?.nextElementSibling ?? row?.previousElementSibling)?.querySelector<HTMLElement>(
'[data-sidebar="menu-sub-button"]', '[data-sidebar="menu-sub-button"]',
) ?? menuItem?.querySelector<HTMLElement>('a') ) ?? menuItem?.querySelector<HTMLElement>('a'))
: menuItem?.querySelector<HTMLElement>('a') : menuItem?.querySelector<HTMLElement>('a')
removeMunicipalitySavedFilter(entry.href) removeMunicipalitySavedFilter(entry.href)
@ -91,9 +91,7 @@ export const MunicipalityNavSavedFilters = ({ onNavigate }: { onNavigate: () =>
</SidebarMenuSubButton> </SidebarMenuSubButton>
<SidebarMenuAction <SidebarMenuAction
type="button" type="button"
onClick={(event) => onClick={(event) => handleRemove(entry, event.currentTarget.closest('li'))}
handleRemove(entry, event.currentTarget.closest('li'))
}
aria-label={`Apagar o filtro salvo ${entry.name}`} aria-label={`Apagar o filtro salvo ${entry.name}`}
className="top-1 group-focus-within/menu-sub-item:opacity-100 group-hover/menu-sub-item:opacity-100 md:opacity-0" className="top-1 group-focus-within/menu-sub-item:opacity-100 group-hover/menu-sub-item:opacity-100 md:opacity-0"
> >

View file

@ -111,11 +111,7 @@ test.describe('Filtros salvos de Municípios', () => {
await page.reload() await page.reload()
await expect(shortcut).toBeVisible(NAVIGATION) await expect(shortcut).toBeVisible(NAVIGATION)
await expect( await expect(page.getByRole('list', { name: 'Filtros salvos de Municípios' })).toBeVisible()
page.getByRole('list', { name: 'Filtros salvos de Municípios' }), await expect(page.getByRole('button', { name: /filtros salvos de Municípios/i })).toHaveCount(0)
).toBeVisible()
await expect(
page.getByRole('button', { name: /filtros salvos de Municípios/i }),
).toHaveCount(0)
}) })
}) })