Skip to content

feat(ui): bring the one-click thumbs-up back to the HTML pinpoint composer - #1712

Merged
backnotprop merged 2 commits into
mainfrom
feat/pinpoint-thumbs-up
Oct 5, 2026
Merged

backnotprop merged 2 commits into
mainfrom
feat/pinpoint-thumbs-up

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Why

On raw-HTML and live-app sessions, clicking an element (pinpoint) opens the comment composer directly. It never shows the selection toolbar, which is where the remaining 👍 lives. #1693 removed the composer's "Looks good" button, so since then a reviewer could not mark an element "looks good" in one click. The 👍 was redundant for text selections, not for pinpoint.

What changes

  • The pinpoint composer gets back a one-click 👍, now as a small emoji-only button beside Save. There is no "Looks good" text on screen; the button's accessible name and tooltip are "Looks good". It uses the same green hover tint as the toolbar's 👍 and a focus-visible ring.
  • It is disabled (faded and greyed) once anything is typed or attached, so a click can never throw away a draft.
  • It has no keyboard shortcut. Mod+Enter still saves the typed comment.
  • It creates exactly what the toolbar's 👍 creates: a THUMBS_UP_LABEL quick-label COMMENT on the pinned element, with its anchor, element context and any shift-click extra targets (same host cap). It goes through the same commit path as a typed comment, so drafts, export and markers behave the same.
  • Markdown and global composers are unchanged (they do not pass the prop). The comment-only clamp is unchanged; no DELETION can be created.

Hosts (@plannotator/ui)

The removal in #1693 never shipped in a ui release (0.50.0 predates it). This PR restores CommentPopover's onQuickLookGood and useHtmlAnnotation's handleCommentLooksGood with their old contract, and HtmlViewer passes it again, so hosts see no API change compared to 0.32.0 through 0.50.0. Only the button's look changed. packages/ui/HANDOFF.md is rewritten to say this.

Tests

  • htmlPinpointProtocol.test.tsx: clicking the composer 👍 after a pinpoint creates one quick-label COMMENT with the pinned anchor and element context and closes the composer; Mod+Enter on an empty composer creates nothing, and after typing it saves the typed comment (not a label) while the 👍 is disabled; the 👍 carries shift-click targets under the host cap.
  • CommentPopover.multiTarget.test.tsx: without onQuickLookGood no 👍 renders; with it, a click fires the callback.
  • Both files were already in DOM_TESTS.

Checked in the browser

Built (bun run --cwd apps/review build && bun run build:hook) and ran plannotator annotate page.html with a temp data dir and HOME, in headless Chromium (--use-mock-keychain --password-store=basic), light and dark:

  • Pinpointing the "Get Pro" button opens the composer with the 👍 left of Save (target chip "Button Get Pro" above the textarea). The button reports aria-label="Looks good", title="Looks good", text 👍.
  • Typing disables it; clearing the text enables it again.
  • Clicking it closes the composer, places marker 1 on the button, the header count goes to 1, and the annotations panel lists a Comment on "Get Pro" reading "Looks good".

Screenshots taken locally: composer close-up (hovered, green tint) in light and dark, the composer in the page, and the page after the click with the marker and the annotations panel open.

…poser

A pinpoint click on an HTML / live-app element opens the comment composer
directly and never shows the selection toolbar, so after #1693 removed the
composer's "Looks good" an element could not get a one-click thumbs-up.

- CommentPopover: onQuickLookGood is back with its old contract (optional,
  absent renders nothing, disabled once anything is typed or attached), now
  as an emoji-only 👍 button beside Save: aria-label and tooltip "Looks good",
  the toolbar 👍's green hover tint, a focus-visible ring. No key binding;
  Mod+Enter still saves the typed comment.
- useHtmlAnnotation: handleCommentLooksGood is back, sharing one commit path
  with handleCommentSubmit (commitComposerDraft), so the 👍 is the toolbar's
  THUMBS_UP_LABEL quick-label COMMENT on the pinned element with its anchor,
  element context and shift-click extra targets. HtmlViewer passes it again.
- The removal never shipped in a ui release, so hosts see no API change;
  HANDOFF.md is rewritten to say so. AGENTS.md describes the composer 👍.
- Tests: the composer 👍 labels the pinned element (anchor, context, closes);
  Mod+Enter still saves a typed comment and an empty Mod+Enter creates
  nothing; the 👍 respects the host target cap; an absent prop renders none.
…after the 👍

- The 👍 button's disabled grey-out is now an inline filter instead of a
  Tailwind grayscale utility. That utility was the only class new to the
  pinned guides.show viewer CSS (CommentPopover.tsx is scanned into it), so
  the viewer bundle and guide-viewer-manifest stay byte-identical to main:
  build:viewer + check:manifest report in sync, no guides.show deploy.
- A 👍 click now goes through the same tail as Save: it clears the draftKey
  draft and calls restoreOpeningFocus. New DOM test: focus returns to the
  opener (fails without the restore).
- HtmlViewer comment notes the button also shows when the composer opens
  from a text selection (a harmless duplicate of the toolbar 👍).
- HANDOFF.md notes the focus restore and the viewer-CSS constraint.
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.

1 participant