summaryrefslogtreecommitdiff
path: root/Hutch/Views/Repositories/ArtifactsView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-16 00:42:38 -0500
committerChristian Cleberg <[email protected]>2026-07-16 00:42:38 -0500
commit77cd5b5e56ec054b451a6165162fef655873a5d6 (patch)
tree6160d1be989c9da7d97629a764e68193265d76bd /Hutch/Views/Repositories/ArtifactsView.swift
parent6898bc3fc00decee7224895ea75908daf0f97f59 (diff)
downloadhutch-77cd5b5e56ec054b451a6165162fef655873a5d6.tar.gz
hutch-77cd5b5e56ec054b451a6165162fef655873a5d6.tar.bz2
hutch-77cd5b5e56ec054b451a6165162fef655873a5d6.zip
fix: push mailing lists locally, fix upload menu, drop the events feed
Opening a mailing list from More → Projects still blanked. The cause was not in handleTabNavigation: the row called openMailingList and then dismiss(), so a path rebuild and a pop of this very view raced each other. Projects already lives in the More tab, so there is nothing to navigate to — push MailingListDetailView directly, which also lands back on the project rather than on Mailing Lists. Sources and trackers keep routing, because they really do land in other tabs. The upload controls did nothing. Two .confirmationDialog modifiers on one view leave one silently dead, and this view already had one for delete, so the tag picker never presented. It is a Menu now, which also puts the tags one tap away instead of two. The ticket activity feed is removed. todo.sr.ht's root events resolver joins event.participant_id, which references participant(id), against participant.user_id — different id spaces — so it returns an empty list for every user. The rows exist; that join cannot find them. Ticket.events is unaffected because it filters on ticket_id, which is why ticket timelines work. No client can fix this, and a screen that is permanently empty while blaming the token's scopes is worse than no screen. Recorded in SCOPE.md with the query.
Diffstat (limited to 'Hutch/Views/Repositories/ArtifactsView.swift')
-rw-r--r--Hutch/Views/Repositories/ArtifactsView.swift46
1 files changed, 24 insertions, 22 deletions
diff --git a/Hutch/Views/Repositories/ArtifactsView.swift b/Hutch/Views/Repositories/ArtifactsView.swift
index 752c7c5..30ab0b1 100644
--- a/Hutch/Views/Repositories/ArtifactsView.swift
+++ b/Hutch/Views/Repositories/ArtifactsView.swift
@@ -10,10 +10,30 @@ struct ArtifactsView: View {
@State private var uploadTargetRef: String?
@State private var pendingDeletion: ArtifactInfo?
- @State private var showTagPicker = false
private var isOwnedByCurrentUser: Bool { canManage }
+ /// A menu rather than a confirmation dialog: this view already presents one
+ /// for delete, and two .confirmationDialog modifiers on the same view leave
+ /// one of them silently dead. A menu also puts the tags one tap away.
+ @ViewBuilder
+ private var uploadMenu: some View {
+ Menu {
+ if viewModel.tags.isEmpty {
+ Text("This repository has no tags")
+ } else {
+ ForEach(viewModel.tags.prefix(12), id: \.name) { tag in
+ Button(RepositorySummary.displayBranchName(for: tag.name)) {
+ uploadTargetRef = tag.name
+ }
+ }
+ }
+ } label: {
+ SwiftUI.Label("Upload Artifact…", systemImage: "square.and.arrow.up")
+ }
+ .disabled(viewModel.isMutatingArtifact || viewModel.tags.isEmpty)
+ }
+
var body: some View {
List {
// In the list rather than the toolbar: this view is a segment inside
@@ -22,13 +42,8 @@ struct ArtifactsView: View {
// reach the navigation bar. It also has to be reachable when there are
// no artifacts at all, which is the state a new tag is in.
if isOwnedByCurrentUser {
- Button {
- showTagPicker = true
- } label: {
- SwiftUI.Label("Upload Artifact…", systemImage: "square.and.arrow.up")
- }
- .disabled(viewModel.isMutatingArtifact || viewModel.tags.isEmpty)
- .themedRow()
+ uploadMenu
+ .themedRow()
}
ForEach(viewModel.referenceArtifacts) { refArtifacts in
@@ -99,16 +114,6 @@ struct ArtifactsView: View {
} message: { _ in
Text("This permanently removes the artifact from the tag. This cannot be undone.")
}
- .confirmationDialog("Upload to Tag", isPresented: $showTagPicker, titleVisibility: .visible) {
- ForEach(viewModel.tags.prefix(12), id: \.name) { tag in
- Button(RepositorySummary.displayBranchName(for: tag.name)) {
- uploadTargetRef = tag.name
- }
- }
- Button("Cancel", role: .cancel) {}
- } message: {
- Text("Artifacts attach to a tag. Filenames must be unique within the repository.")
- }
.themedList()
.listStyle(.insetGrouped)
.task {
@@ -136,10 +141,7 @@ struct ArtifactsView: View {
Text("This repository has no release artifacts.")
} actions: {
if isOwnedByCurrentUser {
- Button("Upload Artifact…") {
- showTagPicker = true
- }
- .disabled(viewModel.isMutatingArtifact || viewModel.tags.isEmpty)
+ uploadMenu
}
}
}