mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
style: prettier B120 mobile filter files
This commit is contained in:
parent
f97618524b
commit
3e49841fd7
3 changed files with 15 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Municípios mobile — filtro combobox + densificar lista
|
||||
|
||||
Status: in-progress
|
||||
Status: implemented
|
||||
Atualizado em: 2026-08-02
|
||||
Issue: #207
|
||||
Priority: P1
|
||||
|
|
@ -17,6 +17,13 @@ Responsável: pool worker
|
|||
- Overview no desktop: manter `md+` (recomendação A).
|
||||
- Sem migration / schema.
|
||||
|
||||
## Entrega
|
||||
|
||||
- Mobile: `MunicipalityMobileFilterCombobox` (Filter + chips + typeahead) sobre B18.
|
||||
- Overview KPI + sort notice: `hidden` <md.
|
||||
- Cards densificados (cobertura/nível + controles; sem Classe/2022).
|
||||
- Pins unit: chip/URL round-trip; filter navigation atualizado.
|
||||
|
||||
## Design (Impeccable)
|
||||
|
||||
Âncoras: `PRODUCT.md` (Clarity under pressure; Feel the action; Edit where you see) / `DESIGN.md` · tema `campaign` · referência mental GitHub Issues/PR filters · B16/B18 URL.
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import {
|
|||
ComboboxList,
|
||||
} from '@/components/ui/combobox'
|
||||
import { InputGroupAddon } from '@/components/ui/input-group'
|
||||
import { DEFAULT_VOTE_ESTIMATE_SCENARIO } from '@/lib/voteEstimate'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { DEFAULT_VOTE_ESTIMATE_SCENARIO } from '@/lib/voteEstimate'
|
||||
import { matchesAtWordStart, normalizeSearchPhrase } from '@/lib/wordStartFilter'
|
||||
import type { MunicipalityFilterOption } from '@/utilities/municipality/municipalityListFilters'
|
||||
import type { MunicipalityListState } from '@/utilities/municipality/municipalityListUrl'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { DEFAULT_VOTE_ESTIMATE_SCENARIO } from '@/lib/voteEstimate'
|
||||
import { buildMunicipalityFilterHref } from '@/utilities/municipality/municipalityListFilters'
|
||||
import type { MunicipalityListState } from '@/utilities/municipality/municipalityListUrl'
|
||||
import {
|
||||
applyMunicipalityMobileFilterOption,
|
||||
buildMunicipalityMobileFilterChips,
|
||||
|
|
@ -8,8 +10,6 @@ import {
|
|||
dismissMunicipalityMobileFilterChip,
|
||||
findMunicipalityMobileFilterOption,
|
||||
} from '@/utilities/municipality/municipalityMobileFilterCombobox'
|
||||
import { buildMunicipalityFilterHref } from '@/utilities/municipality/municipalityListFilters'
|
||||
import type { MunicipalityListState } from '@/utilities/municipality/municipalityListUrl'
|
||||
|
||||
const baseState = (): MunicipalityListState => ({ page: 1 })
|
||||
|
||||
|
|
@ -119,7 +119,10 @@ describe('municipalityMobileFilterCombobox', () => {
|
|||
const chips = buildMunicipalityMobileFilterChips(state, options)
|
||||
expect(chips.some((chip) => chip.id.startsWith('sort:'))).toBe(true)
|
||||
|
||||
const sortChip = findMunicipalityMobileFilterOption(options, chips.find((c) => c.id.startsWith('sort:'))!.id)!
|
||||
const sortChip = findMunicipalityMobileFilterOption(
|
||||
options,
|
||||
chips.find((c) => c.id.startsWith('sort:'))!.id,
|
||||
)!
|
||||
state = dismissMunicipalityMobileFilterChip(state, sortChip) as MunicipalityListState
|
||||
expect(state.sort).toBeUndefined()
|
||||
expect(state.dir).toBeUndefined()
|
||||
|
|
|
|||
Loading…
Reference in a new issue