You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(unitpreferences): name the path override in resolved metadata
A resolved displayUnits response reads the same whether the target unit
came from the path or from the active preset, so a client editing the
metadata cannot tell one from the other, and one saving it back cannot
say which fields the path owns.
The response now carries an override object naming the target unit and
display format the path itself chose, empty when the path follows the
preset. A metadata PUT that carries it is taken at its word, which is a
plainer answer than reading an echo by its shape.
Copy file name to clipboardExpand all lines: docs/guides/unitpreferences.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,8 @@ Request the metadata for any path:
116
116
"formula": "value * 1.94384",
117
117
"inverseFormula": "value / 1.94384",
118
118
"symbol": "kn",
119
-
"displayFormat": "0.0"
119
+
"displayFormat": "0.0",
120
+
"override": {}
120
121
}
121
122
}
122
123
```
@@ -129,6 +130,7 @@ The `displayUnits` object provides everything you need to display the value:
129
130
-**inverseFormula**: A Math.js expression to convert back from the display unit to SI (useful for user input).
130
131
-**symbol**: The symbol to display next to the value.
131
132
-**displayFormat**: (Optional) A format pattern for consistency (e.g., "0.0" for one decimal place).
133
+
-**override**: The part of the answer the path itself chose rather than the active preset, as `targetUnit` and `displayFormat`. Empty when the path follows the preset. Display code can ignore this; an editor needs it to tell "knots because this path asks for knots" from "knots because the preset says so". A `PUT` of the whole object is read the same way, so saving a response back does not turn the preset's current choices into a path override.
0 commit comments