diff --git a/NucleicRemote/NucleicRemote/Views/ProjectsView.swift b/NucleicRemote/NucleicRemote/Views/ProjectsView.swift index 1473dd7..96850dd 100644 --- a/NucleicRemote/NucleicRemote/Views/ProjectsView.swift +++ b/NucleicRemote/NucleicRemote/Views/ProjectsView.swift @@ -74,7 +74,7 @@ struct ProjectDetailView: View { ForEach(sessions, id: \.sessionID) { summary in NavigationLink { SessionDetailView(sessionID: summary.sessionID) - } label: { SessionRow(summary: summary) } + } label: { SessionRow(summary: summary, showProjectName: false) } } } } diff --git a/NucleicRemote/NucleicRemote/Views/SessionsView.swift b/NucleicRemote/NucleicRemote/Views/SessionsView.swift index 85c0f90..cc454dd 100644 --- a/NucleicRemote/NucleicRemote/Views/SessionsView.swift +++ b/NucleicRemote/NucleicRemote/Views/SessionsView.swift @@ -81,6 +81,9 @@ struct SessionsView: View { struct SessionRow: View { let summary: WireSessionSummary + /// Show the project name as subtext. Suppressed when the row already lives inside + /// its project's own section (e.g. `ProjectDetailView`), where the name is redundant. + var showProjectName = true var body: some View { HStack(spacing: 12) { @@ -95,7 +98,9 @@ struct SessionRow: View { } Text(summary.title).font(.body.weight(.medium)).lineLimit(1) } - Text(summary.projectName).font(.caption).foregroundStyle(.secondary) + if showProjectName { + Text(summary.projectName).font(.caption).foregroundStyle(.secondary) + } } Spacer() VStack(alignment: .trailing, spacing: 2) {