Add the mass and area conversion groups - #580
Closed
mairas wants to merge 1 commit into
Closed
Conversation
getConversionsForPath filters the conversion list for a group holding the path's SI unit, and no group held kg or m2, so a displacement or a sail area degraded to unitless even for its identity target. Add both groups with the pound and square-foot targets the server presets ask for. Fixes #570
Contributor
Author
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.
Why
getConversionsForPathfilters_conversionListfor a group containing a measure equal to the path's SI unit. No group containedkgorm2, so the filter came back empty and the path degraded tounitless— even for the identity target, and on every preset including metric.design.displacementand a sail area rendered a raw number with no label.This was split out of the #536 fix, which could not complete these two categories because the gap is not an alias: Skip had no conversion group for them at all.
What
kgkg,lbsm2m2,sqftPlus the matching
unitConversionFunctionsentries (js-quantities handleskg -> lbsandm^2 -> ft^2), and one alias — the server preset names its imperial mass targetpound, following the same shape as the existingfoot: 'feet'.sqftneeds none; the server's target name and Skip's measure agree.skBaseUnitsalready listed bothkg(Mass) andm2(Area) as valid Signal K units, so the type surface expected them; only the conversion table was missing.The two categories move out of the "deliberately absent" notes in both
SERVER_TARGET_UNIT_ALIASESand the spec's preset-vocabulary table, and into the table itself as four new rows.src/assets/skip-dashboard-schema.jsonis the regenerated artifact (npm run gen:mcp-schema).Tests
Three added, plus the four new vocabulary rows. All four cases fail without the groups (the existing preset-vocabulary test included).
Full suite: 2039 passing.
Fixes #570