circagraph
Sign inSign up

openchronology/timeline-app on GitHub

The OpenChronology repository on GitHub, mirrored by och-import-github: issues and pull requests as durations (ongoing while open), what happened to them as moments, plus releases, milestones, commits and branches. The Branches view shows the most recently active branches each in a track of its own.

Source: https://github.com/openchronology/timeline-app

3,131 moments · 2026-10-05 CE 20:21:49 UTC – 2026-11-16 CE 12:10:45 UTC · by @athan · @athan

#322 A stale scroll event no longer closes the timeline menu

–

  • github
  • github/openchronology/timeline-app
  • github/openchronology/timeline-app#322
  • pull request
  • state:merged

Closes #308. **Cause.** This was an app bug, not only a test flake. The timeline menu closed on any `scroll` event (`window.addEventListener('scroll', closeTimelineMenu, true)`). Browsers deliver a scroll's event in the frame after the scroll itself. When a right-click or long press lands just after a scroll, the event for that earlier scroll arrives after the menu has opened and closes it immediately. Instrumenting the test showed exactly this, in 10 of 10 isolated runs: 1. Playwright scrolls the band into view (`scrollY` 0 → 95). 2. It right-clicks at once, and `contextmenu` opens the menu. 3. About 5 ms later, a `scroll` event arrives with `scrollY` still 95 and closes it. A user right-clicking or long-pressing just after a fling could hit the same thing. **Fix** (`src/app.ts`, in the menu code only): - `showTimelineMenu` records the element under the opening point and its position. - A scroll now closes the menu only once that element has moved (by a pixel or more) or left the document. - Real scrolls of the page, or of a dialog the menu belongs to, still close it. **Test** (`test/duration-backgrounds-browser.mjs`): before the existing right-click, the page scrolls and dispatches `contextmenu` on the band in the same frame, waits two frames, and requires the menu to be open. Without the fix it fails, 3 of 3. The existing right-click → Fit in view step follows unchanged. **Evidence** (Playwright 1.58.2 container): - **The duration-backgrounds check on its own:** Chromium 0 failures in 15 runs (10 of 10 failed before the fix); Firefox and WebKit 0 in 3 each. - **The full `test/browser.mjs`:** passes in Chromium (locally it had stopped at this step), Firefox and WebKit. - **`npm test`:** 325 of 325. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/322

Related

Open #322 A stale scroll event no longer closes the timeline menu in the timeline

#322 A stale scroll event no longer closes the timeline menu