#452 Following a link to a moment shows it on the timeline, scrolled into view
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#452
- pull request
- state:merged
Opening a moment's page, such as `timescale.info/athan/mesopotamia/moments/akkad-falls`, opened the moment's details. Two things were wrong once those were closed, both seen on the live site: - **Off screen:** the page stayed at its top, so the timeline was below the fold. It sat at y≈912 in a 900px-tall window. - **Grouped:** the view kept the timeline's whole span, so "Akkad falls" was counted in a "6 moments" group rather than shown. Now, following a link to an event (a moment or duration page, or a `#moment/…` / `#duration/…` fragment): - **Scroll:** the page scrolls the timeline into view, centred behind the event's details. - **Zoom:** a moment that the view counts in a group is zoomed into, around the moment, until it is drawn on its own. Each step halves the span at least, or shrinks it enough to spread the group's moments twice the grouping distance apart. It works on the server's frames as they arrive, up to 24 steps. It stops for moments sharing the same time, and as soon as the reader pans or zooms. Durations already fit themselves; they now scroll into view as well. **Tests** - New `test/moment-link-live-postgres.mjs` uses a timeline whose description pushes it below the fold, with three moments close together. It checks, at 1280×900 and 390×844: - the timeline is off screen on the plain page; - from the moment's page, the details open and the timeline is in view; - after closing them, the moment and both neighbours are drawn alone, near the middle; - a duration link scrolls too. It's added to CI. - `default-view-live-postgres`, `moderation-live-postgres`, `theme-live-postgres` and the browser suite pass. The unit tests pass, apart from `contents.test`'s known false failure about the local `node_modules` link. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/452
Related
Open #452 Following a link to a moment shows it on the timeline, scrolled into view in the timeline