feat(tools): waves A/B/C — cleanup + 10 new gemmological widgets#21
Merged
Conversation
…bile grids The tools hub advertised features that did not exist (price-per-carat calculator, side-by-side gem comparison, origin characteristics guide, pleochroism reference) and the refractometer simulator silently dropped gems with RI > 1.81 — exactly the over-the-limit teaching moment it should surface. Several calculator grids also rendered fixed two- or three-column layouts on phones. Changes - ToolsHub: rewrite four card descriptions to match what is actually rendered. Pricing is intentionally out of scope (purely gemmological site, gem prices change constantly). - conversions.astro: drop pricing copy from page title and meta description. - RefractometerSimulator: keep over-the-limit gems in the dropdown and render an "Over the limit — continuously bright field, no shadow edge" panel instead of silently filtering them out. - SG, Birefringence, RI Lookup, Length, Temperature, Carat (two grids): add 'grid-cols-1' fallback with 'md:grid-cols-N' for proper mobile stacking. - MeasurementTools: add a Learn-more block linking to /learn/equipment/sg-measurement, /learn/equipment/refractometer, and the optical/physical-properties fundamentals pages.
Wave B adds six pure-gemmology tools and upgrades, all reusing the existing component patterns and mineral database: * B1 — Pleochroism Reasoner (/tools/optical): observed colour count and colours rank candidate species and explain isotropic/uniaxial/biaxial systems. * B2 — Hanneman/Hodgkinson short-cut RI (/tools/measurement): contact- liquid relief observations bracket the RI band of over-the-limit and rough stones, then filter the database to candidate species. * B3 — GIA-style cut-grade overlay on ProportionAnalyzer for diamond round-brilliants: per-parameter grades plus a "limiting parameter" callout. * B4 — Carat Estimator: girdle-thickness multiplicative correction (1.00–1.12) on the L×W×D×SG×factor estimate. * B5 — RI Lookup: optional double-reading mode infers birefringence and optic character (SR/DR) and looks up gems by the average RI. * B6 — SG Calculator: water-temperature correction using a NIST-derived ρ_water interpolation table. All new pure logic ships with vitest coverage; full suite is green (245/245), production build passes (912 pages).
…reasoner Adds four new gemmological reasoning widgets backed by pure-TypeScript parsers and reference tables, avoiding a multi-day Python schema migration on the mineral-database package. The same data can later be populated into SQL columns without breaking these widgets. C1 — UV fluorescence lookup (`/tools/lab`): parses the freeform `fluorescence` field for LWUV / SWUV / phosphorescence and ranks candidates by colour and intensity. Surfaces a treatment red flag for chalky SWUV in corundum (heat-treatment indicator). C2 — Spectroscope band-matcher (`/tools/lab`): inverse to the display-only SpectroscopeCalculator. User ticks observed absorption lines on a colour-coded wavelength scale; widget ranks 16 species from a curated reference table (chrome doublet, didymium, almandine 504/527, zircon U-line, peridot triplet, cape diamond N3, etc.). Selective (diagnostic) bands dominate the ranking. C3 — Treatment-detection wizard (`/tools/advanced`): pick the gem kind, tick observed clues (silk halos, chalky SWUV, flash effect, surface bubbles, residue, jadeite acid-etch, HPHT decolourisation, …); evidence weighting produces a ranked likelihood per treatment with positive and negative supporting clues. C4 — Optic-sign / 2V reasoner (`/tools/optical`): user enters polariscope result + ω/ε (uniaxial) or α/β/γ (biaxial); widget computes optic sign, birefringence, and 2V via Mallard's formula, then ranks species whose parsed `optical_character` matches the observation. All four ship with vitest coverage of their pure matchers (parsers, sign rules, scoring functions). 288/288 tests pass; build green.
|
🚀 Preview deployed to: https://d6690cde.gemmology-dev.pages.dev |
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.
Summary
End-to-end execution of the tools-section plan. Three waves bundled in one PR (per-wave branches were not split — all work landed on
feature/tools-wave-c).The site stays purely gemmological — no pricing widgets. All advertising for "price per carat" has been removed from the hub copy.
Wave A — Cleanup (
a31a382)ToolsHub.tsxandtools/conversions.astro.SGCalculatorandCaratEstimatorstack one-per-row at 375 px instead of squeezing./learn/physical-propertiesand/learn/optical-properties.Wave B — Six new widgets (
5837da4, +1677 LoC)/tools/optical/tools/measurement/tools/advanced/tools/measurement/tools/measurement/tools/measurementWave C — Four reasoning widgets (
b350044, +2102 LoC)/tools/labfluorescencefield; flags chalky-SWUV in corundum as heat-treatment indicator/tools/lab/tools/advanced/tools/opticalcos²VzformulaPragmatic data layering: Wave-C widgets reason against the existing freeform DB columns plus TypeScript reference tables, avoiding a multi-day Python schema migration. A future
mineral-databaseschema upgrade can populatefluorescence_lwuv/fluorescence_swuv/absorption_bands_json/optic_signSQL columns without breaking these widgets.Test plan
npx vitest run— 288/288 tests pass across 20 test filesnpm run build— clean build, 912 pagesOut of scope (per plan)