Commit b451bbe7a6

b451bbe7a6b8765cf7936b391368d99c1f91dbf5

parent: c81fb98b83

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-22 21:54 UTC

mr: reviewer chips use RemovableChips

reviewerFlow drew the same chip row RemovableChips now provides for labels and assignees. The rendering and the remove action are unchanged; the remove buttons gain the mr-reviewer-remove-<user> identifiers.

Layout: unified · split

gitbay/Views/MRs/MRView.swift +3 −30
@@ -347,7 +347,9 @@ struct MRView: View {
347347
348348 private func reviewersSection(_ mr: MRDetail) -> some View {
349349 Section("Reviewers") {
350 reviewerFlow(mr.reviewRequests)
350 RemovableChips(items: mr.reviewRequests, idPrefix: "mr-reviewer",
351 disabled: model.working,
352 remove: { user in Task { await model.removeReviewRequest(user) } })
351353 HStack {
352354 TextField("Request review", text: $editingReviewer)
353355 .autocorrectionDisabled()
@@ -364,35 +366,6 @@ struct MRView: View {
364366 }
365367 }
366368
367 /// The same add/remove chip shape `IssueView` uses for labels and
368 /// assignees.
369 @ViewBuilder
370 private func reviewerFlow(_ items: [String]) -> some View {
371 if !items.isEmpty {
372 ScrollView(.horizontal, showsIndicators: false) {
373 HStack(spacing: 6) {
374 ForEach(items, id: \.self) { item in
375 HStack(spacing: 3) {
376 Text(item)
377 Button {
378 Task { await model.removeReviewRequest(item) }
379 } label: {
380 Image(systemName: "xmark.circle.fill")
381 .foregroundStyle(.tertiary)
382 }
383 .disabled(model.working)
384 }
385 .font(.gbSans(.caption))
386 .padding(.horizontal, 8)
387 .padding(.vertical, 3)
388 .background(Color.secondary.opacity(0.07), in: gbChipShape)
389 .overlay(gbChipShape.stroke(Color.secondary.opacity(0.35), lineWidth: 1))
390 }
391 }
392 }
393 }
394 }
395
396369 private var diffSection: some View {
397370 Section {
398371 NavigationLink(value: MRRoute.diff(repo: model.repoPath, number: model.number)) {