Skip to content

Commit 36b40f5

Browse files
ericholguindanieldaquino
authored andcommitted
Damus Labs
This PR adds the new Damus Labs view. This will allow us to make the new things we work on more prominent. Any new features we want to iterate fast on and get to our users a lot faster are perfect for Damus Labs. This will be exclusive to Damus Purple Subscribers. Changelog-Added: Added Damus Labs Signed-off-by: ericholguin <[email protected]>
1 parent 02296d7 commit 36b40f5

File tree

10 files changed

+334
-3
lines changed

10 files changed

+334
-3
lines changed

damus.xcodeproj/project.pbxproj

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,18 @@
543543
5CB017312D4422DB00A9ED05 /* NWCSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017302D4422D600A9ED05 /* NWCSettings.swift */; };
544544
5CB017322D4422DB00A9ED05 /* NWCSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017302D4422D600A9ED05 /* NWCSettings.swift */; };
545545
5CB017332D4422DB00A9ED05 /* NWCSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017302D4422D600A9ED05 /* NWCSettings.swift */; };
546+
5CB645982EA317D20018BD91 /* DamusLabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645972EA317CC0018BD91 /* DamusLabs.swift */; };
547+
5CB645992EA317D20018BD91 /* DamusLabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645972EA317CC0018BD91 /* DamusLabs.swift */; };
548+
5CB6459A2EA317D20018BD91 /* DamusLabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645972EA317CC0018BD91 /* DamusLabs.swift */; };
549+
5CB6459C2EA31D8E0018BD91 /* LabsIntroduction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB6459B2EA31D750018BD91 /* LabsIntroduction.swift */; };
550+
5CB6459D2EA31D8E0018BD91 /* LabsIntroduction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB6459B2EA31D750018BD91 /* LabsIntroduction.swift */; };
551+
5CB6459E2EA31D8E0018BD91 /* LabsIntroduction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB6459B2EA31D750018BD91 /* LabsIntroduction.swift */; };
552+
5CB645A12EA31E410018BD91 /* LabsLogoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645A02EA31E3D0018BD91 /* LabsLogoView.swift */; };
553+
5CB645A22EA31E410018BD91 /* LabsLogoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645A02EA31E3D0018BD91 /* LabsLogoView.swift */; };
554+
5CB645A32EA31E410018BD91 /* LabsLogoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645A02EA31E3D0018BD91 /* LabsLogoView.swift */; };
555+
5CB645A92EAC01430018BD91 /* DamusLabsExpirements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645A82EAC013A0018BD91 /* DamusLabsExpirements.swift */; };
556+
5CB645AA2EAC01430018BD91 /* DamusLabsExpirements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645A82EAC013A0018BD91 /* DamusLabsExpirements.swift */; };
557+
5CB645AB2EAC01430018BD91 /* DamusLabsExpirements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB645A82EAC013A0018BD91 /* DamusLabsExpirements.swift */; };
546558
5CC8529D2BD741CD0039FFC5 /* HighlightEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC8529C2BD741CD0039FFC5 /* HighlightEvent.swift */; };
547559
5CC8529F2BD744F60039FFC5 /* HighlightView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC8529E2BD744F60039FFC5 /* HighlightView.swift */; };
548560
5CC852A22BDED9B90039FFC5 /* HighlightDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC852A12BDED9B90039FFC5 /* HighlightDescription.swift */; };
@@ -2551,6 +2563,10 @@
25512563
5CB017242D42C5BD00A9ED05 /* TransactionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsView.swift; sourceTree = "<group>"; };
25522564
5CB0172C2D42C76600A9ED05 /* BalanceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceView.swift; sourceTree = "<group>"; };
25532565
5CB017302D4422D600A9ED05 /* NWCSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NWCSettings.swift; sourceTree = "<group>"; };
2566+
5CB645972EA317CC0018BD91 /* DamusLabs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusLabs.swift; sourceTree = "<group>"; };
2567+
5CB6459B2EA31D750018BD91 /* LabsIntroduction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabsIntroduction.swift; sourceTree = "<group>"; };
2568+
5CB645A02EA31E3D0018BD91 /* LabsLogoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabsLogoView.swift; sourceTree = "<group>"; };
2569+
5CB645A82EAC013A0018BD91 /* DamusLabsExpirements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusLabsExpirements.swift; sourceTree = "<group>"; };
25542570
5CC8529C2BD741CD0039FFC5 /* HighlightEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightEvent.swift; sourceTree = "<group>"; };
25552571
5CC8529E2BD744F60039FFC5 /* HighlightView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightView.swift; sourceTree = "<group>"; };
25562572
5CC852A12BDED9B90039FFC5 /* HighlightDescription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightDescription.swift; sourceTree = "<group>"; };
@@ -4021,6 +4037,7 @@
40214037
5C78A7872E30345900CF177D /* Longform */,
40224038
5C78A7842E30340E00CF177D /* FollowPack */,
40234039
4CFF8F5729C9FD07008DB934 /* Purple */,
4040+
5CB645962EA3106A0018BD91 /* Labs */,
40244041
4CE879562996C44A00F758CC /* Zaps */,
40254042
4C7D095A2A098C5C00943473 /* Wallet */,
40264043
4CCEB7AC29B53D180078AA28 /* Search */,
@@ -4841,6 +4858,33 @@
48414858
path = Views;
48424859
sourceTree = "<group>";
48434860
};
4861+
5CB645952EA3106A0018BD91 /* Views */ = {
4862+
isa = PBXGroup;
4863+
children = (
4864+
5CB645A82EAC013A0018BD91 /* DamusLabsExpirements.swift */,
4865+
5CB6459B2EA31D750018BD91 /* LabsIntroduction.swift */,
4866+
5CB645972EA317CC0018BD91 /* DamusLabs.swift */,
4867+
);
4868+
path = Views;
4869+
sourceTree = "<group>";
4870+
};
4871+
5CB645962EA3106A0018BD91 /* Labs */ = {
4872+
isa = PBXGroup;
4873+
children = (
4874+
5CB6459F2EA31E2C0018BD91 /* Detail */,
4875+
5CB645952EA3106A0018BD91 /* Views */,
4876+
);
4877+
path = Labs;
4878+
sourceTree = "<group>";
4879+
};
4880+
5CB6459F2EA31E2C0018BD91 /* Detail */ = {
4881+
isa = PBXGroup;
4882+
children = (
4883+
5CB645A02EA31E3D0018BD91 /* LabsLogoView.swift */,
4884+
);
4885+
path = Detail;
4886+
sourceTree = "<group>";
4887+
};
48444888
7C0F392D29B57C8F0039859C /* Extensions */ = {
48454889
isa = PBXGroup;
48464890
children = (
@@ -5500,6 +5544,7 @@
55005544
4CB8838D296F710400DC99E7 /* Reposted.swift in Sources */,
55015545
4CE6DEE927F7A08100C66700 /* ContentView.swift in Sources */,
55025546
2710433D2E6BFE340005C3B0 /* PostingTimelineSwitcherView.swift in Sources */,
5547+
5CB6459A2EA317D20018BD91 /* DamusLabs.swift in Sources */,
55035548
4CEE2AF5280B29E600AB5EEF /* TimeAgo.swift in Sources */,
55045549
4CC14FF12A73FCDB007AEB17 /* Pubkey.swift in Sources */,
55055550
5C8711DE2C460C06007879C2 /* PostingTimelineView.swift in Sources */,
@@ -5877,6 +5922,7 @@
58775922
4C9BB83129C0ED4F00FC4E37 /* DisplayName.swift in Sources */,
58785923
7CFF6317299FEFE5005D382A /* SelectableText.swift in Sources */,
58795924
D5C1AFD42E5EE2820092F72F /* FavoriteButtonView.swift in Sources */,
5925+
5CB645AB2EAC01430018BD91 /* DamusLabsExpirements.swift in Sources */,
58805926
D5C1AFCA2E5EE12B0092F72F /* ContactCardNotify.swift in Sources */,
58815927
4CA352A82A76B37E003BB08B /* NewMutesNotify.swift in Sources */,
58825928
4CFF8F6929CC9ED1008DB934 /* ImageContainerView.swift in Sources */,
@@ -5934,6 +5980,7 @@
59345980
4C73C5142A4437C10062CAC0 /* ZapUserView.swift in Sources */,
59355981
501F8C802A0220E1001AFC1D /* KeychainStorage.swift in Sources */,
59365982
3A92C0FE2DE16E9800CEEBAC /* FaviconCache.swift in Sources */,
5983+
5CB645A22EA31E410018BD91 /* LabsLogoView.swift in Sources */,
59375984
4C1A9A1D29DDCF9B00516EAC /* NotificationSettingsView.swift in Sources */,
59385985
5CC868DD2AA29B3200FB22BA /* NeutralButtonStyle.swift in Sources */,
59395986
4C75EFB528049D790006080F /* Relay.swift in Sources */,
@@ -5956,6 +6003,7 @@
59566003
D7100C5C2B77016700C59298 /* IAPProductStateView.swift in Sources */,
59576004
4CB9D4A72992D02B00A9A7E4 /* ProfileNameView.swift in Sources */,
59586005
D733F9E82D92C76100317B11 /* UnownedNdbNote.swift in Sources */,
6006+
5CB6459C2EA31D8E0018BD91 /* LabsIntroduction.swift in Sources */,
59596007
D77135D42E7B766B00E7639F /* DataExtensions.swift in Sources */,
59606008
D74EA0902D2E271E002290DD /* ErrorView.swift in Sources */,
59616009
4CE4F0F429D779B5005914DB /* PostBox.swift in Sources */,
@@ -6040,6 +6088,7 @@
60406088
5C4FA7FB2DC29C3800CE658C /* FollowPackView.swift in Sources */,
60416089
4C3624722D5EA18E00DD066E /* amount.c in Sources */,
60426090
4C3624712D5EA18300DD066E /* error.c in Sources */,
6091+
5CB645A92EAC01430018BD91 /* DamusLabsExpirements.swift in Sources */,
60436092
4C3624702D5EA17700DD066E /* utf8.c in Sources */,
60446093
4C36246F2D5EA16A00DD066E /* str.c in Sources */,
60456094
4C36246E2D5EA10400DD066E /* hash_u5.c in Sources */,
@@ -6191,6 +6240,7 @@
61916240
82D6FB2C2CD99F7900C925F4 /* ImageMetadata.swift in Sources */,
61926241
D71527FF2E0A3D6900C893D6 /* InterestList.swift in Sources */,
61936242
82D6FB2D2CD99F7900C925F4 /* ImageProcessing.swift in Sources */,
6243+
5CB6459D2EA31D8E0018BD91 /* LabsIntroduction.swift in Sources */,
61946244
82D6FB2E2CD99F7900C925F4 /* BlurHashEncode.swift in Sources */,
61956245
82D6FB2F2CD99F7900C925F4 /* BlurHashDecode.swift in Sources */,
61966246
82D6FB302CD99F7900C925F4 /* PostBox.swift in Sources */,
@@ -6427,6 +6477,7 @@
64276477
D71AD8FE2CEC176A002E2C3C /* AppAccessibilityIdentifiers.swift in Sources */,
64286478
82D6FC092CD99F7900C925F4 /* AboutView.swift in Sources */,
64296479
82D6FC0A2CD99F7900C925F4 /* ProfileName.swift in Sources */,
6480+
5CB645982EA317D20018BD91 /* DamusLabs.swift in Sources */,
64306481
82D6FC0B2CD99F7900C925F4 /* ProfilePictureSelector.swift in Sources */,
64316482
82D6FC0C2CD99F7900C925F4 /* EditMetadataView.swift in Sources */,
64326483
82D6FC0D2CD99F7900C925F4 /* EditPictureControl.swift in Sources */,
@@ -6438,6 +6489,7 @@
64386489
82D6FC122CD99F7900C925F4 /* EventProfileName.swift in Sources */,
64396490
82D6FC132CD99F7900C925F4 /* FriendIcon.swift in Sources */,
64406491
82D6FC142CD99F7900C925F4 /* CondensedProfilePicturesView.swift in Sources */,
6492+
5CB645A32EA31E410018BD91 /* LabsLogoView.swift in Sources */,
64416493
82D6FC152CD99F7900C925F4 /* ProfileEditButton.swift in Sources */,
64426494
D73BDB102D6FF5F600D69970 /* NostrNetworkManager.swift in Sources */,
64436495
82D6FC162CD99F7900C925F4 /* RelayPaidDetail.swift in Sources */,
@@ -6690,6 +6742,7 @@
66906742
D73E5E872C6A97F4007EB227 /* DamusPurple.swift in Sources */,
66916743
D73E5F992C6AA864007EB227 /* InvoicesView.swift in Sources */,
66926744
D73E5E882C6A97F4007EB227 /* StoreObserver.swift in Sources */,
6745+
5CB645992EA317D20018BD91 /* DamusLabs.swift in Sources */,
66936746
D73E5E892C6A97F4007EB227 /* DamusPurpleURL.swift in Sources */,
66946747
D73E5E8A2C6A97F4007EB227 /* PurpleStoreKitManager.swift in Sources */,
66956748
D733F9E72D92C76100317B11 /* UnownedNdbNote.swift in Sources */,
@@ -6853,6 +6906,7 @@
68536906
D73E5F0E2C6A97F4007EB227 /* FriendIcon.swift in Sources */,
68546907
D73E5F0F2C6A97F4007EB227 /* CondensedProfilePicturesView.swift in Sources */,
68556908
D73E5F102C6A97F4007EB227 /* ProfileEditButton.swift in Sources */,
6909+
5CB6459E2EA31D8E0018BD91 /* LabsIntroduction.swift in Sources */,
68566910
D73E5F112C6A97F4007EB227 /* RelayPaidDetail.swift in Sources */,
68576911
D7AACFFF2E0387B800FB7699 /* LnurlAmountView.swift in Sources */,
68586912
D73E5F122C6A97F4007EB227 /* RelayAuthenticationDetail.swift in Sources */,
@@ -7002,6 +7056,7 @@
70027056
D703D7A52C670E3E00A400EA /* mdb.c in Sources */,
70037057
D703D76B2C670B3100A400EA /* Referenced.swift in Sources */,
70047058
D73BDB192D71311900D69970 /* UserRelayListErrors.swift in Sources */,
7059+
5CB645A12EA31E410018BD91 /* LabsLogoView.swift in Sources */,
70057060
D703D7582C670A6000A400EA /* Id.swift in Sources */,
70067061
5C05675A2C8FBDE70073F23A /* NDBSearchView.swift in Sources */,
70077062
D703D76E2C670B4900A400EA /* NdbTagsIterator.swift in Sources */,
@@ -7045,6 +7100,7 @@
70457100
D73E5E162C6A9619007EB227 /* PostView.swift in Sources */,
70467101
D703D7872C670C7E00A400EA /* DamusPurpleEnvironment.swift in Sources */,
70477102
D703D7892C670C8600A400EA /* DeepLPlan.swift in Sources */,
7103+
5CB645AA2EAC01430018BD91 /* DamusLabsExpirements.swift in Sources */,
70487104
D73E5E182C6A963D007EB227 /* AttachMediaUtility.swift in Sources */,
70497105
D73E5F852C6AA628007EB227 /* LoadScript.swift in Sources */,
70507106
D703D74E2C6709DA00A400EA /* Pubkey.swift in Sources */,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "damooseLabs.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
2.48 MB
Loading

damus/ContentView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ struct ContentView: View {
195195
}
196196
}
197197
}
198+
.onAppear {
199+
notify(.display_tabbar(true))
200+
}
198201
}
199202

200203
func MaybeReportView(target: ReportTarget) -> some View {
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//
2+
// LabsLogoView.swift
3+
// damus
4+
//
5+
// Created by eric on 10/17/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct LabsLogoView: View {
11+
var body: some View {
12+
HStack(spacing: 20) {
13+
Image("damus-dark-logo")
14+
.resizable()
15+
.frame(width: 60, height: 60)
16+
.clipShape(RoundedRectangle(cornerRadius: 15.0))
17+
.overlay(
18+
RoundedRectangle(cornerRadius: 15)
19+
.stroke(LinearGradient(
20+
colors: [DamusColors.lighterPink.opacity(0.8), .white.opacity(0), DamusColors.deepPurple.opacity(0.6)],
21+
startPoint: .topLeading,
22+
endPoint: .bottomTrailing), lineWidth: 1)
23+
)
24+
.shadow(radius: 5)
25+
26+
VStack(alignment: .leading) {
27+
HStack(spacing: 0) {
28+
Text("Labs ", comment: "Feature name")
29+
.font(.system(size: 60.0).weight(.bold))
30+
.foregroundColor(.white)
31+
.tracking(-2)
32+
Image(systemName: "flask.fill")
33+
.padding(.top, 25)
34+
.foregroundStyle(
35+
LinearGradient(
36+
colors: [DamusColors.deepPurple, DamusColors.lighterPink],
37+
startPoint: .topLeading,
38+
endPoint: .bottomTrailing
39+
)
40+
)
41+
Image(systemName: "testtube.2")
42+
.padding(.top, 25)
43+
.foregroundStyle(
44+
LinearGradient(
45+
colors: [DamusColors.lighterPink, DamusColors.deepPurple],
46+
startPoint: .bottomLeading,
47+
endPoint: .topTrailing
48+
)
49+
)
50+
}
51+
}
52+
}
53+
.padding(.bottom, 30)
54+
}
55+
}
56+
57+
58+
#Preview {
59+
PurpleBackdrop {
60+
LabsLogoView()
61+
}
62+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
//
2+
// DamusLabs.swift
3+
// damus
4+
//
5+
// Created by eric on 10/17/25.
6+
//
7+
8+
import SwiftUI
9+
import StoreKit
10+
11+
struct DamusLabsView: View {
12+
let damus_state: DamusState
13+
@State var purple_account: DamusPurple.Account?
14+
15+
@State var show_intro_sheet: Bool = true
16+
@State private var shouldDismissView = false
17+
18+
@Environment(\.dismiss) var dismiss
19+
20+
init(damus_state: DamusState) {
21+
self.damus_state = damus_state
22+
self.purple_account = nil
23+
}
24+
25+
var body: some View {
26+
NavigationView {
27+
PurpleBackdrop {
28+
VStack {
29+
MainContent
30+
.padding(.top, 125)
31+
}
32+
}
33+
.navigationBarHidden(true)
34+
.navigationBarTitleDisplayMode(.inline)
35+
.navigationBarBackButtonHidden(true)
36+
.navigationBarItems(leading: BackNav())
37+
}
38+
.onReceive(handle_notify(.switched_timeline)) { _ in
39+
dismiss()
40+
}
41+
.onAppear {
42+
notify(.display_tabbar(false))
43+
}
44+
.task {
45+
if damus_state.purple.enable_purple {
46+
self.purple_account = try? await damus_state.purple.get_maybe_cached_account(pubkey: damus_state.pubkey)
47+
}
48+
}
49+
.ignoresSafeArea(.all)
50+
}
51+
52+
var MainContent: some View {
53+
VStack {
54+
LabsLogoView()
55+
56+
if let purple_account, purple_account.active == true {
57+
DamusLabsExpirements(damus_state: damus_state)
58+
} else {
59+
LabsIntroductionView(damus_state: damus_state)
60+
}
61+
62+
Spacer()
63+
}
64+
}
65+
}
66+
67+
struct DamusLabsView_Previews: PreviewProvider {
68+
static var previews: some View {
69+
DamusLabsView(damus_state: test_damus_state)
70+
}
71+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//
2+
// DamusLabsExpirements.swift
3+
// damus
4+
//
5+
// Created by eric on 10/24/25.
6+
//
7+
8+
import SwiftUI
9+
10+
11+
struct DamusLabsExpirements: View {
12+
13+
let damus_state: DamusState
14+
15+
var body: some View {
16+
VStack {
17+
VStack(alignment: .leading, spacing: 30) {
18+
PurpleViewPrimitives.SubtitleView(text: NSLocalizedString("As a subscriber, you’re getting an early look at new and innovative tools. These are beta features — still being tested and tuned. Try them out, share your thoughts, and help us perfect what’s next.", comment: "Damus Labs explainer"))
19+
.multilineTextAlignment(.center)
20+
21+
22+
HStack {
23+
Spacer()
24+
Text("Features coming soon!")
25+
.font(.title2)
26+
.foregroundColor(.white)
27+
.fontWeight(.bold)
28+
.padding(.bottom, 2)
29+
Spacer()
30+
}
31+
.padding(15)
32+
.background(DamusColors.neutral6)
33+
.cornerRadius(15)
34+
.padding(.top, 10)
35+
36+
}
37+
.padding([.trailing, .leading], 30)
38+
.padding(.bottom, 20)
39+
40+
Image("damooseLabs")
41+
.resizable()
42+
.aspectRatio(contentMode: .fill)
43+
}
44+
}
45+
}
46+
47+
48+
#Preview {
49+
PurpleBackdrop {
50+
DamusLabsExpirements(damus_state: test_damus_state)
51+
}
52+
}

0 commit comments

Comments
 (0)