Skip to content
SprecherEast
Issue 1121

feat: "Your share" tab: readable bar labels, City row highlighted, one story for the two years

Back to our plan
Done
enhancementfrontendstylingvisualizationuxpriority: highready

Problem

The owner reviewed the live "Your share" tab (2026-11-12, chat session) and found five things to polish and one figure that can mislead:

  • The percent on the bar's green slice is hard to read, and the smallest slice has no percent.
  • The "Tax rates" label sits to the right of the year control, not centred over it.
  • Nothing in the receipt marks the City of Madison row as the one the tab is about.
  • "Where the City share goes" is closed when the tab opens; he wants it open.
  • For a home value a reader types, the increase line ("Up … a year") and the year switch disagree. The increase is the average home's City increase scaled to the typed value, which assumes the home's assessment rose as the City's average home did. The year switch prices the same typed value under each year's rates. When the rate falls while assessments rise, the line says the tax went up while switching years shows it going down.

Proposed fix

  1. Bar labels: every percent drawn on the bar has high contrast against its slice (at least 4.5:1, in light and dark), from theme tokens.
  2. Small slices: every slice shows its percent. A slice too narrow for its label is drawn at the minimum width that fits the label, with the extra taken proportionally from the other slices; the receipt keeps the exact percents and amounts. The note says the bar may widen a small slice to keep it labelled.
  3. "Tax rates": centred above the joined year control (on the stacked layout too).
  4. City row: the City of Madison row in the receipt is highlighted (a soft primary fill and bolder text, not color alone), matching the bar's green slice.
  5. First row open: "Where the City share goes" is open when a whole-bill tab loads; the other two stay closed. It still works without scripting and its title does not move when toggled.
  6. One story for the two years: the earlier year is priced for the same home at its earlier value: the typed value scaled by the ratio of the two years' average homes. Then the later year's City tax minus the earlier year's equals the increase line, for any home value, and switching years moves the City figure by exactly that amount. In the earlier year's view the small sentence shows the value used for that year. "How we estimate this" says in one plain sentence that last year's value is assumed to have changed as the average home's did. Keep one definition of the increase (the existing one); do not add a second calculation that could drift from it. If a stored year lacks an average home, fall back to the typed value and do not show an increase the data cannot support.

Acceptance criteria

  • Not done: Failing tests first for each point, including: for several home values, later-year City tax minus earlier-year City tax equals the increase shown, to the cent before rounding and to the dollar as displayed; the earlier year's sentence shows the scaled value; the assumption sentence is present.
  • Not done: Bar labels meet 4.5:1 on every slice in light and dark (the theme contract test covers the pairs).
  • Not done: At 320 and 390 px every slice shows its percent on one line, inside its slice; the receipt's percents are unchanged.
  • Not done: "Tax rates" is centred over the control within 1 px at 320, 390 and 1280 px.
  • Not done: The City row's highlight is visible in light and dark and is not told by color alone.
  • Not done: The first row is open on load at every width; with scripting off it is open too.
  • Not done: Real renders at 320, 390, 768 and 1280 px, light and dark, read and recorded; a typed value and a year switch checked by eye against the numbers.
  • Not done: The rich text note and the UI kit note describe the changes in the same pull request; wording follows the brand voice.

Files likely touched

  • src/platform/richtext/editorial/BillShare.client.tsx, src/platform/richtext/editorial/BillAnswer.tsx, src/platform/richtext/editorial/BillDetails.tsx, src/platform/richtext/editorial/RoughEstimator.tsx, src/platform/richtext/editorial/billFigures.ts, src/platform/richtext/editorial/billShareNotes.ts, src/platform/richtext/editorial/cityBar.ts, and their tests
  • src/platform/lib/billShare.ts
  • src/platform/ui/ShareBill.tsx, src/platform/ui/ShareBar.client.tsx, src/platform/ui/shareTones.ts, src/platform/ui/Field.client.tsx, src/platform/ui/Disclosure.tsx
  • src/app/(frontend)/dev/gallery/, e2e/billTab.spec.ts
  • src/platform/richtext/README.md, src/platform/ui/README.md, docs/ui/component-set.md

Must not touch

  • src/platform/ui/Tabs.client.tsx, src/platform/richtext/editorial/FactCard.tsx, src/platform/richtext/editorial/tabAnchors.ts
  • Stored content and tax years

Open questions

None.


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab