Repository navigation
fix(artifacts): clear, name and label code-comment ranges and chips - #23144
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (7 items) — 7 justifiedIntent: a reviewer commenting on code sees the picked range clear after posting, and screen-reader users hear labels that say what the gutter button and thread chips do and mean — FIX.
[FIRST-PRINCIPLES-REVIEWED] 6d0ba30 Description read[DESCRIPTION-READ] 12e6fcfadbcec7bb83a8db5870797cb51adbfc3fc2e03c89e6b2c2604ccd801d That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change is proportionate, it takes nothing away, the new Pierre prop is optional, and four rendered screenshots of this revision are attached. [DESIGN-REVIEWED] 6d0ba30 Description read[DESCRIPTION-READ] 05abf652b164b6ae5192d700d8fdf58db26ba26d58ca7d47e6f07b43b47362d5 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the new chip and gutter-button labels. The new words exist only in hover tooltips ( Evidence gaps
Notes
[UX-REVIEWED] 6d0ba30 Description read[DESCRIPTION-READ] 5fb01f28f3cf33d7dde5ee090bf93b7f96dca6871e1f3bce7c0af9e718df6631 That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Follow-ups from #8360's review for line-anchored code comments: - Clear the picked line range once its comment posts. CodeBlock now controls Pierre's selection (`selectedLines`); the artifact page tells the block which lines its last successful post was made on. - Name the range on the gutter button: "Comment on lines 3-5" in its tooltip and aria-label when a multi-line range is selected. - Say what a chip's fill means: "Comment thread (2, unread)" or "Comment thread (1, selected)"; a read, unselected thread keeps the plain label. The sidebar jump for code threads already shipped in #8360. The keyboard path is left for a separate change. Part of #22402
2677143 to
6d0ba30
Compare
|
Problem / Motivation
Goal: On an artifact page, a code-block comment range clears once its comment posts, and the gutter button and thread chips say in words what they do and mean.
Three follow-ups from the review of #8360 (line-anchored comments on code blocks):
Why it matters
Reviewers who comment on code see a stale shading after every post. Screen-reader users hear the same label for one line and for a range, and cannot tell an unread thread from a read one.
Not a goal
What changed (motivation → approach → change)
CodeBlock(website/src/components/CodeBlock.tsx) now controls Pierre's selection (selectedLines, passed throughPierreCodeinwebsite/src/pierre/index.tsxandPierreCodeImplinwebsite/src/pierre/PierreImpl.tsx). The page's composer (website/src/pages/useArtifactDetailPageComments.ts) records the anchor of each post that succeeds.website/src/pages/ArtifactDetailPageBody.tsxmaps it to a fence and lines (postedCodeRangeinwebsite/src/components/codeComments.ts). That block clears its range only if it is still those lines. A refused post, a kept draft, or someone else's comment clears nothing.components.codeBlockin everywebsite/src/i18n/locales/*.json;en-XAregenerated.Backwards compatibility
Compatible: the new
PierreCodeprop is optional, and surfaces that do not pass it keep Pierre's own selection.Removes nothing: only labels gain words and a selection is cleared after a successful post.
Tests
CodeBlock.comments.test.tsx: chip label says unread / selected / neither; gutter button names a selected range; the block hands Pierre a controlled selection and clears it only for a post on its own block and its own lines.ArtifactDetailPage.codeComments.test.tsx: on the real page, a picked range clears once its post succeeds, and stays when the post is refused.codeComments.test.ts:postedCodeRangemaps a code post to its fence and lines, and returns null for a prose post.origin/main's sources and pass here.Manual verification
Real browser (Chromium,
website/scripts/capture-artifact-code-comments.mjswith extra checks), both themes: unread chip label, gutter label "Comment on lines 3–5", range shaded before posting and cleared after. All checks passed.Screenshots / video
Range picked, gutter button on line 5 (dark):
After posting: shading cleared, new chip under line 5 (dark):
Light theme
Related Issues
Part of #22402
Keyboard follow-up: #23156
Pattern harvest
Not generalizable: each item is a missing label or a missing reset on one new surface, not a repeated code shape.
Checklist