Repository navigation
Build the two calculators that were never built, and test all three - #85
Merged
Merged
Conversation
Reported as "the calculator page is not working". Two of the three tool pages had no calculator on them at all: the unit converter and the vial planner rendered a name, a one-line "computes" and a one-line "refuses", and stopped. 58 words and 53 words, no form, no input, no output element. The reconstitution calculator did work, and its arithmetic was correct. Nothing in the build could see this. A page with no form still builds, still validates, still passes the link check and still enters the sitemap. Both are now implemented. The unit converter does mg, mcg and ng as fixed ratios and millilitres to units on a U-100, U-50 or U-40 scale, and explains at length why it will not convert international units: an IU is defined per substance by a reference preparation, so there is no general mass equivalent and a converter offering one has invented it. The vial planner reports whole draws, rounding down because a partial draw is not a draw, the volume of each, how long a vial lasts at a stated frequency, and the remainder that cannot be drawn. The reconstitution calculator gains the syringe scale as an input instead of assuming U-100, and warns when a draw falls below the smallest graduation on the chosen barrel or exceeds a 1 mL syringe. All three scripts are one script that wires up whichever calculator is on the page. Astro hoists a component's script into every page that renders it, so three separate scripts would have loaded on all three pages and thrown on the missing elements. scripts/test_calculators.mjs runs in CI after the build. It extracts the inline module from each built page and runs it against a stub DOM, and it fails when a page has no form or no output element, which is the specific defect that shipped here. 17 assertions. Writing those tests found an error in my own prose: the worked example said 0.1 mL is 20 units on a U-40 syringe. It is 4. The code was right and the sentence under it was wrong, which is the more dangerous way round. The three tools now have records, so they are indexable for the first time and enter the sitemap. This matters more than it looks: "peptide calculator" measures 114,884 clickstream searches at KD 6 and "peptide reconstitution calculator" 7,479 at KD 4, and the site was answering none of it. The directory page is rewritten and indexable too. CI also had SITE_URL on the apex host, which 308-redirects to www. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Reported as "the calculator page is not working". Two of the three tool pages had no calculator on them at all.
The reconstitution calculator did work and its arithmetic was correct. The other two rendered a name, a one-line "computes", a one-line "refuses", and stopped.
Nothing in the build could see this. A page with no form still builds, still validates, still passes the link check and still enters the sitemap.
What the two now do
Unit converter handles mg, mcg and ng as fixed ratios, and millilitres to units on U-100, U-50 or U-40. It explains at length why it will not convert international units: an IU is defined per substance by a reference preparation, so there is no general mass equivalent, and a converter that offers one has invented it. That refusal is the tool's stated purpose in the registry, so it is now argued rather than just asserted.
Vial planner reports whole draws (rounding down, because a partial draw is not a draw), the volume of each, how long a vial lasts at a stated frequency, and the remainder that cannot be drawn.
Reconstitution gains the syringe scale as an input instead of assuming U-100, and warns when a draw falls below the smallest graduation on the chosen barrel or exceeds a 1 mL syringe.
All three are wired by one script that picks whichever calculator is present. Astro hoists a component's script into every page that renders it, so three separate scripts would have loaded on all three pages and thrown on the missing elements.
A test that would have caught it
scripts/test_calculators.mjsruns in CI after the build. It extracts the inline module from each built page, runs it against a stub DOM, and asserts on what lands in the output element. It fails when a page has no<form>or no<output>, which is the exact defect that shipped here. 17 assertions.Writing those tests found an error in my own prose. The worked example said 0.1 mL is "20 units on a U-40 syringe". It is 4. The code was right and the sentence under it was wrong, which is the more dangerous way round, and it is now covered by a test.
They are indexable for the first time
The three tools now have records, so they leave
noindexand enter the sitemap. This matters more than the page count suggests:Roughly 130,000 monthly searches at difficulty 0 to 6, which the site was answering with three noindex pages, two of them empty. The directory page is rewritten and indexable too, and titles now name what people actually search for.
Also fixed: CI built with
SITE_URLon the apex host, which 308-redirects towww.Gates
Content validation (59 records), registry check, 36 drafter tests, 17 calculator tests, loop gate 47/47, all five link rules.
🤖 Generated with Claude Code