Repository navigation
feat(ui): bring the one-click thumbs-up back to the HTML pinpoint composer - #1712
Merged
Merged
Conversation
…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.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
THUMBS_UP_LABELquick-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.Hosts (
@plannotator/ui)The removal in #1693 never shipped in a ui release (0.50.0 predates it). This PR restores
CommentPopover'sonQuickLookGoodanduseHtmlAnnotation'shandleCommentLooksGoodwith their old contract, andHtmlViewerpasses 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.mdis 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: withoutonQuickLookGoodno 👍 renders; with it, a click fires the callback.DOM_TESTS.Checked in the browser
Built (
bun run --cwd apps/review build && bun run build:hook) and ranplannotator annotate page.htmlwith a temp data dir and HOME, in headless Chromium (--use-mock-keychain --password-store=basic), light and dark:aria-label="Looks good",title="Looks good", text👍.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.