#270 · Durations that overlap never share a row beneath the axis (#269)
- timeline-app
- pull request
- sharing
Closes #269. Durations beneath the axis took their rows from their position in the window's list (`i % 3` in `renderDurationBands`), not from when they run. The first and fourth always shared a row. In your view, the **Second Battle of Fallujah** coming into view made the **Iraq War** draw over the **War in Afghanistan**, and rows jumped as durations came and went. - `durationLanes` (`src/durations.ts`, exported through core) packs bands by time: sorted by start, longer first on ties, each takes the first row whose bands have all ended by its start. Overlapping durations never share a row. A band starting where another ends reuses its row, and the rows don't depend on the order the server lists them. - A comparison's timelines are packed separately, each under its own axis. - The rows are still 13 px apart, with no limit of three. Tests: a unit test with the four durations from your screenshots (the two wars and the two battles of Fallujah) checks that overlapping ones never share a row, that any order gives the same rows, that a finished row is reused, and that comparison groups pack apart. `npm test` (305) passes, and `test/browser.mjs` (with its duration-backgrounds check) passes in Chromium.
Sources
Open #270 · Durations that overlap never share a row beneath the axis (#269) in the timeline