add reviewer assigning

This commit is contained in:
2026-07-29 09:49:51 +02:00
parent a82f5e7e9f
commit 1d90e364ee
17 changed files with 1475 additions and 47 deletions

View File

@@ -31,6 +31,10 @@ type recordingPRService struct {
updateErr error
branches []RepositoryBranch
branchErr error
users []RepositoryUser
userErr error
people PullRequestPeopleUpdate
peopleErr error
}
type recordingMergeService struct {
@@ -77,6 +81,25 @@ func (s *recordingPRService) ListBranches(
return append([]RepositoryBranch(nil), s.branches...), s.branchErr
}
func (s *recordingPRService) ListRepositoryUsers(
_ context.Context, _, _ string,
) ([]RepositoryUser, error) {
return append([]RepositoryUser(nil), s.users...), s.userErr
}
func (s *recordingPRService) UpdatePullRequestPeople(
_ context.Context, _, _ string, _ int, update PullRequestPeopleUpdate,
) (PullRequestPeople, error) {
s.people = update
if s.peopleErr != nil {
return PullRequestPeople{}, s.peopleErr
}
return PullRequestPeople{
Reviewers: append([]string(nil), update.Reviewers...),
Assignees: append([]string(nil), update.Assignees...),
}, nil
}
func (s *recordingService) SetThreadResolved(
_ context.Context, threadID string, resolved bool,
) (ReviewThread, error) {
@@ -674,6 +697,8 @@ func TestDashboardEditorUpdatesTitleBodyAndBaseBranch(t *testing.T) {
send(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune("x")})
send(tea.KeyMsg{Type: tea.KeyEsc})
send(tea.KeyMsg{Type: tea.KeyShiftTab})
send(tea.KeyMsg{Type: tea.KeyShiftTab})
send(tea.KeyMsg{Type: tea.KeyShiftTab})
send(tea.KeyMsg{Type: tea.KeyHome})
for range len("main") {
@@ -901,7 +926,7 @@ func TestDashboardPositionsHardwareCursorAtInsertBoundary(t *testing.T) {
m.startPREdit()
m.prEditEditors[prEditBodyField].Cursor = 4
m.prEditEditors[prEditBodyField].Mode = textEditorInsert
m.positionPREditHardwareCursor(0, m.dashboardViewportHeight())
m.positionPREditHardwareCursor(m.scroll, m.dashboardViewportHeight())
m.cursorOutput.mu.Lock()
visible, column, row := m.cursorOutput.visible, m.cursorOutput.column, m.cursorOutput.row