Repository navigation
Risk bars: never drawn from a judgment for another commit - #3955
Draft
backnotprop wants to merge 1 commit into
Draft
backnotprop wants to merge 1 commit into
backnotprop wants to merge 1 commit into
Conversation
- The risk answer gives each judgment the head it was made at (the server stamps it from what it kept; the agent sends nothing). The PR page draws a judgment's places (diff marks, tree marks, "N places") only on a diff at that head, so an answer held after a failed risk read is never drawn on a newer push. A judgment with no head (an older server) is drawn as before. - An unchanged line named by its old and its new number is one mark whose card says both: the unified view draws that line as one row. - With a menu open, Escape closes the menu first and the next one the card. - Docs: the risk sections and the API table say the head; the comments that said only High names places now say Medium does too; the diff mark's builder is named by its path.
This branch has not been deployed
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.
Follow-ups from the independent review of #3886 (risk bars and the risk reason card in the Inbox's code review).
1. Old bars on new code. After a push, a failed risk read left the window holding the earlier head's judgment, and its bars were drawn on the new head's diff (the page only compared the diff's head with the list's).
GET /api/inbox/pulls/risk: each judgment now carrieshead, the commit it was made at. The server stamps it from what it already keeps (pull-risk.jsonhas always storedhead). The agent sends nothing, and no words agents read change.riskJudgedAtinpulls/riskBars.ts). Otherwise it draws nothing and shows no new words.headcomes from a server from before this change. Nothing on it says which head it was made for, so it is drawn as before (on a diff at the head the list shows).GET pulls/riskwith an untyped JSON answer.bun scripts/mobile/check.tsandbun scripts/mobile/all.ts --checkare both up to date.2. One bar per row. The unified view draws an unchanged line as one row under both of its numbers. If one place named it by its new number and another by its old number, they made two marks. Only one could be drawn, so the other place's reason was missing from the card and its step opened nothing. They now share one mark (on the new side), and its card lists both reasons. A place that names an unchanged line only by its old number stays where it was.
3. Escape. While a menu is open (a
role="menu"popup, or ui's anchored menus withdata-pn-dismissable-popover), the card no longer takes Escape. The menu closes first, and the next Escape closes the card.4. Nits. The guide's store line (line 233 at the reviewed head) is already right on main. Comments that said only High names places now say Medium does too (
inbox-pull-risk.tsheader,contextNotes/model.ts). The guide names the diff mark's builder by its full path,packages/inbox/pulls/riskBarsMarks.ts. The guide and the Server API table now documenthead.Tests (each fails without its fix)
packages/inbox/pulls/riskBarsHead.test.tsx(new): a push followed by a failed risk read draws no diff marks, tree marks or "N places". A judgment for another head draws nothing. One with no head draws as before.packages/inbox/pulls/riskBars.test.ts: an unchanged line named by both of its numbers is one mark with both reasons, and the stepper finds it either way.packages/inbox/pulls/riskBarsCard.test.tsx: with a menu open, Escape closes the menu first, then the card.packages/server/inbox-pull-risk.test.tsandinbox-pulls.test.ts: the answer's judgments carry their head.