Commit 77cd5ece16

77cd5ece16b88d60abafa61b2042a5959e0e8da4

parent: 1f32ceb67c

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-07 04:01 UTC

Show watch, bookmark and fork state on the repository screen

Layout: unified · split

gitbay/Views/Repos/RepoView.swift +34 −10
@@ -160,18 +160,35 @@ struct RepoView: View {
160160 }
161161 Divider()
162162 Section {
163 Button {
164 Task { await actionsModel.watch() }
165 } label: {
166 Label("Watch this repository", systemImage: "eye")
163 let watchState = WatchState(detail.watch)
164 switch watchState {
165 case .watching:
166 Label("Watching", systemImage: "eye")
167 case .muted:
168 Label("Muted", systemImage: "bell.slash")
169 case .default:
170 EmptyView()
167171 }
168 Button {
169 Task { await actionsModel.unwatch() }
170 } label: {
171 Label("Mute this repository", systemImage: "bell.slash")
172 if watchState.available.contains(.watch) {
173 Button {
174 Task {
175 await actionsModel.watch()
176 await model.load()
177 }
178 } label: {
179 Label("Watch this repository", systemImage: "eye")
180 }
181 }
182 if watchState.available.contains(.mute) {
183 Button {
184 Task {
185 await actionsModel.unwatch()
186 await model.load()
187 }
188 } label: {
189 Label("Mute this repository", systemImage: "bell.slash")
190 }
172191 }
173 // Nothing reports which of these is current (krz/gitbay#178).
174 Text("The current setting isn't shown.")
175192 }
176193 Divider()
177194 Button {
@@ -235,6 +252,13 @@ struct RepoView: View {
235252 }
236253 .font(.gbSans(.caption))
237254 .foregroundStyle(.secondary)
255 if let forkOf = detail.forkOf {
256 NavigationLink(value: RepoRoute.repo(forkOf)) {
257 Text("Forked from \(forkOf)")
258 }
259 .font(.gbSans(.caption))
260 .foregroundStyle(.secondary)
261 }
238262 }
239263 .padding(.vertical, 4)
240264 }