feat(ios): rebuild the home sidebar v2
This commit is contained in:
3 files changed
+643
-746
No files matched your search
@@ -67,7 +67,10 @@ public final class FeatureRootModel {
|
||||
|
||||
public func disconnect() async {
|
||||
await client.disconnect()
|
||||
snapshot.connection = .init()
|
||||
snapshot = FeatureSnapshot(
|
||||
environments: snapshot.environments,
|
||||
settings: snapshot.settings
|
||||
)
|
||||
details.removeAll()
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public struct FeatureRootView: View {
|
||||
Group {
|
||||
if model.isLoading {
|
||||
FeatureLoadingView()
|
||||
} else if model.snapshot.connection.state != .disconnected {
|
||||
} else if shouldShowWorkspace {
|
||||
WorkspaceView(
|
||||
model: model,
|
||||
submitNewTask: { request in
|
||||
@@ -43,6 +43,14 @@ public struct FeatureRootView: View {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/// Keep the last-known workspace visible through a degraded connection.
|
||||
/// A deliberate disconnect clears workspace data and returns to onboarding.
|
||||
private var shouldShowWorkspace: Bool {
|
||||
model.snapshot.connection.state != .disconnected
|
||||
|| !model.snapshot.projects.isEmpty
|
||||
|| !model.snapshot.threads.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
private struct FeatureLoadingView: View {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user