Measures: presentation and parsing per measure, and editor fields (#573)
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
Each measure has its own printer and parser, the counterpart of the time display (src/measure-presentation.ts), exact both ways: - Modes: exact (the default), fixed decimals (money: 123456 cents shown as $1,234.56 with scale 1/100), significant digits, scientific and SI prefixes; each with a scale (shown = stored × scale), prefix, unit and thousands separators. - Purposes: values and totals as shown, inputs exact (so unchanged text keeps its value), tooltips with the exact value where a label rounds, axes abbreviated ($1.23M). - Parsing accepts the prefix, unit and commas, and refuses what it would round: more decimal places than a fixed measure shows, or a whole-number measure's value that isn't a whole number of its steps. In the editor (src/measure-ui.ts): - A Measures dialog (toolbar, or Tools on a phone): label, name, type and presentation per measure, with an example, and what saving will do to values. Adding, restyling and widening are settings edits undone like others; renaming, removing and narrowing rewrite values in the page as one Undo, in a large desktop file's store, or on the server through POST /measures. - The moment and duration forms have a field per measure, typed as shown and stored exactly; the form shows the parser's reason when it refuses. - The reader lists an event's values as each measure shows them. Docs, OpenAPI (MeasurePresentation), unit tests and a browser check (in the browser suite). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/commit/917eaf14a7a14bc52810735bb2053a1bfc97d5b6
Related
Open Measures: presentation and parsing per measure, and editor fields (#573) in the timeline