Skip to content

Commit 98d002e

Browse files
authored
Merge branch 'dev' into jarod/context-menu-reactions-bar
2 parents af30f7c + 6a47d6e commit 98d002e

78 files changed

Lines changed: 3074 additions & 491 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ qa/cxdb/qa.sqlite
129129
qa/cxdb/qa.sqlite-wal
130130
qa/cxdb/qa.sqlite-shm
131131
.DS_Store
132-
docs/plans/.mote-preview.html
132+
.mote-preview.html

Convos.xcodeproj/project.pbxproj

Lines changed: 51 additions & 51 deletions
Large diffs are not rendered by default.

Convos/App Settings/AppSettingsView.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,6 @@ struct AppSettingsView: View {
160160
}
161161
.foregroundStyle(.colorTextPrimary)
162162

163-
NavigationLink {
164-
PendingInviteDebugView(session: session)
165-
} label: {
166-
Text("Pending Invites")
167-
}
168-
.foregroundStyle(.colorTextPrimary)
169-
170163
if !ConfigManager.shared.currentEnvironment.isProduction {
171164
NavigationLink {
172165
DebugExportView(environment: ConfigManager.shared.currentEnvironment, session: session)

Convos/Config/FeatureFlags.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Foundation
2+
3+
@MainActor @Observable
4+
final class FeatureFlags {
5+
static let shared: FeatureFlags = FeatureFlags()
6+
7+
var isAssistantEnabled: Bool {
8+
get {
9+
guard !isProductionEnvironment else { return false }
10+
return UserDefaults.standard.bool(forKey: Constant.assistantEnabledKey)
11+
}
12+
set {
13+
UserDefaults.standard.set(newValue, forKey: Constant.assistantEnabledKey)
14+
}
15+
}
16+
17+
private var isProductionEnvironment: Bool {
18+
ConfigManager.shared.currentEnvironment.isProduction
19+
}
20+
21+
private enum Constant {
22+
static let assistantEnabledKey: String = "featureFlags.assistantEnabled"
23+
}
24+
}

Convos/Conversation Creation/NewConversationView.swift

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ struct NewConversationView: View {
55
let viewModel: NewConversationViewModel
66
@Bindable var quicknameViewModel: QuicknameSettingsViewModel
77
@State private var hasShownScannerOnAppear: Bool = false
8-
@State private var presentingJoiningStateInfo: Bool = false
98
@State private var sidebarWidth: CGFloat = 0.0
109
@State private var focusCoordinator: FocusCoordinator = FocusCoordinator(horizontalSizeClass: nil)
1110

@@ -51,21 +50,10 @@ struct NewConversationView: View {
5150
.toolbar {
5251
if !viewModel.showingFullScreenScanner {
5352
ToolbarItem(placement: .topBarLeading) {
54-
let closeAction = {
55-
if viewModel.conversationViewModel?.onboardingCoordinator.isWaitingForInviteAcceptance == true {
56-
presentingJoiningStateInfo = true
57-
} else {
58-
dismiss()
59-
}
53+
Button(role: .close) {
54+
dismiss()
6055
}
61-
Button(role: .close, action: closeAction)
62-
.confirmationDialog("This convo will appear on your home screen after someone approves you",
63-
isPresented: $presentingJoiningStateInfo,
64-
titleVisibility: .visible) {
65-
Button("Continue") {
66-
dismiss()
67-
}
68-
}
56+
.accessibilityIdentifier("close-new-conversation")
6957
}
7058
}
7159
}

Convos/Conversation Detail/AddToConversationMenu.swift

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,30 @@ struct AddToConversationMenu: View {
77
let onConvoCode: () -> Void
88
var onMenuOpen: (() -> Void)?
99

10+
private var isAssistantEnabled: Bool { FeatureFlags.shared.isAssistantEnabled }
11+
12+
private var labelColor: Color {
13+
if !isEnabled {
14+
return .colorTextSecondary.opacity(0.4)
15+
}
16+
return isFull ? .colorTextSecondary : .colorTextPrimary
17+
}
18+
1019
var body: some View {
20+
if isAssistantEnabled {
21+
menuView
22+
} else {
23+
Button(action: onConvoCode) {
24+
Image(systemName: "plus")
25+
.foregroundStyle(labelColor)
26+
}
27+
.disabled(!isEnabled)
28+
.accessibilityLabel("Add to conversation")
29+
.accessibilityIdentifier("add-to-conversation-button")
30+
}
31+
}
32+
33+
private var menuView: some View {
1134
Menu {
1235
Section {
1336
EmptyView()
@@ -47,7 +70,7 @@ struct AddToConversationMenu: View {
4770
}
4871
} label: {
4972
Image(systemName: "plus")
50-
.foregroundStyle(isFull ? .colorTextSecondary : .colorTextPrimary)
73+
.foregroundStyle(labelColor)
5174
}
5275
.disabled(!isEnabled)
5376
.accessibilityLabel("Add to conversation")

Convos/Conversation Detail/Conversation Detail Drawer/InviteAcceptedView.swift

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@ import SwiftUI
33
struct InviteAcceptedView: View {
44
@State private var showingDescription: Bool = false
55

6+
@Environment(\.openURL) private var openURL: OpenURLAction
7+
68
var body: some View {
7-
Group {
9+
Button {
10+
openURL(Constant.learnMoreURL)
11+
} label: {
812
VStack(spacing: DesignConstants.Spacing.step2x) {
913
HStack {
10-
Image(systemName: "checkmark.circle.fill")
14+
Image(systemName: "qrcode")
1115
.font(.footnote)
12-
.foregroundStyle(.colorGreen)
13-
Text("Invite accepted")
16+
.foregroundStyle(.colorLava)
17+
Text("Verifying")
1418
.foregroundStyle(.colorTextPrimary)
1519
}
1620
.font(.body)
1721

1822
if showingDescription {
19-
Text("See and send messages after someone approves you.")
23+
Text("See and send messages after your access is verified")
2024
.font(.caption)
2125
.foregroundStyle(.colorTextSecondary)
2226
.multilineTextAlignment(.center)
@@ -25,12 +29,14 @@ struct InviteAcceptedView: View {
2529
.transition(.blurReplace)
2630
.animation(.spring(duration: 0.4, bounce: 0.2), value: showingDescription)
2731
.padding(DesignConstants.Spacing.step6x)
32+
.frame(maxWidth: .infinity)
33+
.background(.colorFillMinimal)
34+
.clipShape(RoundedRectangle(cornerRadius: DesignConstants.CornerRadius.mediumLarge))
2835
}
29-
.frame(maxWidth: .infinity)
30-
.background(.colorFillMinimal)
31-
.clipShape(RoundedRectangle(cornerRadius: DesignConstants.CornerRadius.mediumLarge))
36+
.buttonStyle(.plain)
3237
.accessibilityElement(children: .combine)
33-
.accessibilityLabel("Invite accepted. See and send messages after someone approves you.")
38+
.accessibilityIdentifier("invite-accepted-view")
39+
.accessibilityLabel("Verifying. See and send messages after your access is verified.")
3440
.onAppear {
3541
DispatchQueue.main
3642
.asyncAfter(deadline: .now() + ConversationOnboardingState.waitingForInviteAcceptanceDelay) {
@@ -40,6 +46,11 @@ struct InviteAcceptedView: View {
4046
}
4147
}
4248
}
49+
50+
private enum Constant {
51+
// swiftlint:disable:next force_unwrapping
52+
static let learnMoreURL: URL = URL(string: "https://learn.convos.org/verifying")!
53+
}
4354
}
4455

4556
#Preview {

Convos/Conversation Detail/ConversationInfoView.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,6 @@ struct ConversationInfoView: View {
454454
}
455455
}
456456
)
457-
.fullScreenCover(isPresented: $presentingShareView) {
458-
ConversationShareView(conversation: viewModel.conversation, invite: viewModel.invite)
459-
.presentationBackground(.clear)
460-
}
461-
.transaction { transaction in
462-
transaction.disablesAnimations = true
463-
}
464457
.accessibilityIdentifier("info-add-button")
465458
}
466459
}
@@ -483,6 +476,16 @@ struct ConversationInfoView: View {
483476
showingFullInfo = false
484477
})
485478
}
479+
.overlay {
480+
if presentingShareView {
481+
ConversationShareOverlay(
482+
conversation: viewModel.conversation,
483+
invite: viewModel.invite,
484+
isPresented: $presentingShareView,
485+
topSafeAreaInset: 0
486+
)
487+
}
488+
}
486489
.background {
487490
Color.clear
488491
.fullScreenCover(isPresented: $showingExplodeSheet) {

Convos/Conversation Detail/ConversationOnboardingCoordinator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ final class ConversationOnboardingCoordinator {
544544
}
545545

546546
private func shouldShowAssistantHint() -> Bool {
547+
guard FeatureFlags.shared.isAssistantEnabled else { return false }
547548
guard isConversationCreator, let clientId = currentClientId else { return false }
548549
return !hasDismissedAssistantHint(for: clientId)
549550
}

0 commit comments

Comments
 (0)