Skip to content

Commit c9e4af5

Browse files
authored
Merge pull request #4216 from anyproto/ios-5072-enable-feature-toggles
Ios 5072 enable feature toggles
2 parents 9e29de3 + e9b1340 commit c9e4af5

File tree

8 files changed

+13
-161
lines changed

8 files changed

+13
-161
lines changed

Anytype/Sources/PresentationLayer/Modules/HomeNavigationContainer/Panel/HomeBottomNavigationPanelView.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,11 @@ private struct HomeBottomNavigationPanelViewInternal: View {
9999
Label(Loc.photos, systemImage: "photo")
100100
}
101101

102-
if FeatureFlags.loadAttachmentsOnHomePlusMenu {
103-
Button { model.onCameraSelected() } label: {
104-
Label(Loc.camera, systemImage: "camera")
105-
}
106-
Button { model.onAddFilesSelected() } label: {
107-
Label(Loc.files, systemImage: "doc")
108-
}
102+
Button { model.onCameraSelected() } label: {
103+
Label(Loc.camera, systemImage: "camera")
104+
}
105+
Button { model.onAddFilesSelected() } label: {
106+
Label(Loc.files, systemImage: "doc")
109107
}
110108

111109
Divider()

Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCard/NewSpaceCardLabel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import SwiftUI
22
import AnytypeCore
33

4-
// SpaceCardLabel and SpaceCard are splitted for better SwiftUI diff.
4+
// NewSpaceCardLabel and SpaceCard are splitted for better SwiftUI diff.
55
struct NewSpaceCardLabel: View {
66

77
let model: SpaceCardModel

Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCard/SpaceCard.swift

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,14 @@ struct SpaceCard: View {
1313
let onTapSettings: () -> Void
1414
let onTapDelete: () -> Void
1515

16-
@State private var vaultBackToRootsToggle = FeatureFlags.vaultBackToRoots
17-
1816
var body: some View {
1917
Button {
2018
onTap()
2119
} label: {
22-
if !vaultBackToRootsToggle {
23-
SpaceCardLabel(
24-
model: model,
25-
draggedSpaceViewId: $draggedSpaceViewId
26-
)
27-
} else {
28-
NewSpaceCardLabel(
29-
model: model,
30-
draggedSpaceViewId: $draggedSpaceViewId
31-
)
32-
}
20+
NewSpaceCardLabel(
21+
model: model,
22+
draggedSpaceViewId: $draggedSpaceViewId
23+
)
3324
}
3425
.contentShape([.dragPreview, .contextMenuPreview], RoundedRectangle(cornerRadius: 20, style: .continuous))
3526
.contextMenu { menuItems.tint(Color.Text.primary) }

Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCard/SpaceCardLabel.swift

Lines changed: 0 additions & 99 deletions
This file was deleted.

Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceHubList.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ struct SpaceHubList: View {
88

99
@State private var draggedSpaceViewId: String?
1010
@State private var draggedInitialIndex: Int?
11-
@State private var vaultBackToRootsToggle = FeatureFlags.vaultBackToRoots
12-
11+
1312
var body: some View {
1413
if model.filteredSpaces.isEmpty && model.searchText.isEmpty {
1514
emptyStateView
@@ -22,7 +21,7 @@ struct SpaceHubList: View {
2221

2322
private var scrollView: some View {
2423
ScrollView {
25-
VStack(spacing: vaultBackToRootsToggle ? 8 : 0) {
24+
VStack(spacing: 8) {
2625
HomeUpdateSubmoduleView().padding(8)
2726

2827
ForEach(model.filteredSpaces) {
@@ -68,7 +67,7 @@ struct SpaceHubList: View {
6867
model.onDeleteSpace(spaceId: cardModel.targetSpaceId)
6968
}
7069
)
71-
.padding(.horizontal, vaultBackToRootsToggle ? 16 : 0)
70+
.padding(.horizontal, 16)
7271
.onDropIf(
7372
cardModel.isPinned,
7473
of: [.text],

Anytype/Sources/PresentationLayer/TextEditor/EditorPage/EditorPageController.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,6 @@ private extension EditorPageController {
563563
for: indexPath,
564564
item: block
565565
)
566-
567-
if !FeatureFlags.fixCollectionViewReuseCrashInEditor {
568-
cell.contentConfiguration = block.makeContentConfiguration(maxWidth: collectionView.frame.width)
569-
}
570566
case let .header(header):
571567
return collectionView.dequeueConfiguredReusableCell(
572568
using: headerCellRegistration,

Modules/AnytypeCore/AnytypeCore/Generated/FeatureFlags+Flags.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
public extension FeatureFlags {
77

88
// Static value reader
9-
static var fixCollectionViewReuseCrashInEditor: Bool {
10-
value(for: .fixCollectionViewReuseCrashInEditor)
11-
}
12-
13-
static var loadAttachmentsOnHomePlusMenu: Bool {
14-
value(for: .loadAttachmentsOnHomePlusMenu)
15-
}
16-
17-
static var vaultBackToRoots: Bool {
18-
value(for: .vaultBackToRoots)
19-
}
20-
219
static var showAllButtonInWidgets: Bool {
2210
value(for: .showAllButtonInWidgets)
2311
}
@@ -116,9 +104,6 @@ public extension FeatureFlags {
116104

117105
// All toggles
118106
static let features: [FeatureDescription] = [
119-
.fixCollectionViewReuseCrashInEditor,
120-
.loadAttachmentsOnHomePlusMenu,
121-
.vaultBackToRoots,
122107
.showAllButtonInWidgets,
123108
.turnOffAutomaticWidgetOpening,
124109
.channelTypeSwitcher,

Modules/AnytypeCore/AnytypeCore/Utils/FeatureFlags/FeatureDescription+Flags.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@ import Foundation
44

55
public extension FeatureDescription {
66

7-
static let fixCollectionViewReuseCrashInEditor = FeatureDescription(
8-
title: "Attempt to fix collection view reuse crash in Editor",
9-
type: .feature(author: "joe_pusya@anytype.io", releaseVersion: "13"),
10-
defaultValue: true
11-
)
12-
13-
static let loadAttachmentsOnHomePlusMenu = FeatureDescription(
14-
title: "Possibility to load attachments on home + menu",
15-
type: .feature(author: "joe_pusya@anytype.io", releaseVersion: "13"),
16-
defaultValue: true
17-
)
18-
19-
static let vaultBackToRoots = FeatureDescription(
20-
title: "New old design of vault cells",
21-
type: .feature(author: "vova@anytype.io", releaseVersion: "13"),
22-
defaultValue: true
23-
)
24-
257
static let showAllButtonInWidgets = FeatureDescription(
268
title: "See all as the last point in the widget - IOS-4945",
279
type: .feature(author: "m@anytype.io", releaseVersion: "13.5"),

0 commit comments

Comments
 (0)