---
title: "A red circle should move with the page"
date: 2026-11-23
summary: "A feedback stroke anchored to an element can follow the thing it points at. The trick is to keep scrolling, drawing and sending separate."
tags: ["interfaces", "annotations", "web"]
url: https://blog.misherate.com/posts/a-red-circle-should-move-with-the-page
thumbnail: https://blog.misherate.com/thumbnails/a-red-circle-should-move-with-the-page-mwtseqw7.jpg
---

On [iterate](https://iterate.com), a mind is the code it runs, the pages it serves, and the event streams that connect them. We wanted to send that mind a red circle around part of a page without turning the page into a screenshot.

Take an animal card with a title covering the best bit of the photo. “Move this” is a perfectly good note if you can draw an arrow. It's a dreadful note if the reader has to guess what *this* is. On [Super Stats](/introducing/super-stats) and [the blog](/introducing/blog), you could already [select text and get a private feedback receipt](/posts/a-feedback-note-deserves-a-receipt). But you can't select the awkward gap under a picture. And a circle drawn at a fixed spot on a screen becomes a circle around nothing as soon as you scroll.

## The ink belongs to an element

At the end of a stroke, the widget finds a centre weighted by segment length, then identifies the element beneath it. It saves a selector and writes each point as a fraction of that element's rectangle. It also samples the elements touched along the stroke. Those selectors give the note more context when the ink crosses a boundary; they don't each control a piece of the line. One rectangle controls the whole mark. Here's the geometry, simplified:

```ts
type Point = [number, number];

function anchor(points: Point[], target: Element) {
  const r = target.getBoundingClientRect();
  if (!r.width || !r.height) return null;
  return points.map(([x, y]) => [
    (x - r.left) / r.width,
    (y - r.top) / r.height,
  ] as Point);
}

function replay(points: Point[], target: Element, overlay: SVGElement) {
  const r = target.getBoundingClientRect();
  const origin = overlay.getBoundingClientRect();
  return points.map(([x, y]) => [
    r.left + x * r.width - origin.left,
    r.top + y * r.height - origin.top,
  ]);
}
```

A point can fall outside the rectangle. That's useful: an arrow can start in the margin and end on a title. The original pathname keeps it off other pages; an absent or invisible target keeps it from floating over the wrong thing. The thread is still available from the feedback menu. This is a cheap way to survive scrolling and ordinary resizing, not a way to recognise the same detail after a redesign. If a selector resolves to a different element, or the contents of that element reflow substantially, the ink can still land in the wrong place.

## A phone swipe is usually a scroll

Leaving drawing mode on shouldn't make an article unreadable. A quick tap arms the next drag for 250 milliseconds, so swipes without the tap can still scroll. While the stroke is live, pointer moves collect bounded points and schedule an update to one existing SVG polyline. Hit testing and rebuilding saved highlights wait until the stroke is over. A Chromium check at two phone widths recorded no hit tests, rectangle reads or new SVG elements during a 20-move stroke.

Two browser details made the first pass less portable than it looked. A native popover sits in the browser's top layer: raising the regular overlay's stacking order won't bring the ink or the input in front of it. The widget now brings its overlay into the active top-layer UI and checks a short heading fingerprint when a popover reuses the same element for different content. And when the keyboard pans the view, a fixed overlay needn't start at viewport coordinate zero. Subtracting the measured overlay origin fixes that offset; the live stroke caches it rather than measuring on every move. The input is focused directly from the finishing gesture. We checked focus and simulated displacement in Chromium, not keyboard movement on physical iOS hardware.

## Drawing isn't sending

A finished stroke opens a composer, not a new agent. With Batch on, even pressing Enter just saves the note and its anchor in a browser-local outbox. Send submits the notes individually through the existing member-only routes. If a response goes missing, the queue stops there; retry uses the same payload and a request key the server scopes to the member and host. That makes a retry safe without pretending a batch is one transaction.

The useful split is between the geometry and the conversation. The drawing tells the mind where to look. The note says what to do. If the drawing no longer fits the page, the note and its receipt are still there.
