Browser Annotate
Annotate lets the reader mark up a page in a Browser tab and hand the marks to the agent as one message. It follows the Annotate and Adjust tools of the Codex app's browser: point at what is wrong, say what should change, optionally try a size, spacing or colour on the live page, then send.
| Part | Behaviour |
|---|---|
| Button | Solar pen in the address pill, left of the bookmark star; accent-tinted while the page is in annotate mode. Clicking it again leaves the mode. |
| Mode | A dark pill at the top centre: "Click an element or drag a box · Esc to finish". The element under the pointer is outlined; the page gets no clicks. |
| Element note | A click gives the element a solid accent outline, a numbered pin at its top-right corner and a card beside it: monospace short selector (h1#firstHeading), a text field, Delete. Clicking an element that already has a note opens that note. |
| Region note | A drag of at least 8 px draws a dashed accent box; its card header reads region 312×100. |
| Adjust | Folded under an Adjust row in an element card: Size (font size), Spacing (padding), Color. Moving a control previews it on the element as an inline style; the changed values join that note. |
| Bar | Bottom centre while notes exist: "N notes on this page", Discard, Send to chat. |
| Esc | Leaves the mode; unsent notes, pins and the bar stay until Discard or Send. With the mode off, Esc closes an open card. |
| Send | One user message: the page, then each note by number with its selector or region, the text and any Adjust values (font-size 28px → 34px), plus a screenshot of the page with the pins. Then the notes and preview styles are cleared and the mode ends. |
| Discard | Removes every note and every preview style, and ends the mode. |
| Navigation | A new address clears the notes. Leaving the tab only ends the mode. |
Decisions
| Decision | Reason |
|---|---|
| The overlay runs inside the page, in an isolated world, in a closed shadow root | The desktop page is a native view the App window cannot draw over, so outlines and cards have to be in the page. The isolated world keeps the page's scripts from seeing or calling it; the shadow root and !important host styles keep the page's CSS from restyling it. It shares the world of the element and region pickers, so starting one ends the other. |
| The App passes its own colours | The cards take --bg-primary, --border-light, --text-primary, --text-muted and --accent-blue from the window when the mode starts, so they look like the App in every theme. The host passes only short colour values under known keys. |
| Pins stay in the screenshot | Before the capture the cards, hint and bar hide for two frames; the outlines and numbers stay, so the picture and the numbered list line up. |
| The message is sent, not drafted | Send to chat is the end of the task; the message goes through the conversation's send queue, so it waits its turn when a run is going. |
| The page's own conversation first | Notes go to the conversation whose agent opened the tab, else the one in focus, else the last one; only an open conversation counts. With none, a tip asks for one and the notes stay. |
| Adjust previews with inline styles | An inline !important declaration on the element itself wins over the page's rules and is exactly what has to be undone; the element's own inline values come back on Send, Delete or Discard. |
| Short selectors | At most four levels, stopping at an id or as soon as the selector is unique; generated class names are skipped. The agent gets something it can search the source for. |
| Not in the browser fallback | The web UI shows pages in an iframe of another origin, which it may not script. The button stays in place, unavailable, and its tip says annotating needs the desktop App. |
Code and verification
| Item | Where |
|---|---|
| Overlay | apps/desktop/main/web-views/annotate-overlay.js |
| Host loop and screenshot | apps/desktop/main/web-views/webtab-annotate.js, IPC webtab:annotate and webtab:annotate-event |
| Button and send | apps/web/components/center-tabs/browser/toolbar/annotate-button.tsx, pane/use-page-annotate.ts |
| Message | apps/web/lib/browser/capture/annotate.ts |
| Tests | apps/web/tests/browser/annotate.test.mjs (selectors, message, overlay flows), apps/desktop/tests/web-views/check-webtab-annotate.js (commands, loop, send) |
Implementation status
Implemented in the desktop App. The browser fallback has no annotate mode.
Last updated · 2026-11-25