---
fragment_id: oscar.map.filter-chips.002
domain: MAP
rule: Filter chips for kind / date / name
source: app/src/map/FilterChips.tsx
bound_to_modules:
  - oscar.map
status: SHIPPED
version: .002
---

# Filter chips (per codex.md §C8 + C6 user sims 15-18 + rules.md §15)

A row of filter chips sits at the top of the layer list, above the row list itself. Three orthogonal filter dimensions are combinable. Empty filter = show all.

## Kind filter

Multi-select chips: `Point`, `Line`, `Polygon`.

- Empty selection → show all kinds
- One or more selected → show only layers whose `kind` is in the selection
- Click a chip to toggle. Active = filled leaf-green; inactive = cream-paper outline.

## Date filter

Single-select chips: `Today`, `This Week`, `This Month`, `Custom`.

- Selection is mutually exclusive. Click another chip to switch; click the active chip to clear.
- `Today` → layers where `created_at` is on today's date (local operator timezone)
- `This Week` → layers where `created_at` is within the last 7 days
- `This Month` → layers where `created_at` is within the current calendar month
- `Custom` → opens a date-range picker (start + end, ISO8601 dates). Operator types or picks dates; commit on blur.
- Null selection → show all dates

## Name filter

Free-text input. Substring match on layer name. Case-insensitive. Trimmed.

- Empty input → show all names
- Non-empty → show only layers whose `name` contains the substring

## Clear all filters

A "Clear" affordance at the right end of the chip row. Visible when any filter is active. Clears all three filter dimensions in one click.

## Filter derivation

Filter is a pure function: `(layers, filterState) => visibleLayers`. The map and the layer list both consume the same filtered set. There is no separate "map filter" and "list filter".