Two scroll probes computed and discarded, kept alive by a comment describing a consumer that is not here
Cleanup I owed after reviewing exp's Stage A: _syncScrollZoomToHost now ends in an unconditional m.scrollZoom.enable(), and docScrolls/ancestorScrolls were function-local consts that nothing could read. ★ THE COMMENT IS WHY THEY SURVIVED, AND IT WAS WRONG. It said they were "still computed because the edge affordance keys its gray indicator off the same question — a map with nothing stacked under it should not advertise a scroll lane". This profile has no such indicator and never calls useEdgeScrollAffordance: its .map-scroll-edge strips are background:transparent lanes, always present. So the comment described a consumer that does not exist here, which is worse than no comment — it makes dead code read as load-bearing, and it is exactly why I checked the affordance before deleting rather than trusting either the code or the note. ★ AND IT CORRECTS ADVICE I GAVE exp-shepherd AN HOUR AGO. I told them to "take its observer with it" because _findScrollportAncestor existed only for this check. It does not: it is also the second ResizeObserver target at :3074, so it stays. My reading was one call site short, and acting on it would have removed a live one. The ResizeObserver itself now re-runs a function that only calls enable(), so it is waste rather than a bug. NOT removed here: teardown behaviour is not something I can test headlessly, and this commit is meant to delete what is provably unread. Also paraphrased the verbatim Driver quote in the same function, per the policy studio applied in L64 — the attribution and the date stay, which is what makes it checkable.
This commit is contained in:
parent
a1460c3ba8
commit
1d6d27d0e0
1 changed files with 13 additions and 11 deletions
|
|
@ -110,15 +110,10 @@ function _findScrollportAncestor(el) {
|
|||
function _syncScrollZoomToHost(m) {
|
||||
if (!m || !m.scrollZoom) return
|
||||
try {
|
||||
const doc = document.documentElement
|
||||
const docScrolls = doc.scrollHeight > window.innerHeight + 4
|
||||
const host = (m.getContainer && m.getContainer()) || null
|
||||
const ancestorScrolls = host ? !!_findScrollportAncestor(host) : false
|
||||
// ★ THE MAP KEEPS THE GESTURE. THE EDGE STRIPS ARE THE WAY PAST IT.
|
||||
// Driver, 2026-09-24: "two finger scrolling on the map should allow me to interact with the
|
||||
// map, but instead it just scrolls down past the map and does not interact with the map —
|
||||
// that's what the scroll side bars are there for, to let me interact with the map AND have a
|
||||
// way to scroll down past the map."
|
||||
// Driver-reported, 2026-09-24: a two-finger scroll over the map scrolled the PAGE past it
|
||||
// instead of interacting with the map, and the side strips exist precisely so a reader can do
|
||||
// both — work the map, and still have a lane to scroll the page down.
|
||||
//
|
||||
// This used to disable scroll-zoom whenever the page or an ancestor could scroll, which is
|
||||
// ALWAYS true in the research-map-plus-grid composite (a map with a grid stacked under it).
|
||||
|
|
@ -135,9 +130,16 @@ function _syncScrollZoomToHost(m) {
|
|||
// non-interactive and left the strips redundant. Two fixes for one bug, and the second one
|
||||
// silently undid the feature.
|
||||
//
|
||||
// So: keep scroll-zoom ON, and let the strips carry the page. `docScrolls`/`ancestorScrolls`
|
||||
// are still computed because the edge affordance below keys its gray indicator off the same
|
||||
// question — a map with nothing stacked under it should not advertise a scroll lane.
|
||||
// So: keep scroll-zoom ON, and let the strips carry the page.
|
||||
//
|
||||
// ★ THE TWO SCROLL PROBES THAT USED TO SIT HERE ARE GONE, AND THE COMMENT THAT KEPT THEM WAS
|
||||
// WRONG. It said docScrolls/ancestorScrolls were still computed because "the edge affordance
|
||||
// keys its gray indicator off the same question". This profile has no such indicator and never
|
||||
// calls useEdgeScrollAffordance: its .map-scroll-edge strips are background:transparent lanes
|
||||
// that are always present (see the rules near the bottom of this stylesheet). They were
|
||||
// function-local consts, computed and discarded — the comment described a consumer that does
|
||||
// not exist here, which is worse than no comment, because it makes dead code look load-bearing.
|
||||
// _findScrollportAncestor STAYS: it is still used to pick a second ResizeObserver target below.
|
||||
m.scrollZoom.enable()
|
||||
} catch (_) { /* an engine without scrollZoom must never break the panel */ }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue