Skip to content

Keep a $0 income in the page's link and cite 18051(e)(2) - #49

Merged
DTrim99 merged 1 commit into
mainfrom
bhp-followups
Nov 30, 2026
Merged

DTrim99 merged 1 commit into
mainfrom
bhp-followups

Conversation

@DTrim99

@DTrim99 DTrim99 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Why

Pavel's review of #46 left two suggestions open when #46 merged:

  • Suggestion 2. The cards work at $0 of earnings, but a link copied at $0 opened with an empty earnings box. CalculatorForm.jsx and CalculatorResults.jsx kept only an income above zero.
  • Suggestion 3. "Can't enroll in a Marketplace plan" comes from 42 U.S.C. 18051(e)(2) ("Eligible individuals may not use Exchange"). The code cited 18051(e).

His suggestion 4, #41's rebase, needs no change here.

What

$0 in links

  • buildShareableUrl writes income=0. A blank box still leaves the income out.
  • getLinkFromUrl reads income=0 as $0. A missing, non-numeric or negative income still opens with a blank box.
  • CalculatorResults reports $0 to the page's link. The earnings box starts at $0 for a link that asks for it. Pavel named three places; this fourth one treated a starting income of 0 as blank.
  • CalculatorForm.test.jsx (bun test) covers both directions. On main's CalculatorForm.jsx, its two $0 tests fail.

Citation

  • The comments in api.py and CalculatorResults.jsx cite 18051(e)(2), and so does the basic_health_program field's description in models.py.
  • Merging redeploys the API, since the change touches src/aca_api/. The API's behavior doesn't change.

changelog.d/bhp-followups.fixed.md.

Checks

  • bun test: 15 pass, Fix the explanation's opening sentence and widen New York's mid-year note #47's 9 and this PR's 6.
  • bun run build passes, including the data check.
  • tests/test_modal_requirements.py and tests/test_smoke_test_api.py: 24 pass. CI runs the rest of the API tests.
  • In Chrome, against this branch's API run locally, Lebanon County, PA, age 40:
    • A link with income=0: opens with $0 in the box. The cards show Medicaid (2026) and $1,094 (2027), with the work-requirement explanation.
    • Typing 0 into an empty box: the page's link gains income=0. Clearing the box removes it.

🤖 Generated with Claude Code

From Pavel's review of #46 (suggestions 2 and 3):

- $0 of earnings gets cards, so the link keeps it: buildShareableUrl and
  getLinkFromUrl accept an income of 0, the results report it, and the
  earnings box starts at $0 for a link that asks for it.
  CalculatorForm.test.jsx covers the link both ways.
- The comments and the API's field description cite 42 U.S.C. 18051(e)(2),
  the paragraph that bars Basic Health Program enrollees from the Exchange.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
aca-calc Ready Ready Preview Nov 30, 2026 2:19pm UTC

Request Review

@PavelMakarchuk PavelMakarchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at 7ae04d8

This PR closes suggestions 2 and 3 of the #46 review. A $0 income now survives the full round trip: box, page link, reopened link, box. The new citation, 42 U.S.C. 18051(e)(2), is the correct paragraph. I found no bug. One test comment still cites 18051(e), and two wording points are optional.

Verdict: APPROVE

Suggestions

  1. tests/test_api_at_income.py:170 still cites "42 U.S.C. 18051(e)". The PR changes the three other places (api.py:557, models.py:183, CalculatorResults.jsx:67). Change this comment too, so that the repository cites one paragraph. Optional.
  2. "Enrollees" against "eligible individuals". 18051(e)(2) says that an "eligible individual" (a person eligible for the Basic Health Program under (e)(1)) is not a qualified individual for the Exchange. The bar applies on eligibility, not on enrollment. The api.py:556-557 comment and the changelog fragment say "enrollees". models.py says "Eligible for ...", which matches the statute. The code tests eligibility (basic_health_program), so behavior is correct. Only the words differ. Optional.
  3. The CalculatorResults.jsx half has no automatic test. The new tests cover buildShareableUrl and getLinkFromUrl. The two CalculatorResults changes (initialIncome != null at line 375, income >= 0 at line 380) are covered only by the manual Chrome check in the PR description. Without them, a $0 link would still open blank. A render test is not easy with plain bun test (no DOM), so this is acceptable as it is. Optional.

What I checked

  1. Head and base. The head is 7ae04d8f96b489014fbd855d7c83fb4582b085f6. The merge base is main at ee0a9237 (#47), which is still the tip of main. The PR has 1 commit, +73/-7 in 6 files.
  2. $0 round trip, step by step.
    • Box to link: userIncome = "0" gives parseFloat 0, and 0 >= 0 sends 0 to onViewChange. buildShareableUrl writes income=0 (income != null && income >= 0). A blank box gives NaN, then null, then no income parameter.
    • Link to box: getLinkFromUrl reads parseFloat("0") = 0 and keeps it. A missing parameter (parseFloat(null)), income= (parseFloat("")), abc and -5 all give null. Calculator.jsx:333 passes it with ??, not ||, so 0 stays 0. CalculatorResults starts the box at "0" (initialIncome != null). householdAtIncome.js asks the API for 0 (income >= 0), as #46 made it do.
    • linkView keeps the link's income through the first calculation (handleCalculate(..., { fromLink: true }) does not reset it). App.jsx keeps the query on navigation and on hashchange.
    • -0 writes income=0 (String(-0) is "0"). This is correct.
  3. Other numeric fields with a falsy-zero pattern. getFormDataFromUrl uses parseInt(...) || 40 for age and spouse. Age 0 becomes 40, but the form limits both to 18-64 and the API requires age_head >= 18, so this has no effect. Dependent ages use filter(!isNaN), so a dependent age of 0 survives. toRequest tests === "", so 0 survives. num_dependents comes from the list length. I found no other field with the bug.
  4. Earlier behavior, not changed by this PR. parseFloat accepts income=Infinity and income=2000000. The link keeps them, and the box shows the existing "up to $1,000,000" notice. parseFloat("0abc") gives 0. These behaved the same before the PR. I do not ask for a change.
  5. Statute. I read 42 U.S.C. 18051 on govinfo (USCODE-2024). Subsection (e) is "Eligible individual". Paragraph (e)(1) defines the person (state resident, not Medicaid-eligible, 133-200% FPL, no affordable minimum essential coverage, under 65). Paragraph (e)(2), "Eligible individuals may not use Exchange", says that such a person is not a qualified individual under section 18032 for a qualified health plan through an Exchange. So (e)(2) supports the claim "can't enroll in a Marketplace plan". See suggestion 2 for the wording.
  6. JS tests and build (clean clone, bun 1.3.9).
    • bun test: 15 pass, 0 fail (2 files).
    • With main's CalculatorForm.jsx and the new test file, "keeps $0" and "opens at $0 when the link asks for $0" fail, and the other 4 pass. This matches the PR description.
    • bun run build: the data check and next build pass. The repository has no lint script.
  7. Python API under src. The changes are 1 comment in api.py and 1 field description in models.py. No behavior changes. With the image's packages (modal-requirements.txt) and PYTHONPATH=src:., tests/test_modal_requirements.py and tests/test_smoke_test_api.py give 24 passed. The new PersonCoverage.basic_health_program description loads and reads "(42 U.S.C. 18051(e)(2))". CI "Test with the image's packages" ran 83 API tests, all passed, finished at 9:32am EST on 2026-11-30. "Deploy and smoke-test" was skipped, as expected on a PR. Vercel preview is ready.
  8. Changelog. changelog.d/bhp-followups.fixed.md is a top-level fragment with a valid type, like the other fragments in the repository.
  9. Other open PRs. Only #41 (Local impact page) touches the same files. The PR description already says #41's rebase needs no change. The 1-line edits here are small, so a conflict is unlikely.

@DTrim99
DTrim99 merged commit 71b5c99 into main Nov 30, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7ae04d8f Deployed Nov 30, 2026 by vercel[bot]
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