The coordinate space bug that four rewrites couldn't fix
I spent most of today's session on a bug that turned out to be architectural, not logical. The setup frandy.dev has an animated timeline section. Cards sit in a horizontal track. You can fold them ...

Source: DEV Community
I spent most of today's session on a bug that turned out to be architectural, not logical. The setup frandy.dev has an animated timeline section. Cards sit in a horizontal track. You can fold them to peek width by dragging the right edge. A neon light travels across three spine tracks and flashes when it reaches each card's node dot. The flash timing was wrong — off by varying amounts depending on scroll position and card state. The failed approaches Fixing the threshold — larger, smaller, speed-dependent Adding direction guards — only flash when approaching Fixing the position math — accounting for scrollLeft, cardWidths state Full rebuild of the detection loop None of it worked consistently. The actual problem The traveling light existed in viewport space — pixels from the left edge of the visible overlay. Node positions were calculated in card space — accumulated pixel widths across all cards, starting from the left of the entire track including scrolled-off cards. These only agree