reviews: classify the current attachment, not historical events#48
Merged
Conversation
autoAssigned previously used some(...) over the full timeline, so a CODEOWNERS auto-attach that was removed and later replaced by a manual re-request would still come back as auto. Walk the timeline, track the latest review_requested per reviewer/team minus any review_request_removed that supersedes it, and classify only that "current attachment". Also: scope tag for the `f` shortcut in the help overlay.
There was a problem hiding this comment.
Pull request overview
This PR refines how the server determines whether a review request was auto-attached (CODEOWNERS-style) by classifying only the current review-request attachment state (accounting for removals/re-adds), and it updates the keyboard-shortcut help text to accurately reflect scope.
Changes:
- Server: compute
autoAssignedfrom the latest non-removedreview_requestedevent per reviewer/team (instead of scanning historical events). - Server tests: add coverage for remove + re-request scenarios for both direct reviewer requests and team requests.
- Web UI: clarify that the
fshortcut applies only within the Reviews column.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/web/src/components/ShortcutHelp.tsx | Updates shortcut help text to reflect that f is scoped to the Reviews column. |
| packages/server/src/fetchers.ts | Tracks current review-request attachment per reviewer/team when computing autoAssigned. |
| packages/server/src/fetchers.integration.test.ts | Adds integration tests for removed-and-readded review request scenarios (direct + team). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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-up to #44 addressing two Copilot review comments left after merge.
1. autoAssigned should reflect the current attachment
Comment on
fetchers.ts:Walk the timeline in chronological order and track the latest
review_requestedevent per reviewer/team that hasn't been superseded by areview_request_removed. Classify only that "current attachment" event. Same class of mistake as the false-positive case we fixed in #44 — we were looking at history instead of state.New tests cover the two remove/re-add scenarios for both the direct and team paths.
2.
fshortcut help text didn't reflect its scopeComment on
ShortcutHelp.tsx:One-line description update. Broader help-overlay-scope structure tracked in #46.
Not addressing
Comment on
SortControl.tsxabout empty-fields safety — every call site passes a literal constant, so the failure mode is theoretical. Skipping unless it becomes a real concern.Test plan
pnpm typecheck,pnpm test,pnpm lint,pnpm fmt:check