Skip to content

Show formula component values in income-required popup; alphabetize states#63

Merged
HouseofTyrell merged 1 commit into
mainfrom
claude/cool-ptolemy-oq9sy8
Jun 13, 2026
Merged

Show formula component values in income-required popup; alphabetize states#63
HouseofTyrell merged 1 commit into
mainfrom
claude/cool-ptolemy-oq9sy8

Conversation

@HouseofTyrell

Copy link
Copy Markdown
Owner

Summary

Two small UX improvements to the "Income Required for Full Utilization" surface and the state pickers.

1. Formula component values in the info popup

The popup already showed the formula and the single "Your value" figure. It now also lists the value of each term of that formula under "Your value", for the peak year:

  • §461(l) Deduction
  • $3K Used
  • Start-of-Year NOL ($X) ÷ 80% (the gross-up, with the raw NOL and the actual offset limit shown inline)
  • Net Taxable ST/LT Gains (rendered as a subtraction — the piece netted out)

These are computed once in the engine as a new incomeRequiredComponents object on YearResult (in both core.ts and the sensitivity mirror) and consumed by the popup — no parallel calculation, honoring the one-engine rule. A reconciliation test asserts the four terms net back to the headline incomeRequiredForFullUtilization for every projection year, and that the gross-up equals start-of-year NOL ÷ limit.

The popup component (InfoText / FieldInfoPopup) gained an optional breakdown prop and a small styled term list; a component test verifies it renders (and is omitted when no breakdown is supplied).

2. Alphabetical states

STATES in src/taxData.ts was grouped (no-income-tax states first, then the taxed states), so the dropdowns weren't fully alphabetical. The list is now ordered alphabetically by name with the custom "Other (enter rate)" entry pinned last. All three state dropdowns (Workspace, Tax/Financial profile, Meeting mode) read from this single array, so they're all consistent. All rates and inline sourcing comments are preserved.

Testing

  • npm run test:run — 406 passing (added engine reconciliation + popup render tests)
  • npm run build — type-check + vite build clean
  • npm run lint — 0 errors
  • npm run format:check — clean

Note: no Playwright in this remote environment, so the popup was verified via a Testing Library render test rather than a live browser screenshot.

https://claude.ai/code/session_0172oQH7aaFiSDufagm7TXJr


Generated by Claude Code

… states

The "Income Required for Full Utilization" info popup now lists the value of
each formula term (§461(l) deduction, $3K used, start-of-year NOL ÷ 80%
gross-up, and the netted-out taxable ST/LT gains) under "Your value", so the
planning target is auditable. The components are computed once in the engine
(core.ts / sensitivity.ts) as incomeRequiredComponents and consumed by the
popup — no parallel calculation. A reconciliation test asserts the terms net
back to the headline figure.

Also reordered the STATES list alphabetically by name (custom "Other" entry
pinned last) so every state dropdown displays in alphabetical order.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying enhanceddirectindexingcalc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9399d29
Status: ✅  Deploy successful!
Preview URL: https://33248ee9.enhanceddirectindexingcalc.pages.dev
Branch Preview URL: https://claude-cool-ptolemy-oq9sy8.enhanceddirectindexingcalc.pages.dev

View logs

@HouseofTyrell HouseofTyrell merged commit f623347 into main Jun 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants