Skip to content

feat(chrome-client): add on-page annotation indicators with bidirectional navigation - #225

Open
songsterq wants to merge 6 commits into
kunchenguid:mainfrom
songsterq:annotation-indicator
Open

feat(chrome-client): add on-page annotation indicators with bidirectional navigation#225
songsterq wants to merge 6 commits into
kunchenguid:mainfrom
songsterq:annotation-indicator

Conversation

@songsterq

@songsterq songsterq commented Aug 8, 2026

Copy link
Copy Markdown

What Changed

  • Adds a small clickable dot marker on every annotated element in the artifact (visible only in annotate mode) and a persistent "sent annotations" list in the Conversation panel that survives for the rest of the session; clicking a dot scrolls to and highlights its panel row, and clicking a panel row scrolls to and flashes the corresponding element (src/artifact-sdk.js, src/chrome-client.js, src/chrome.css).
  • Persists sent annotations server-side: SessionStore.queuePrompts now records non-message annotation prompts into a new session.annotations array (separate from the write-only session.prompts outbox and from session.chat), and normalizePrompt preserves a prompt's id so the client can correlate dots with panel rows; createChromeHtml bootstraps initialAnnotations from stored session state (src/session-store.js, src/server.js).
  • Refactors SDK helper bundling in createSdkJs to serialize src/artifact-sdk.js's own exports automatically via Object.entries instead of a hand-kept list per helper, removing the need to update src/server.js whenever a new SDK-internal helper is added (src/server.js, AGENTS.md doc update).
  • Adds test coverage for the new indicator/navigation behavior (test/annotation-badge.browser.test.js, test/reveal-marker.browser.test.js, plus fixtures) and updates existing unit tests (test/artifact-sdk.test.js, test/chrome-client-queue.test.js, test/server.test.js, test/session-store.test.js, test/cli-version.test.js) and README's Reviewing on a phone/feature list with a new "Annotation indicators" bullet.

Risk Assessment

✅ Low: The change is a well-scoped, additive feature (on-page annotation badges + a durable sent-annotations panel) that follows established repo invariants: badge messages are gated behind the existing artifact_load_token check, the SDK helper-export mechanism keeps the emitted bundle in sync automatically (with a real executing test verifying it resolves), the durable annotation record is only appended on success and exempted from double-recording during prompt restore, and new tests exercise real behavior (a headless-Chrome pinning test, exercised chrome-client message flows, and session-store round trips) rather than asserting on source text.

Testing

All targeted unit tests (475) and the two opt-in real-browser suites for the annotation-indicator feature pass, and a live manual run confirmed the on-page dot appears on an annotated element and its queued pill appears/links in the Conversation panel; the transient click-to-flash-marker animation itself wasn't caught in a still screenshot (timing), but that exact behavior (marker lands on and tracks its element through scroll) is covered and passing in reveal-marker.browser.test.js using real bounding-rect assertions in a headless browser, so it is not left unverified.

  • Evidence: Artifact before annotation (local file: /var/folders/__/bc7f6bmn40z4ddn7crlrmprc0000gn/T/no-mistakes-evidence/01M0PGY40YCWR8JG43AGPDRRSV/01-initial.png)
  • Evidence: On-page dot indicator + queued annotation pill in Conversation panel (local file: /var/folders/__/bc7f6bmn40z4ddn7crlrmprc0000gn/T/no-mistakes-evidence/01M0PGY40YCWR8JG43AGPDRRSV/02-annotated-dot-and-pill.png)
  • Evidence: Clicking the panel pill expands target/prompt detail (local file: /var/folders/__/bc7f6bmn40z4ddn7crlrmprc0000gn/T/no-mistakes-evidence/01M0PGY40YCWR8JG43AGPDRRSV/03-pill-click-flash-marker.png)

Pipeline

Updates from git push no-mistakes

⏭️ **intent** - skipped

✅ No issues found.

🔧 **Rebase** - 6 issues found → auto-fixed ✅
  • ⚠️ src/artifact-sdk.js - merge conflict rebasing onto origin/main
  • ⚠️ src/chrome-client.js - merge conflict rebasing onto origin/main
  • ⚠️ src/server.js - merge conflict rebasing onto origin/main
  • ⚠️ src/session-store.js - merge conflict rebasing onto origin/main
  • ⚠️ test/chrome-client-queue.test.js - merge conflict rebasing onto origin/main
  • ⚠️ test/server.test.js - merge conflict rebasing onto origin/main

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • node --test test/artifact-sdk.test.js test/chrome-client-queue.test.js test/server.test.js test/session-store.test.js
  • LAVISH_AXI_BROWSER_E2E=1 node --test test/annotation-badge.browser.test.js test/reveal-marker.browser.test.js
  • Manual: pnpm run build; ran bin/lavish-axi.js against a demo HTML file; opened the session in a real Chrome tab via chrome-devtools MCP; toggled annotate mode; clicked a paragraph and queued an annotation; verified the on-page dot badge appeared beside the element and the corresponding pill appeared in the Conversation panel; clicked the pill and verified it expanded to show the target selector and prompt text
  • node bin/lavish-axi.js stop (cleanup); rm -rf temp manual test dir; git status confirmed clean worktree
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid

kunchenguid commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch.

When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again.

Noted for lavish-axi#225 at bab0d59f.

@kunchenguid kunchenguid added wheelhouse:pending-contributor-action Managed by Wheelhouse and removed wheelhouse:pending-contributor-action Managed by Wheelhouse labels Aug 9, 2026
@songsterq songsterq changed the title feat: show on-page indicators for annotated elements feat(chrome): show on-page indicators for annotated elements Aug 10, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Holding this. On-page annotation indicators (SDK dots on annotated elements plus a Conversation-panel annotationsSent list) are default chrome UX. I am not auto-merging default chrome appearance while the branch is CONFLICTING/DIRTY, and I am not rebasing.

Required CI is green (no-mistakes + build-and-test). That is not a merge vote on a dirty default-chrome change.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Holding this. On-page annotation dots plus a persistent Conversation-panel list are default chrome UX: they appear for every annotated element without an opt-in. That matches "point at it and be understood," but I cannot auto-merge a default chrome change.

The branch is CONFLICTING with main (5 ahead / 20 behind). I am not rebasing a PR that needs that call, and I am not flagging it while DIRTY. Required CI was green on this head the last time it ran.

This was referenced Aug 20, 2026
@greptile-apps

greptile-apps Bot commented Aug 23, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (3): Last reviewed commit: "no-mistakes: apply CI fixes" | Re-trigger Greptile

Comment thread src/artifact-sdk.js
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

HOLD, waiting on you. Head 4df93bb8 is MERGEABLE after the main merge, and fork CI is approved. The live PR body has the no-mistakes signature but no pipeline attestation (<!-- no-mistakes-pipeline-attestation:v1 ... -->). That gate is blocking. Need a real no-mistakes raise bound to this head.

VISION (inspected src/artifact-sdk.js renderAnnotationBadges / setAnnotationTargets, src/chrome-client.js annotationsSent panel, src/session-store.js session.annotations):

  1. artifact stays the author's: does not align for auto-merge — badges are extra DOM (.lavish-annotation-badge) on resolved elements, so the served artifact is not identical to the file on disk.
  2. interaction beats prose: aligns — a sent annotation stays visible on the page instead of vanishing into a prompt list.
  3. design is chosen, never defaulted: n/a as artifact visual design; the dots are default chrome/SDK chrome, not an author-chosen artifact look.
  4. nothing interrupts the human: aligns for the panel list (no agent wake). The on-page dots are always-on for annotated elements, not an opt-in.
  5. every token on purpose: aligns — no extra agent poll surface.
  6. instructions are the product: cannot tell fully — chrome/README document the indicators; the SDK helper-export iteration is a side change.
  7. scope: aligns — still one person, one agent, one local file.

This is still a default chrome/artifact-badge change. I cannot auto-merge it even after a green raise. I am not flagging that call while no-mistakes is still red. Not waiting on the captain.

Annotated elements previously left no trace in the artifact, so a reviewer had
no way to see what they had already marked up or to navigate between an
annotation and its target.

Sent annotations now persist as a durable session record and render in the
conversation panel, and each annotated element carries a badge in the artifact.
The two surfaces navigate to each other: clicking a badge scrolls to and
highlights the matching panel row, and clicking a panel row scrolls the element
into view and flashes a marker around it.

Notes on two details that are easy to get wrong:

- createSdkJs hand-declares the artifact-sdk.js helpers it inlines into the
  browser bundle. A helper called from createArtifactSdk but missing from that
  list is a silent ReferenceError with no build or type error, so a test now
  asserts every called helper is actually inlined.

- The reveal marker is position:fixed while scrollIntoView settles
  asynchronously under `behavior: "smooth"`, so a rect read in the same tick
  strands the box over the element's old position. The marker re-reads its rect
  on a frame loop for the duration of the pulse instead. A headless-Chrome test
  pins this behaviorally by comparing live rects after the scroll settles and
  again after a later scroll; against the one-shot read it drifts by 1351px.
@songsterq
songsterq force-pushed the annotation-indicator branch from 4df93bb to a6f0a9c Compare August 23, 2026 05:34
@songsterq songsterq changed the title feat(chrome): show on-page indicators for annotated elements feat(chrome-client): add on-page annotation indicators with bidirectional navigation Aug 23, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

HOLD, waiting on you. Head is now a6e21224 (rebase onto main). Fork CI and Guard are approved on that head. The live PR body still has the no-mistakes signature but no pipeline attestation, so the gate cannot go green. The only Require no-mistakes run from this raise is stuck action_required on the previous SHA a6f0a9c4, not this head. Need a real no-mistakes raise whose attestation names a6e21224, then comment; we will approve those runs immediately.

VISION is unchanged: on-page .lavish-annotation-badge dots are extra artifact DOM (served != disk). Conversation-panel list is chrome. This is still a default chrome/artifact-badge change. I cannot auto-merge it even after a green raise. Not waiting on the captain (no-mistakes is still the blocker).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants