From a0a5686099a4fa325f20b695fb55904cc5fe8fff Mon Sep 17 00:00:00 2001 From: Bryan Montz Date: Wed, 8 Jan 2025 08:45:26 -0600 Subject: [PATCH 1/4] added lists view and two ways to navigate to it --- CHANGELOG.md | 1 + Nos.xcodeproj/project.pbxproj | 12 +++ Nos/Assets/Localization/Localizable.xcstrings | 66 +++++++++++++ Nos/Controller/FeedController.swift | 12 +-- .../CoreData/AuthorList+CoreDataClass.swift | 11 +++ Nos/Views/Home/FeedCustomizerView.swift | 33 +++++-- Nos/Views/Home/HomeFeedView.swift | 21 ++++- Nos/Views/Lists/ListsView.swift | 94 +++++++++++++++++++ Nos/Views/SideMenu/SideMenu.swift | 1 + Nos/Views/SideMenu/SideMenuContent.swift | 10 ++ 10 files changed, 240 insertions(+), 21 deletions(-) create mode 100644 Nos/Views/Lists/ListsView.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index ac06e7410..e6f9f2687 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Release Notes - Fixed: adding/removing relays not reflected on feed filter. [#119](https://github.com/verse-pbc/issues/issues/119) +- Added Lists view and two ways to navigate to it. ### Internal Changes diff --git a/Nos.xcodeproj/project.pbxproj b/Nos.xcodeproj/project.pbxproj index f3ea65fd5..495f4ab1f 100644 --- a/Nos.xcodeproj/project.pbxproj +++ b/Nos.xcodeproj/project.pbxproj @@ -226,6 +226,7 @@ 50EA86D42D28150F001E62CC /* FeedSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EA86D32D28150D001E62CC /* FeedSource.swift */; }; 50EA86D52D28150F001E62CC /* FeedSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EA86D32D28150D001E62CC /* FeedSource.swift */; }; 50EA885C2D2D523F001E62CC /* follow_set_with_unknown_tag.json in Resources */ = {isa = PBXBuildFile; fileRef = 50EA885B2D2D5235001E62CC /* follow_set_with_unknown_tag.json */; }; + 50EA886F2D2D5783001E62CC /* ListsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EA886E2D2D5780001E62CC /* ListsView.swift */; }; 50F695072C6392C4000E4C74 /* zap_receipt.json in Resources */ = {isa = PBXBuildFile; fileRef = 50F695062C6392C4000E4C74 /* zap_receipt.json */; }; 5B098DBC2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B098DBB2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift */; }; 5B098DC62BDAF73500500A1B /* AttributedString+Links.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B098DC52BDAF73500500A1B /* AttributedString+Links.swift */; }; @@ -793,6 +794,7 @@ 50E2EB712C86175900D4B360 /* NSRegularExpression+Replacement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSRegularExpression+Replacement.swift"; sourceTree = ""; }; 50EA86D32D28150D001E62CC /* FeedSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedSource.swift; sourceTree = ""; }; 50EA885B2D2D5235001E62CC /* follow_set_with_unknown_tag.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = follow_set_with_unknown_tag.json; sourceTree = ""; }; + 50EA886E2D2D5780001E62CC /* ListsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListsView.swift; sourceTree = ""; }; 50F695062C6392C4000E4C74 /* zap_receipt.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = zap_receipt.json; sourceTree = ""; }; 5B098DBB2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NoteParserTests+NIP08.swift"; sourceTree = ""; }; 5B098DC52BDAF73500500A1B /* AttributedString+Links.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AttributedString+Links.swift"; sourceTree = ""; }; @@ -1580,6 +1582,14 @@ path = Onboarding; sourceTree = ""; }; + 50EA886D2D2D5776001E62CC /* Lists */ = { + isa = PBXGroup; + children = ( + 50EA886E2D2D5780001E62CC /* ListsView.swift */, + ); + path = Lists; + sourceTree = ""; + }; 5B79F5E92B97B5D7002DA9BE /* Edit */ = { isa = PBXGroup; children = ( @@ -2069,6 +2079,7 @@ 65BD8DC12BDAF2C300802039 /* Discover */, 03618B112C825D8700BCBC55 /* Fixtures */, C96877B32B4EDCCF0051ED2F /* Home */, + 50EA886D2D2D5776001E62CC /* Lists */, 04368D542C99D32B00DEAA2E /* Moderation */, C9CFF6D02AB241EB00D4B368 /* Modifiers */, 03618C6D2C8267E600BCBC55 /* Note */, @@ -2418,6 +2429,7 @@ 5BC0D9CC2B867B9D005D6980 /* NamesAPI.swift in Sources */, C987F81D29BA6D9A00B44E7A /* ProfileTab.swift in Sources */, C9ADB14129951CB10075E7F8 /* NSManagedObject+Nos.swift in Sources */, + 50EA886F2D2D5783001E62CC /* ListsView.swift in Sources */, 503CA9792D19C39F00805EF8 /* FeedCustomizerView.swift in Sources */, C9F84C21298DC36800C6714D /* AppView.swift in Sources */, C9CE5B142A0172CF008E198C /* WebView.swift in Sources */, diff --git a/Nos/Assets/Localization/Localizable.xcstrings b/Nos/Assets/Localization/Localizable.xcstrings index d3380668b..04051f3c9 100644 --- a/Nos/Assets/Localization/Localizable.xcstrings +++ b/Nos/Assets/Localization/Localizable.xcstrings @@ -4755,6 +4755,17 @@ } } }, + "deleteList" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Delete List" + } + } + } + }, "deleteMyAccount" : { "extractionState" : "manual", "localizations" : { @@ -5822,6 +5833,17 @@ } } }, + "editListInfo" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Edit List Info" + } + } + } + }, "editProfile" : { "extractionState" : "manual", "localizations" : { @@ -10412,6 +10434,17 @@ } } }, + "lists" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Lists" + } + } + } + }, "loading" : { "extractionState" : "manual", "localizations" : { @@ -10887,6 +10920,28 @@ } } }, + "manageUsers" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Manage Users" + } + } + } + }, + "manageYourLists" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Manage Your Lists" + } + } + } + }, "mention" : { "extractionState" : "manual", "localizations" : { @@ -20313,6 +20368,17 @@ } } }, + "yourLists" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Your Lists" + } + } + } + }, "yourProfile" : { "extractionState" : "manual", "localizations" : { diff --git a/Nos/Controller/FeedController.swift b/Nos/Controller/FeedController.swift index b3c14e9be..a4637778f 100644 --- a/Nos/Controller/FeedController.swift +++ b/Nos/Controller/FeedController.swift @@ -26,7 +26,7 @@ import SwiftUI private(set) var listRowItems: [FeedToggleRow.Item] = [] private(set) var relayRowItems: [FeedToggleRow.Item] = [] - private var lists: [AuthorList] = [] { + private(set) var lists: [AuthorList] = [] { didSet { updateEnabledSources() } @@ -38,16 +38,8 @@ import SwiftUI } @ObservationIgnored private lazy var listsPublisher = { - let request = NSFetchRequest(entityName: "AuthorList") - request.sortDescriptors = [NSSortDescriptor(keyPath: \Event.createdAt, ascending: false)] - request.predicate = NSPredicate( - format: "kind = %i AND author = %@ AND title != nil", - EventKind.followSet.rawValue, - author - ) - let listWatcher = NSFetchedResultsController( - fetchRequest: request, + fetchRequest: AuthorList.authorLists(ownedBy: author), managedObjectContext: persistenceController.viewContext, sectionNameKeyPath: nil, cacheName: "FeedController.listWatcher" diff --git a/Nos/Models/CoreData/AuthorList+CoreDataClass.swift b/Nos/Models/CoreData/AuthorList+CoreDataClass.swift index debf4d2d3..08723c115 100644 --- a/Nos/Models/CoreData/AuthorList+CoreDataClass.swift +++ b/Nos/Models/CoreData/AuthorList+CoreDataClass.swift @@ -96,4 +96,15 @@ public class AuthorList: Event { var allAuthors: Set { authors.union(privateAuthors) } + + static func authorLists(ownedBy owner: Author) -> NSFetchRequest { + let request = NSFetchRequest(entityName: "AuthorList") + request.sortDescriptors = [NSSortDescriptor(keyPath: \Event.createdAt, ascending: false)] + request.predicate = NSPredicate( + format: "kind = %i AND author = %@ AND title != nil AND deletedOn.@count = 0", + EventKind.followSet.rawValue, + owner + ) + return request + } } diff --git a/Nos/Views/Home/FeedCustomizerView.swift b/Nos/Views/Home/FeedCustomizerView.swift index e3c498ac9..0c3a838ca 100644 --- a/Nos/Views/Home/FeedCustomizerView.swift +++ b/Nos/Views/Home/FeedCustomizerView.swift @@ -33,6 +33,7 @@ struct FeedCustomizerView: View { @Environment(FeedController.self) var feedController let author: Author + @Binding var shouldNavigateToLists: Bool @Binding var shouldNavigateToRelays: Bool @AppStorage("selectedFeedTogglesTab") private var selectedTab = FeedTab.lists @@ -53,18 +54,30 @@ struct FeedCustomizerView: View { items: feedController.listRowItems, footer: { Group { - Text("Create your own lists on ") + - Text("Listr ") - .foregroundStyle(Color.accent) + - Text(Image(systemName: "link")) - .foregroundStyle(Color.accent) - } - .padding() - .onTapGesture { - if let url = URL(string: "https://listr.lol/feed") { - UIApplication.shared.open(url) + if feedController.listRowItems.isEmpty { + Group { + Text("Create your own lists on ") + + Text("Listr ") + .foregroundStyle(Color.accent) + + Text(Image(systemName: "link")) + .foregroundStyle(Color.accent) + } + .onTapGesture { + if let url = URL(string: "https://listr.lol/feed") { + UIApplication.shared.open(url) + } + } + } else { + SecondaryActionButton( + "manageYourLists", + font: .clarity(.semibold, textStyle: .footnote), + image: Image(systemName: "slider.horizontal.3") + ) { + shouldNavigateToLists = true + } } } + .padding() }, noContent: { Text("It doesn’t look like you have created any lists.") // TODO: localize diff --git a/Nos/Views/Home/HomeFeedView.swift b/Nos/Views/Home/HomeFeedView.swift index bc214c509..e03d199b8 100644 --- a/Nos/Views/Home/HomeFeedView.swift +++ b/Nos/Views/Home/HomeFeedView.swift @@ -18,6 +18,7 @@ struct HomeFeedView: View { /// to get some data from relay. The amount of time is defined in `staticLoadTime`. @State private var showTimedLoadingIndicator = true + @State private var shouldNavigateToListsOnAppear = false @State private var shouldNavigateToRelaysOnAppear = false /// The amount of time (in seconds) the loading indicator will be shown when showTimedLoadingIndicator is set to @@ -130,7 +131,11 @@ struct HomeFeedView: View { .transition(.opacity) VStack { - FeedCustomizerView(author: user, shouldNavigateToRelays: $shouldNavigateToRelaysOnAppear) + FeedCustomizerView( + author: user, + shouldNavigateToLists: $shouldNavigateToListsOnAppear, + shouldNavigateToRelays: $shouldNavigateToRelaysOnAppear + ) Spacer() } .transition(.move(edge: .top)) @@ -187,6 +192,17 @@ struct HomeFeedView: View { GoToFeedTip.viewedFeed.sendDonation() } } + .onChange(of: shouldNavigateToListsOnAppear) { + if shouldNavigateToListsOnAppear { + showFeedSelector = false + + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(300)) { + router.push(ListsDestination(author: user)) + } + + shouldNavigateToListsOnAppear = false + } + } .onChange(of: shouldNavigateToRelaysOnAppear) { if shouldNavigateToRelaysOnAppear { showFeedSelector = false @@ -198,6 +214,9 @@ struct HomeFeedView: View { shouldNavigateToRelaysOnAppear = false } } + .navigationDestination(for: ListsDestination.self) { destination in + ListsView(author: destination.author) + } .navigationDestination(for: RelaysDestination.self) { destination in RelayView(author: destination.author) } diff --git a/Nos/Views/Lists/ListsView.swift b/Nos/Views/Lists/ListsView.swift new file mode 100644 index 000000000..20af52f50 --- /dev/null +++ b/Nos/Views/Lists/ListsView.swift @@ -0,0 +1,94 @@ +import CoreData +import SwiftUI + +struct ListsDestination: Hashable { + let author: Author +} + +struct ListsView: View { + @Environment(\.managedObjectContext) private var viewContext + + let author: Author + + @FetchRequest var lists: FetchedResults + + init(author: Author) { + self.author = author + _lists = FetchRequest(fetchRequest: AuthorList.authorLists(ownedBy: author)) + } + + var body: some View { + ZStack { + Color.appBg + + Group { + if lists.isEmpty { + VStack { + Image(systemName: "person.2") + + Text("Add your favorite accounts to public lists and pin them to your home feed") + } + } else { + ScrollView { + VStack(spacing: 0) { + ForEach(lists) { list in + HStack { + VStack(alignment: .leading) { + Text(list.title ?? "") + .font(.body) + + if let description = list.listDescription { + Text(description) + .foregroundStyle(Color.secondaryTxt) + .font(.footnote) + } + } + + Spacer() + + Menu { + Button("editListInfo") { + // TODO: Edit List Info + } + Button("manageUsers") { + // TODO: Manage Users + } + Button("deleteList", role: .destructive) { + // TODO: Delete List + } + } label: { + Image(systemName: "ellipsis") + .foregroundStyle(Color.secondaryTxt) + .fontWeight(.bold) + } + } + .padding(.horizontal, 16) + .padding(.vertical, 12) + .frame(minHeight: 50) + + BeveledSeparator() + } + } + .background(LinearGradient.cardBackground) + .clipShape(RoundedRectangle(cornerRadius: 15)) + .mimicCardButtonStyle() + } + .padding(EdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16)) + } + } + } + .scrollContentBackground(.hidden) + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + ActionButton("new", action: newButtonPressed) + .frame(height: 22) + .padding(.bottom, 3) + } + } + .nosNavigationBar("yourLists") + } + + private func newButtonPressed() { + + } +} diff --git a/Nos/Views/SideMenu/SideMenu.swift b/Nos/Views/SideMenu/SideMenu.swift index 079760354..484662bd5 100644 --- a/Nos/Views/SideMenu/SideMenu.swift +++ b/Nos/Views/SideMenu/SideMenu.swift @@ -7,6 +7,7 @@ struct SideMenu: View { enum Destination { case settings case relays + case lists case profile case about } diff --git a/Nos/Views/SideMenu/SideMenuContent.swift b/Nos/Views/SideMenu/SideMenuContent.swift index 6d3bb5f6d..8c0f988a6 100644 --- a/Nos/Views/SideMenu/SideMenuContent.swift +++ b/Nos/Views/SideMenu/SideMenuContent.swift @@ -76,6 +76,11 @@ struct SideMenuContent: View { image: Image(systemName: "antenna.radiowaves.left.and.right"), destination: .relays ) + SideMenuRow( + "lists", + image: Image(systemName: "person.2"), + destination: .lists + ) SideMenuRow( "about", image: Image(systemName: "questionmark.circle"), @@ -108,6 +113,8 @@ struct SideMenuContent: View { SettingsView() case .relays: RelayView(author: currentUser.author!) + case .lists: + ListsView(author: currentUser.author!) case .profile: ProfileView(author: currentUser.author!) case .about: @@ -151,6 +158,9 @@ struct SideMenuRow: View { } label: { HStack(alignment: .center) { image + .resizable() + .aspectRatio(contentMode: .fit) + .frame(maxWidth: 28) Text(title) .foregroundColor(.primaryTxt) Spacer() From b9f0bda30d269e3c0f0eefc3c9945e55eeb99123 Mon Sep 17 00:00:00 2001 From: Bryan Montz Date: Thu, 9 Jan 2025 07:11:52 -0600 Subject: [PATCH 2/4] fix background color and add user count --- CHANGELOG.md | 2 +- Nos/Views/Lists/ListsView.swift | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6f9f2687..9ed1c748f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Release Notes - Fixed: adding/removing relays not reflected on feed filter. [#119](https://github.com/verse-pbc/issues/issues/119) -- Added Lists view and two ways to navigate to it. +- Added Lists view and two ways to navigate to it. [#133](https://github.com/verse-pbc/issues/issues/133) ### Internal Changes diff --git a/Nos/Views/Lists/ListsView.swift b/Nos/Views/Lists/ListsView.swift index 20af52f50..9882a2a2e 100644 --- a/Nos/Views/Lists/ListsView.swift +++ b/Nos/Views/Lists/ListsView.swift @@ -20,6 +20,7 @@ struct ListsView: View { var body: some View { ZStack { Color.appBg + .ignoresSafeArea() Group { if lists.isEmpty { @@ -37,11 +38,9 @@ struct ListsView: View { Text(list.title ?? "") .font(.body) - if let description = list.listDescription { - Text(description) - .foregroundStyle(Color.secondaryTxt) - .font(.footnote) - } + Text(list.rowDescription) + .foregroundStyle(Color.secondaryTxt) + .font(.footnote) } Spacer() @@ -92,3 +91,15 @@ struct ListsView: View { } } + +extension AuthorList { + + var rowDescription: String { + var descriptionComponents = [String]() + let authorCount = allAuthors.count + descriptionComponents.append("\(authorCount) users") + + descriptionComponents.append(listDescription ?? "No Description") + return descriptionComponents.joined(separator: " • ") + } +} From ce3df1d5cb3b8ca6f5070d2bc92218cd0338ce90 Mon Sep 17 00:00:00 2001 From: Bryan Montz Date: Thu, 9 Jan 2025 08:01:09 -0600 Subject: [PATCH 3/4] added localization, updated side menu copy, update no content view --- Nos/Assets/Localization/Localizable.xcstrings | 45 +++++++++++++++++++ Nos/Views/Lists/ListsView.swift | 30 ++++++++++--- Nos/Views/SideMenu/SideMenuContent.swift | 2 +- 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/Nos/Assets/Localization/Localizable.xcstrings b/Nos/Assets/Localization/Localizable.xcstrings index 814ea08f5..abb858dcc 100644 --- a/Nos/Assets/Localization/Localizable.xcstrings +++ b/Nos/Assets/Localization/Localizable.xcstrings @@ -10456,6 +10456,17 @@ } } }, + "listsDescription" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Add your favorite users to public lists and pin them to your home feed" + } + } + } + }, "loading" : { "extractionState" : "manual", "localizations" : { @@ -12303,6 +12314,17 @@ } } }, + "noDescription" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "No Description" + } + } + } + }, "noEvents" : { "extractionState" : "manual", "localizations" : { @@ -20234,6 +20256,29 @@ } } }, + "xUsers" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "variations" : { + "plural" : { + "one" : { + "stringUnit" : { + "state" : "translated", + "value" : "%1$lld user" + } + }, + "other" : { + "stringUnit" : { + "state" : "translated", + "value" : "%1$lld users" + } + } + } + } + } + } + }, "yes" : { "extractionState" : "manual", "localizations" : { diff --git a/Nos/Views/Lists/ListsView.swift b/Nos/Views/Lists/ListsView.swift index 9882a2a2e..de59e1097 100644 --- a/Nos/Views/Lists/ListsView.swift +++ b/Nos/Views/Lists/ListsView.swift @@ -24,11 +24,28 @@ struct ListsView: View { Group { if lists.isEmpty { - VStack { - Image(systemName: "person.2") + VStack(spacing: 40) { + ZStack { + Circle() + .fill(Color.white) + .frame(width: 80, height: 80) + + Image(systemName: "person.2") + .resizable() + .fontWeight(.semibold) + .aspectRatio(contentMode: .fit) + .frame(width: 48) + .foregroundStyle(Color.black) + } + + Text("listsDescription") + .font(.subheadline.weight(.medium)) + .multilineTextAlignment(.center) - Text("Add your favorite accounts to public lists and pin them to your home feed") + Spacer() } + .padding(.top, 100) + .padding(.horizontal, 60) } else { ScrollView { VStack(spacing: 0) { @@ -88,7 +105,7 @@ struct ListsView: View { } private func newButtonPressed() { - + // TODO } } @@ -97,9 +114,10 @@ extension AuthorList { var rowDescription: String { var descriptionComponents = [String]() let authorCount = allAuthors.count - descriptionComponents.append("\(authorCount) users") + let countString = String.localizedStringWithFormat(String(localized: "xUsers"), authorCount) + descriptionComponents.append(countString) - descriptionComponents.append(listDescription ?? "No Description") + descriptionComponents.append(listDescription ?? String(localized: "noDescription")) return descriptionComponents.joined(separator: " • ") } } diff --git a/Nos/Views/SideMenu/SideMenuContent.swift b/Nos/Views/SideMenu/SideMenuContent.swift index e93f2c56f..cfa27bfcf 100644 --- a/Nos/Views/SideMenu/SideMenuContent.swift +++ b/Nos/Views/SideMenu/SideMenuContent.swift @@ -79,7 +79,7 @@ struct SideMenuContent: View { destination: .relays ) SideMenuRow( - "lists", + "yourLists", image: Image(systemName: "person.2"), destination: .lists ) From a7ffec7e69af934fcddde60086da804f721f844f Mon Sep 17 00:00:00 2001 From: Bryan Montz Date: Sat, 11 Jan 2025 06:42:56 -0600 Subject: [PATCH 4/4] feedback: rename to AuthorListsView and add comment --- Nos.xcodeproj/project.pbxproj | 8 ++++---- Nos/Views/Home/HomeFeedView.swift | 2 +- .../Lists/{ListsView.swift => AuthorListsView.swift} | 3 ++- Nos/Views/SideMenu/SideMenuContent.swift | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) rename Nos/Views/Lists/{ListsView.swift => AuthorListsView.swift} (97%) diff --git a/Nos.xcodeproj/project.pbxproj b/Nos.xcodeproj/project.pbxproj index a2a9e8928..efa3bb8a5 100644 --- a/Nos.xcodeproj/project.pbxproj +++ b/Nos.xcodeproj/project.pbxproj @@ -226,7 +226,7 @@ 50EA86D42D28150F001E62CC /* FeedSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EA86D32D28150D001E62CC /* FeedSource.swift */; }; 50EA86D52D28150F001E62CC /* FeedSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EA86D32D28150D001E62CC /* FeedSource.swift */; }; 50EA885C2D2D523F001E62CC /* follow_set_with_unknown_tag.json in Resources */ = {isa = PBXBuildFile; fileRef = 50EA885B2D2D5235001E62CC /* follow_set_with_unknown_tag.json */; }; - 50EA886F2D2D5783001E62CC /* ListsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EA886E2D2D5780001E62CC /* ListsView.swift */; }; + 50EA886F2D2D5783001E62CC /* AuthorListsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EA886E2D2D5780001E62CC /* AuthorListsView.swift */; }; 50F695072C6392C4000E4C74 /* zap_receipt.json in Resources */ = {isa = PBXBuildFile; fileRef = 50F695062C6392C4000E4C74 /* zap_receipt.json */; }; 5B098DBC2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B098DBB2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift */; }; 5B098DC62BDAF73500500A1B /* AttributedString+Links.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B098DC52BDAF73500500A1B /* AttributedString+Links.swift */; }; @@ -795,7 +795,7 @@ 50E2EB712C86175900D4B360 /* NSRegularExpression+Replacement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSRegularExpression+Replacement.swift"; sourceTree = ""; }; 50EA86D32D28150D001E62CC /* FeedSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedSource.swift; sourceTree = ""; }; 50EA885B2D2D5235001E62CC /* follow_set_with_unknown_tag.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = follow_set_with_unknown_tag.json; sourceTree = ""; }; - 50EA886E2D2D5780001E62CC /* ListsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListsView.swift; sourceTree = ""; }; + 50EA886E2D2D5780001E62CC /* AuthorListsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorListsView.swift; sourceTree = ""; }; 50F695062C6392C4000E4C74 /* zap_receipt.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = zap_receipt.json; sourceTree = ""; }; 5B098DBB2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NoteParserTests+NIP08.swift"; sourceTree = ""; }; 5B098DC52BDAF73500500A1B /* AttributedString+Links.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AttributedString+Links.swift"; sourceTree = ""; }; @@ -1587,7 +1587,7 @@ 50EA886D2D2D5776001E62CC /* Lists */ = { isa = PBXGroup; children = ( - 50EA886E2D2D5780001E62CC /* ListsView.swift */, + 50EA886E2D2D5780001E62CC /* AuthorListsView.swift */, ); path = Lists; sourceTree = ""; @@ -2433,7 +2433,7 @@ 5BC0D9CC2B867B9D005D6980 /* NamesAPI.swift in Sources */, C987F81D29BA6D9A00B44E7A /* ProfileTab.swift in Sources */, C9ADB14129951CB10075E7F8 /* NSManagedObject+Nos.swift in Sources */, - 50EA886F2D2D5783001E62CC /* ListsView.swift in Sources */, + 50EA886F2D2D5783001E62CC /* AuthorListsView.swift in Sources */, 503CA9792D19C39F00805EF8 /* FeedCustomizerView.swift in Sources */, C9F84C21298DC36800C6714D /* AppView.swift in Sources */, C9CE5B142A0172CF008E198C /* WebView.swift in Sources */, diff --git a/Nos/Views/Home/HomeFeedView.swift b/Nos/Views/Home/HomeFeedView.swift index 39e47afee..5ff00cd46 100644 --- a/Nos/Views/Home/HomeFeedView.swift +++ b/Nos/Views/Home/HomeFeedView.swift @@ -217,7 +217,7 @@ struct HomeFeedView: View { } } .navigationDestination(for: ListsDestination.self) { destination in - ListsView(author: destination.author) + AuthorListsView(author: destination.author) } .navigationDestination(for: RelaysDestination.self) { destination in RelayView(author: destination.author) diff --git a/Nos/Views/Lists/ListsView.swift b/Nos/Views/Lists/AuthorListsView.swift similarity index 97% rename from Nos/Views/Lists/ListsView.swift rename to Nos/Views/Lists/AuthorListsView.swift index de59e1097..720d24220 100644 --- a/Nos/Views/Lists/ListsView.swift +++ b/Nos/Views/Lists/AuthorListsView.swift @@ -5,7 +5,8 @@ struct ListsDestination: Hashable { let author: Author } -struct ListsView: View { +/// A view that displays a list of an ``Author``'s ``AuthorList``s. +struct AuthorListsView: View { @Environment(\.managedObjectContext) private var viewContext let author: Author diff --git a/Nos/Views/SideMenu/SideMenuContent.swift b/Nos/Views/SideMenu/SideMenuContent.swift index cfa27bfcf..15f52301e 100644 --- a/Nos/Views/SideMenu/SideMenuContent.swift +++ b/Nos/Views/SideMenu/SideMenuContent.swift @@ -116,7 +116,7 @@ struct SideMenuContent: View { case .relays: RelayView(author: currentUser.author!) case .lists: - ListsView(author: currentUser.author!) + AuthorListsView(author: currentUser.author!) case .profile: ProfileView(author: currentUser.author!) case .about: