#583 Measures: durations count where they start (#576)
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#583
- pull request
- state:merged
Closes #576, the last part of #570. Stacked on #577–#582: until they merge, this diff includes their commits. A duration's measure values count entirely **where it starts**, as if it were a moment at its start. They're never split between windows or counted twice. - **Browser:** - Interval tree nodes keep subtree totals by start. - Collapsed duration summaries carry the totals, and so do the frame groups they become. - Ongoing durations' placeholders take their values out and put them back when resolved (`frameWithOngoing`). - **PostgreSQL:** - `oc_duration_nodes` gains `totals`, and so do the arc and view node tables, which share the spec. `avl.mjs` keeps them up to date. - A duration revalued in place rewrites its path. - `oc_duration_overview` adds the totals of whole subtrees, of single points and of its range-scan shortcut, and returns them. Its view and fork variants follow, and older versions are dropped first. - **Desktop:** collapsed duration summaries add their durations' values per declared measure with `q_sum`. - **Bands:** they keep their measure values whole in every edition. The reader and hover cards show them, and the measure chart counts them at their start. **Tests:** the browser, PostgreSQL and Rust oracles check that each moment's and each collapsed duration's value counts exactly once across a window's groups. They do this through random duration adds, moves, value edits and deletions. Locally, these all pass: `npm test` (apart from `contents.test`), the PostgreSQL tests for durations, ongoing durations, summaries, views, incremental saves and the totals oracle, and the 38 Rust tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/pull/583
Related
- #570 Measures: typed quantities on moments and durations, totalled in every summary
- #576 Measures 5: durations' measures counted where they start
- #577 Measures: declarations, exact values, validation and formats (#572)
- #582 Measures: totals on summaries, values on hover cards, and plugins (#575)
- Merge pull request #583 from openchronology/feat/576-duration-totals
Open #583 Measures: durations count where they start (#576) in the timeline