Repository navigation
fix(ui): keep the sections board after assigning reviewers - #167
Merged
Merged
Conversation
assignReviewersCmd always fetched through fetchCmd(m.filter, false), which paints the flat PR board — even on the sections default (open board with no server qualifier), where it would replace the Review requested / Mine / Others categories with author grouping until the next normal refresh. Extract a listFetchCmd helper that chooses between sectionsFetchCmd and fetchCmd the same way refreshCmd does, and use it in assignReviewersCmd. The helper ensures both paths stay in sync. Fixes #165.
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.
Closes #165
Summary
Assigning reviewers with Shift+R on the default open PR board (sections: Review requested / Mine / Others) replaced the sections view with author-grouped rows until the next normal refresh. The root cause was that
assignReviewersCmdalways usedfetchCmd(m.filter, false)(flat list) regardless of the board state, while the rest of the app usessectionsFetchCmdon the sections board andfetchCmdon any other board.Extracted a
listFetchCmdhelper (PR-mode only) that picks between the two fetches the same wayrefreshCmddoes, and wired it intoassignReviewersCmdso the two paths cannot drift again.Testing
go test ./...— passesgo test -race -short ./...— passesTestAssignReviewersOnSectionedBoardKeepsSectionsconfirms the sections board stays sections after a reviewer change, and would fail on the old code.