Repository navigation
Risk bars on the files and lines a High or Medium risk names - #3886
Merged
Merged
Conversation
The risk check now returns places for Medium as well as High (Low none). On a PR's review, each named file gets a three-bar mark before its icon in the file tree, and each named range one at the right edge of its first line in the diff.
… tree's root The diff mark is now drawn by the marked line itself (review-editor's host line marks: CSS in the file's shadow root), 24px at the column's visible right edge in the line's own colour. Wrapped, the line keeps that room free; scrolling, the mark sticks to the edge and adds its width to the line, so the end of the line can be scrolled clear of it. Bars are 2px wide, 2px apart, 6/9/12px tall on whole pixels; Medium's third bar is faint. The tree mark keeps 5px from the icon, and a marked file at the root gives the tree 8px of room so the mark stays in its row.
…ew-editor eagerly
…h (Pierre sets its column variables only with annotations)
The diff's mark is now a real button at the end of the named line (kept by review-editor's hostLineMarks on the file's shadow root), named "High risk: <reason>". Hovering it, focusing it or pressing it opens a card on ui's Popover with what the old risk row said; a press pins it, Escape, a press outside or a second press close it. The header's places stepper opens each place's card. The risk rows under the code are gone.
… clipped inside the diff's shadow root)
…pe only when it is the card's; the bars' name says the rule; HANDOFF for PopoverContent's new props
# Conflicts: # packages/ui/HANDOFF.md
# Conflicts: # tests/dom-test-list.txt
…show only High inline
backnotprop
marked this pull request as ready for review
November 23, 2026 17:23
# Conflicts: # packages/inbox/tsconfig.json
…file is the Inbox's
# Conflicts: # tests/dom-test-list.txt
# Conflicts: # packages/inbox/tsconfig.json
This was referenced Nov 23, 2026
Draft
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.
Approved record: "review-risk-bars" (risk bars in the file tree and the diff), with the owner's later decision q-070bc2a3: "a card on the bars; no row in the diff".
What it does
--destructiveand--warning:data-lead-roomand every row starts 8px further in;Popover(Base UI), anchored to the bars, portaled into the Inbox. Nothing in the diff moves. On a phone it fits the screen (max 320px, 12px from the edges).hostLineMarks.ts,keepHostLineMarks). Its accessible name says what its card says: "High risk: " / "Medium risk: ", and when the place named the person's rule, the rule as the card words it ("High risk · your rule “…”: "). It hasaria-haspopup="dialog"andaria-expanded. Pierre has no slot for an element at a line's end: its line annotations are rows under the line (what this removes), and its gutter utility is one element that follows the hovered line. So the view keeps one button per marked line and puts the same button back each time Pierre draws the line again. A press on it never reaches the diff's line selection. The same CSS as before places it, so it never covers code:@plannotator/ui'sPopoverContentgets a small seam:anchor,collisionPaddingand a portalcontainerpass through. Existing callers are unchanged.packages/ui/HANDOFF.mdhas the entry: backward compatible, and a host needs the next ui version after 0.64.0.Risk prompt, before → after
A high answer adds "where": …→A high or medium answer adds "where": …Low and medium answers have no "where".→A low answer has no "where".Tests
packages/server/inbox-pull-risk.test.ts: Medium keeps places and Low does not. An old Medium result without places loads with no new run.packages/inbox/pulls/riskBars.test.ts: tree files and diff ranges per judgment, each range's reasons (two places on one line share a mark), and the accessible name (with the rule when the place named one). Low, none and no places draw nothing. An off-diff range falls back to the tree mark only. Medium's third bar is faint.packages/inbox/pulls/riskBarsCard.test.tsx, on the real mark buttons in a shadow root: the accessible name; hover opens the card with the old row's words and leaving closes it; keyboard focus opens it and blur closes it; a press pins it, and a second press, Escape and a press outside close it; the stepper opens each place's card in turn; Medium with and without a reason; the card closes when its bars are taken away and none opens on the bars made again, while a line drawn again keeps its card; Escape typed in a comment box reaches the box and leaves the card, Escape from the bars closes it;aria-haspopup/aria-expanded.packages/review-editor/components/hostLineMarks.test.ts: the button lands on the named line on its side in split and unified views; the same button comes back when the line is drawn again; it goes when its mark does; hover, keyboard focus and press reach the host; a press does not reach the line.packages/inbox/guide/pullChangesTreeRisk.test.tsx: the tree mark shows once per named file and not on others, with none when there is no result. A marked root file makes room; one inside a folder does not.tests/e2e/inbox-review-risk-bars.spec.ts(CI only): no overlap on long lines (split and unified, both sides, scrolling and wrapped), and the end of the line is reachable; no risk row in the diff; the card on hover, keyboard focus, press (pinned), second press, outside press and Escape; the stepper opens each place's card; a pinned card whose bars scroll out of the diff closes, and scrolled back no card opens; the card is wholly on screen, on top, and moves nothing; a phone's tap opens it inside the screen. It also checks the tree gap (4–6px) and that rows line up, at the root too, and writes the tone's contrast tocontrast.json. Screenshots inreview-risk-bars/:01-high-card-dark.png,02-medium-card-dark.png,03-closeup-tree-light.png,03-closeup-diff-card-light.png,04-low-no-marks-dark.png,05-long-line-split-card-dark.png,06-long-line-unified-card-dark.png,07-root-file-tree-dark.png,08-phone-card-dark.png,09-scrolled-away-no-card-dark.png(new: the bars scrolled out, no card left floating). To scroll,src/charges/client.tsin the fixture has 80 more unchanged lines; no earlier screenshot shows that file.Typecheck note
packages/inbox/guide/pullChangesTreeRisk.test.tsxstays inpackages/inbox/tsconfig.json'sexclude. It rendersguide/PullChangesTree.tsx, which main already excludes there: through it the strict config reaches review-editor'sReviewStateContextandAllFilesCodeView, which give 48 errors under those settings, none in the test. Taking the test out of the exclude makestsc -p packages/inbox/tsconfig.jsonfail.tsconfig.guide.jsonchecks both files with no errors in them. The reason is now a comment in the tsconfig.