0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/docs/screenshots/browser-annotations
fate b7942ee8bd
Browser element annotations (#814)
* Add browser element annotations

The browser toolbar gets an annotate button. Click an element on the page and
it lands in the composer as an "Annotation N" chip, with a numbered outline on
the page that follows scroll until the chip is removed or sent. Harnesses get
each element as plain text (selector, path, box, styles, HTML), so it works with
models that can't read images.

Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Browser annotations: Zeron-styled picker, chip hover points at the page, harden page input

The in-page picker now takes the app's theme (accent, popover surface,
border, text, UI font) and reads as Zeron chrome in light and dark:

- The hovered element's outline follows its corner radius, and its label is a
  popover pill (icon well, tag, #id.class, w × h) rather than an accent block.
- A hint pill names the mode and its keys (Shift adds more, Esc is done),
  counts Shift-picks, and moves out of the way near the bottom of the page.
- Markers keep a chip-numbered badge that stays inside the viewport. Hovering
  a chip in the composer highlights its element on the page.
- The chip uses the toolbar's annotate glyph, and its hover card shows the
  element and size above the code.

Page script runs in the same world as the picker, so its output is now
treated as untrusted:

- Synthetic events never pick, and the picker object is frozen once defined.
- A session takes at most 24 picks, and ends on an explicit `gone` (or a run
  of unreadable polls) rather than on any non-string script result.
- Credentials in URLs (userinfo, token/code/state/sig… query and fragment
  keys) and opaque attribute values (JWTs, long base64) are redacted.
- Page text cannot close </annotation> or </browser_annotations> in any case.

Also rebased onto main: chat chips gain the annotation field, and the
fixture uses the current serve_ipc. ZERON_FIXTURE_LIGHT=1 shows light mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Browser annotations: numbers live in the outline, chips use a plain pointer glyph

The in-page markers wore their number as a circle stuck on top of the
outline, off-centre, and the outline drew right over the element's own
border.

- Outlines sit 2px outside the element and round like it, so they never
  double its border.
- A picked element's number is a tab cut into the outline's top-left corner,
  sharing its radius. An element too small to hold one wears it as a flag on
  its top edge. Numbers are centred with flex, not line-height.
- The hover label is the same accent flag, growing out of the outline's top
  edge (or hanging inside near the viewport top).
- A hovered chip deepens its element's fill instead of a soft glow, and the
  hint is a plain popover pill with a status dot.

The annotation chip's glyph was `cursor-square`, a framed icon that read as a
box inside the chip's well. It is now `cursor`, the pointer alone at the same
stroke weight as the other chip glyphs. The fixture seeds files to @-mention,
so file chips can be compared side by side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Browser annotations: square the labelled corner, flush-left labels, lighter hint

Every outline's top-left corner carries its label (the hover flag, a
marker's tab or a small element's flag), so it keeps a 2px radius while the
other corners follow the element, and labels sit flush against the
outline's left edge instead of starting after its curve.

The hint drops its keycap boxes and the tiny ⇧ glyph for inline text:
"Select an element | Shift-click to add · Esc to finish".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Browser annotations: round a label's corners where they hang free

A label wider than its outline (or pushed left of it by the viewport edge)
rounds the corner that hangs past the outline, and the outline's top-right
corner squares off under it so its edge runs straight up into the label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

---------

Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
Co-authored-by: Wing <44917547+wingleeio@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
History 2026-10-27 04:34:57 +00:00
..
after-chip-hover-light.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-chip-hover.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-composer-chips.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-hint-light.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-hint.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-markers-detail.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-picking.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-shift-picking-light.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-shift-picking.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
after-wide-label-corner.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
before-chip-hover.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
before-markers-detail.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00
before-picking.png Browser element annotations (#814) 2026-10-27 04:34:57 +00:00