Repository navigation
Conversation
The collapsible "How GiveCalc calculates" / "How Gift Aid works" card under the results repeated the Questions section below it in hand-written copy that no test checked. Remove it, and move the two true points the questions lacked into them, each backed by production API runs and model checks: - Why did my gift save little or nothing? now explains that a larger gift can save less on each extra dollar, once it brings taxable income into a lower bracket, and that the federal deduction for cash gifts stops at 60% of adjusted gross income. A Florida household earning $250,000 in 2026 shows both: $10,000 more saves $3,200, then $2,400, then nothing past $150,000. - What does GiveCalc leave out? now lists the five-year carryforward of cash gifts above that limit, which policyengine-us does not model. tests/test_faq_numbers.py traces the Florida answer through the model: no state or local income tax, AGI equal to wages, each step's saving equal to the rate of the bracket its taxable income stays in, and a deduction that stops at the 60% limit (charity.ceiling.all) less the 0.5% floor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The built page read "60%of your adjusted gross income". Next 16.2's SWC
drops the leading spaces of a JSX text that spans lines and holds an HTML
entity, so `to {cashLimit} of your` with `“` later in the same text
compiled to ["to ", cashLimit, "of your …"]. Vitest compiles JSX another way
and kept the space, so the FAQ tests passed.
Put the space in an expression, as the FAQ already does for
`{us.year}{" "}deduction`, and add src/test/jsxWhitespace.test.ts. It
parses every component with TypeScript and fails on any JSX text of that
shape: leading spaces, a line break and an entity. It reports only this
line before the fix, and nothing in the rest of the frontend.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
added a commit
that referenced
this pull request
Nov 30, 2026
Replaces the results page's methodology card with the Questions section, adds Florida examples, the federal cash-gift limit, carryforwards, the marginal-savings estimate and the Gift Aid conditions. Supersedes #93. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the collapsible "How GiveCalc calculates" / "How Gift Aid works" card under the results. It repeated the Questions section directly below it (#92) in hand-written copy that no test checked. The two true points the questions lacked move into them, backed by production API runs and model checks. Follows up the reconciliation flagged in #92.
Each claim on the old card, and where it went
Each claim was checked against policyengine-us 2.49.2 and policyengine-uk 2.134.6, the versions
modal_app.pypins and production serves (read from a live Modal container on 2026-10-24).ca_deductions)state_withheld_income_tax, an estimate from AGI that a cash gift doesn't move. Only the local taxes inlocal_income_tax, such as New York City's, feed back.gov.irs.deductions.itemized.charity.ceiling.all= 0.6). Unlike the card's "may not be fully deductible in the current year", the law carries the excess forward five years (26 U.S.C. 170(b)(1)(G)(ii)), and policyengine-us does not model that.first_extended_scottish_threshold)maximum_ANI£100,000,reduction_rate0.5)CB_HITC.phase_out_start, ending at £80,000); the test is adjusted net incomeWhat the questions gain
"Why did my gift save little or nothing?" now says three things:
A single 30-year-old earning $250,000 in Florida in 2026 shows each step, from six new
/api/savingsruns against production (2026-10-24):An "Open the Florida example" link opens the $70,000 case. In the browser it shows a $54,418 cost, $15,582 of savings and "Saved on the next $1: 24.0%". The marginal chart shows the 32% plateau, the drop to 24% and the fall to zero at $150,000.
"What does GiveCalc leave out?" gains a bullet: deducting, in later years, cash gifts above 60% of AGI, which federal law lets you carry forward for up to five years.
The FAQ keeps nine questions.
faqNumbers.jsonadds only the six Florida cases and a new date; every earlier answer is unchanged to the byte.The space the build dropped
The 375 px check found "60%of your" on the built page, though Vitest's text matched. The cause is in Next 16.2.6's SWC: it drops the leading spaces of a JSX text that spans lines and contains an HTML entity.
to {x} of your, then a line break and“q”, compiles to["to ", x, "of your “q”"].This was reproduced with
next/dist/build/swcacross the variants:PR #92's
{us.year}{" "}deductionworks around the same thing.The fix puts the space in an expression.
frontend/src/test/jsxWhitespace.test.tsparses every component with TypeScript and fails on any JSX text of that shape. Before the fix it flagged exactly this line, and nothing else in the frontend.Invariants (tested)
test_api_gives_the_recorded_answer).test_florida_answer_holds_in_the_model). For all six cases, simulated the way the API simulates them:cash_gift_limit_share_of_agi(0.6) equalscharity.ceiling.allfor 2026.faqNumbers.test.ts):src/has the shape the build strips.Checks
<img>inHeader.tsx.next buildpasses. The prerendered page reads60%<!-- --> <!-- -->of your.test_faq_numbers.py19 passed (full suite: see below). black and isort: clean.scrollWidth375); the new paragraphs and bullet wrap cleanly; the UK £1,000 gift at £70,000 reclaims £250.~/reviews/givecalc-2026-10-16/screenshots/methodology-pr93/.axiom: n/a: UI copy and tests only
🤖 Generated with Claude Code