#272 · Fit a duration in the view, from its menu or its details (#268)
- timeline-app
- pull request
Closes #268. - **Right-click (or long-press) a duration:** the menu now offers **Fit in view** to anyone who can see the duration, not only editors. - **The duration's details panel and the read-only reader** both get a **Fit in view** button beside Share. - **The view** spans the duration with the same margin as **Fit all** (`Viewport.fit`: 40 % beyond its length, split between both sides). `fitDuration` looks for the duration's band in the current window first, including a comparison's, then in the document. It does nothing for a duration it can't find. ## Tests - `test/duration-backgrounds-browser.mjs`: right-click the 100–200 duration, choose **Fit in view**, and the view spans 80–220, give or take the rounding to whole pixels. - `test/summaries-browser.mjs`: the duration menu's item list includes **Fit in view**. - `npm test` passes. `test/browser.mjs` passes in Chromium and Firefox. In WebKit it hit the known flaky drafts check (#271) before reaching these tests.
Sources
Open #272 · Fit a duration in the view, from its menu or its details (#268) in the timeline