#539 Let a duration end "now", while it is ongoing (#537, stage 1)
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#539
- pull request
- state:merged
Stage 1 of #537: ongoing durations in the core model and the browser. ## What changes - **Model.** A duration's end may be `{"ongoing": true}`, meaning the current time. A start cannot be ongoing. - **Validation.** Only timelines with the Gregorian time display have a "now", so all others refuse ongoing ends. Partial saves carry no settings, so they skip this check. - **Resolution.** `resolveDuration(duration, timeOf, now)` gives an ongoing end as `max(start, now)`. Without `now` it gives a point at the start: the placeholder the persisted trees will hold. - **Browser index.** `TimelineIndex` keeps ongoing durations beside its interval tree and resolves them at its `clock` for each frame. `withOngoing` and `summariesWithOngoing` merge them into the window's longest-first ranking, its counts and its collapsed summaries, so the result matches what the tree would give if it could hold them. The server will reuse both in stage 2. - **Drawing and dialog.** - Bands fade out where "now" is in view, and times read "… – now". - The view redraws every 15 seconds while an ongoing band is shown. - The duration dialog offers **Ongoing (until now)** for an end. - **Server.** It refuses ongoing ends with a 400 until stage 2 teaches its SQL window and summary queries about them. The design is in [this comment](https://github.com/openchronology/timeline-app/issues/537#issuecomment-6725362009). ## Tests - `test/ongoing-durations.test.mjs` covers validation, the "now" mapping, resolution, frames growing with the clock, collapsed summaries, and merging with truncation. - `npm test` passes apart from `contents.test.mjs`, which fails locally with git `ENOBUFS` from untracked worktrees. CI runs it cleanly. - There is no browser test for the dialog yet. ## Not yet - **Stage 2:** server storage and queries, saved views, and the API and OpenAPI. - **Stage 3:** the SQLite native store and `och-convert`. Until then, saving an ongoing duration to a desktop `.och` file is not supported. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/539
Related
- #537 Ongoing durations: an end that is "now"
- #540 Save ongoing durations on the server and resolve them at its clock (#537, stage 2)
- #541 Hold ongoing durations in desktop files, ending at the app's clock (#537, stage 3)
- #542 Mirror GitHub issues and pull requests into timelines (#538)
- Merge pull request #539 from openchronology/feature/ongoing-durations
Open #539 Let a duration end "now", while it is ongoing (#537, stage 1) in the timeline