From 31671f5791403cad1e8224d6e50582a54b9a1507 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 7 Mar 2026 07:13:07 +0000 Subject: [PATCH] sidebar fixes --- calculators_list.md | 40 +++++++++---------- hdyc-svelte/src/lib/components/Sidebar.svelte | 24 ++++++----- hdyc-svelte/src/lib/data/calculators.ts | 20 ++++++++++ 3 files changed, 54 insertions(+), 30 deletions(-) diff --git a/calculators_list.md b/calculators_list.md index 5f37f03..7dcd9c5 100644 --- a/calculators_list.md +++ b/calculators_list.md @@ -584,27 +584,27 @@ Whenever a new calculator is published via the REST API, it must be appended her - [ ] Fahrenheit to Newton (temp scale) - [ ] Fahrenheit to Rankine - [ ] Farads to Microfarads -- [ ] Fathoms to Feet -- [ ] Fathoms to Meters +- [x] Fathoms to Feet +- [x] Fathoms to Meters - [ ] Feet of seawater to PSI -- [ ] Feet of Water to Atmosphere -- [ ] Feet of Water to PSI -- [ ] Feet per second to Kilometers per hour -- [ ] Feet per second to Miles per hour -- [ ] Feet to Centimeters -- [ ] Feet to Fathoms -- [ ] Feet to Inches -- [ ] Feet to Kilometers -- [ ] Feet to Miles -- [ ] Feet to Millimeters -- [ ] Feet to Yards -- [ ] Femtograms to Picograms -- [ ] Fermi to Meters -- [ ] Fluid Ounces to Cups -- [ ] Fluid Ounces to Gallons -- [ ] Fluid Ounces to Liters -- [ ] Fluid Ounces to Tablespoons -- [ ] Fluid Ounces to Teaspoons +- [x] Feet of Water to Atmosphere +- [x] Feet of Water to PSI +- [x] Feet per second to Kilometers per hour +- [x] Feet per second to Miles per hour +- [x] Feet to Centimeters +- [x] Feet to Fathoms +- [x] Feet to Inches +- [x] Feet to Kilometers +- [x] Feet to Miles +- [x] Feet to Millimeters +- [x] Feet to Yards +- [x] Femtograms to Picograms +- [x] Fermi to Meters +- [x] Fluid Ounces to Cups +- [x] Fluid Ounces to Gallons +- [x] Fluid Ounces to Liters +- [x] Fluid Ounces to Tablespoons +- [x] Fluid Ounces to Teaspoons - [ ] Focal length to Angle of view - [ ] Foot-candles to Lux - [ ] Foot-pounds (energy) to Joules diff --git a/hdyc-svelte/src/lib/components/Sidebar.svelte b/hdyc-svelte/src/lib/components/Sidebar.svelte index 1b7461a..2585401 100644 --- a/hdyc-svelte/src/lib/components/Sidebar.svelte +++ b/hdyc-svelte/src/lib/components/Sidebar.svelte @@ -17,20 +17,21 @@ const calcs = getCalculatorsByCategory(key); calcs.forEach(calc => { - const unit = calc.labels.in1; - const existing = buckets.get(unit); - if (existing) { - existing.push(calc); - } else { - buckets.set(unit, [calc]); - } + [calc.labels.in1, calc.labels.in2].forEach(unit => { + const existing = buckets.get(unit); + if (existing) { + existing.push(calc); + } else { + buckets.set(unit, [calc]); + } + }); }); const units = [...buckets.entries()] .sort(([a], [b]) => a.localeCompare(b)) .map(([label, conversions]) => ({ label, - conversions: conversions.slice().sort((a, b) => a.labels.in2.localeCompare(b.labels.in2)), + conversions: conversions.slice().sort((a, b) => a.name.localeCompare(b.name)), })); return { key, meta, units }; @@ -116,13 +117,16 @@