Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,8 @@ final class SpaceHubCoordinatorViewModel: ObservableObject, SpaceHubModuleOutput

currentSpaceId = spaceId

if FeatureFlags.spaceLoadingForScreen {
// This is not required. But it help to load space as fast as possible
Task { try await activeSpaceManager.setActiveSpace(spaceId: spaceId) }
} else {
try await activeSpaceManager.setActiveSpace(spaceId: spaceId)
}
// This is not required. But it help to load space as fast as possible
Task { try await activeSpaceManager.setActiveSpace(spaceId: spaceId) }

return spaceView
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ final class SpaceHubViewModel: ObservableObject {

@Injected(\.userDefaultsStorage)
private var userDefaults: any UserDefaultsStorageProtocol
@Injected(\.activeSpaceManager)
private var activeSpaceManager: any ActiveSpaceManagerProtocol
@Injected(\.workspaceStorage)
private var workspacesStorage: any WorkspacesStorageProtocol
@Injected(\.spaceOrderService)
Expand Down Expand Up @@ -65,15 +63,8 @@ final class SpaceHubViewModel: ObservableObject {
}

func onSpaceTap(spaceId: String) {
if FeatureFlags.spaceLoadingForScreen {
output?.onSelectSpace(spaceId: spaceId)
UISelectionFeedbackGenerator().selectionChanged()
} else {
Task {
try await activeSpaceManager.setActiveSpace(spaceId: spaceId)
UISelectionFeedbackGenerator().selectionChanged()
}
}
output?.onSelectSpace(spaceId: spaceId)
UISelectionFeedbackGenerator().selectionChanged()
}


Expand Down Expand Up @@ -145,9 +136,7 @@ final class SpaceHubViewModel: ObservableObject {
private func subscribeOnSpaces() async {
for await spaces in await spaceHubSpacesStorage.spacesStream {
self.spaces = spaces.sorted(by: sortSpacesForPinnedFeature)
if FeatureFlags.spaceLoadingForScreen {
showLoading = spaces.contains { $0.spaceView.isLoading }
}
showLoading = spaces.contains { $0.spaceView.isLoading }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ struct NewSpaceCardLabel: View {

var body: some View {
content
// Delete this line with FeatureFlags.spaceLoadingForScreen
.if(spaceData.spaceView.isLoading && !FeatureFlags.spaceLoadingForScreen) { $0.redacted(reason: .placeholder) }

.if(spaceData.spaceView.isPinned) {
$0.onDrag {
draggedSpace = spaceData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ struct SpaceCard: View, @preconcurrency Equatable {
)
}
}
.disabled(FeatureFlags.spaceLoadingForScreen ? false : spaceData.spaceView.isLoading)
.contentShape([.dragPreview, .contextMenuPreview], RoundedRectangle(cornerRadius: 20, style: .continuous))
.contextMenu { menuItems.tint(Color.Text.primary) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ struct SpaceCardLabel: View {
// Optimization for fast sizeThatFits
.frame(height: 80)
.background(Color.Background.primary)
// Delete this line with FeatureFlags.spaceLoadingForScreen
.if(spaceData.spaceView.isLoading && !FeatureFlags.spaceLoadingForScreen) { $0.redacted(reason: .placeholder) }
.contentShape([.dragPreview, .contextMenuPreview], RoundedRectangle(cornerRadius: 20, style: .continuous))

.if(spaceData.spaceView.isPinned) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,11 @@ actor ActiveSpaceManager: ActiveSpaceManagerProtocol, Sendable {
// MARK: - Private

private func handleSpaces(workspaces: [SpaceView]) async {
if FeatureFlags.spaceLoadingForScreen {
guard let activeSpaceId,
let currentView = workspaces.first(where: { $0.targetSpaceId == activeSpaceId }),
(currentView.isLoading && spaceIsLoading) || currentView.isActive else {
_ = try? await setActiveSpace(spaceId: nil)
return
}
} else {
let spaceIds = workspaces.map(\.targetSpaceId)
guard let activeSpaceId, spaceIds.contains(activeSpaceId) else {
_ = try? await setActiveSpace(spaceId: nil)
return
}
guard let activeSpaceId,
let currentView = workspaces.first(where: { $0.targetSpaceId == activeSpaceId }),
(currentView.isLoading && spaceIsLoading) || currentView.isActive else {
_ = try? await setActiveSpace(spaceId: nil)
return
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
public extension FeatureFlags {

// Static value reader
static var spaceLoadingForScreen: Bool {
value(for: .spaceLoadingForScreen)
}

static var binScreenEmptyAction: Bool {
value(for: .binScreenEmptyAction)
}
Expand Down Expand Up @@ -148,7 +144,6 @@ public extension FeatureFlags {

// All toggles
static let features: [FeatureDescription] = [
.spaceLoadingForScreen,
.binScreenEmptyAction,
.muteSpacePossibility,
.addNotificationsSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import Foundation

public extension FeatureDescription {

static let spaceLoadingForScreen = FeatureDescription(
title: "Space Loading State Inside Screen",
type: .feature(author: "[email protected]", releaseVersion: "13"),
defaultValue: true
)

static let binScreenEmptyAction = FeatureDescription(
title: "Bin screen - empty action",
type: .feature(author: "[email protected]", releaseVersion: "13"),
Expand Down