Skip to content
SprecherEast
Issue 646

feat: One set of icons for taxing bodies and budget areas, shared by Key facts, chart legends and the projects page

Back to our plan
Open
enhancementfrontenduxpriority: mediumshared-component

Size: M Depends on: nothing to start. Chart 1 (its text legend) and #636 (the shared Legend) use it once it exists. #594, #596 and #597 use it for their bodies, kinds and cards.

Problem

In plain words: the tax pages talk about the same few things over and over: schools, the City, the County, the college, police, fire, streets, parks, the library, buses, paying back loans, housing. A small icon next to each makes a chart's legend, a fact card or a project card quicker to scan, and a little friendlier. Each thing should always get the same icon everywhere on the site. An icon must never be the only way to tell things apart.

The owner (Amine, 2026-11-03, Claude Code session, text) asked for icons and colours in the explainer, and for reusable UI elements for this and future explainers. He also asked to use the existing library behind an interface instead of building one.

Today (checked 2026-11-03):

  • The kit's icons are Lucide. lucide-react 0.576.0 (ISC) is in package.json, and components-and-content.md says to use it for all icons, never inline SVG.
  • There's already a curated map, for Key facts only. src/platform/richtext/editorial/factIcons.ts (FACT_ICONS) maps 13 keys to a label and an icon. Among them: taxes is Receipt, government is Landmark, money is CircleDollarSign, construction is Construction. KeyFacts.tsx draws them with aria-hidden="true", and the label carries the meaning.
  • Elsewhere, files import icons ad hoc (about 40 files). Landmark already means "official meeting" (OfficialMeetingBadge.tsx).
  • Icons we need, checked in the 0.576.0 package: School, GraduationCap, University, Landmark, Building2, Shield, Siren, Flame, HeartPulse, Construction, TrafficCone, Trees, TreePine, Library, BookOpen, Bus, Truck, Droplets, House, Banknote, HandCoins, PiggyBank, Receipt, Scale, Percent, Calculator. There's no Road icon.

Proposed fix

  • One map from a concept to an icon in src/platform/ui/icons/conceptIcons.ts. Each key has a label, an icon and a short description for editors.
    • The keys are stable and plain, not tied to a city: taxing bodies (schools, city, county, college, state-credit), budget areas (police, fire-ems, public-health, streets, parks, library, transit, water, housing, debt, personnel), and money sources (property-tax, fees, state-aid, borrowing, impact-fees, grants, tif, savings).
    • The PR picks the icon per key. It avoids reusing Landmark for two meanings on one page, and records the choice in the file's comment.
  • FACT_ICONS becomes a view of the same map. The existing 13 keys keep their names and icons, so stored blocks don't change. Each concept is defined once (guard rail 1).
  • A ConceptIcon component with two modes:
    • decorative (the default): aria-hidden="true", for when the visible label next to it says the same thing
    • meaningful: role="img" and an aria-label from the map's label, for the rare icon shown without text
    • The PR checks and tests what lucide-react 0.576.0 sets by default, instead of assuming it.
  • Rules, written in docs/ui/component-set.md:
    • An icon always sits next to its text label, or is meaningful with a label. Never icon or colour alone.
    • The icon uses currentColor and the theme's tokens, and needs 3:1 against its background (ui-ux-design.md).
    • Sizes come from the kit (size-4, size-5, size-6).
  • Where it's used.
    • First: the Key facts icon picker (the new keys added as options).
    • Then, by the issues that build them: #639's legend rows, #636's Legend marker (a later variant), #594's "sample bill" rows, and #596/#597's project kind and funding source.
    • Icons go in the HTML legend and labels, never inside a chart's SVG marks.
  • Lucide stays behind the map. Pages import concept keys, not Lucide names, so swapping an icon or the library touches one file.

Native first, one line per step:

  1. Native: React components and SVG from the kit's existing icon library.
  2. Official plugins: not relevant.
  3. Open source: lucide-react, already installed. No new dependency.
  4. Our code: the map, ConceptIcon, the FACT_ICONS view, tests and the gallery entry.

Acceptance criteria

  • Not done: conceptIcons.ts exists, and FACT_ICONS is derived from it. Existing Key facts render unchanged (snapshot or test).
  • Not done: A test checks that every key has a label and an icon, and that decorative and meaningful modes set the right ARIA. axe passes on the gallery.
  • Not done: The Key facts editor can pick the new keys.
  • Not done: /dev/gallery shows every concept with its label at 320 and 1280 px, in light and dark mode, at 3:1 or better.
  • Not done: docs/ui/component-set.md has the rule "never colour or icon alone" and the row for ConceptIcon.
  • Not done: The PR has the shared-component label, and every page using Key facts is checked.

Area

frontend, ux

Priority

medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab