diff --git a/ios/Packages/Sybil/Sources/Sybil/SplitView.swift b/ios/Packages/Sybil/Sources/Sybil/SplitView.swift index 460ef3a..8bb6681 100644 --- a/ios/Packages/Sybil/Sources/Sybil/SplitView.swift +++ b/ios/Packages/Sybil/Sources/Sybil/SplitView.swift @@ -25,7 +25,6 @@ public struct SplitView: View { } else { NavigationSplitView { SybilSidebarView(viewModel: viewModel) - .navigationTitle("Sybil") } detail: { SybilWorkspaceView(viewModel: viewModel) } diff --git a/ios/Packages/Sybil/Sources/Sybil/SybilWorkspaceView.swift b/ios/Packages/Sybil/Sources/Sybil/SybilWorkspaceView.swift index e792065..328bab6 100644 --- a/ios/Packages/Sybil/Sources/Sybil/SybilWorkspaceView.swift +++ b/ios/Packages/Sybil/Sources/Sybil/SybilWorkspaceView.swift @@ -3,13 +3,8 @@ import SwiftUI struct SybilWorkspaceView: View { @Bindable var viewModel: SybilViewModel - @Environment(\.horizontalSizeClass) private var horizontalSizeClass @FocusState private var composerFocused: Bool - private var isCompact: Bool { - horizontalSizeClass == .compact - } - private var isSettingsSelected: Bool { if case .settings = viewModel.selectedItem { return true @@ -18,7 +13,7 @@ struct SybilWorkspaceView: View { } private var showsHeader: Bool { - !isCompact || viewModel.errorMessage != nil + viewModel.errorMessage != nil } var body: some View { @@ -55,20 +50,23 @@ struct SybilWorkspaceView: View { composerBar } } - .navigationTitle(isCompact ? "" : viewModel.selectedTitle) + .navigationTitle("") + .navigationBarTitleDisplayMode(.inline) .toolbar { - if isCompact { - ToolbarItem(placement: .principal) { - Text(viewModel.selectedTitle) - .font(.sybil(.headline, weight: .semibold)) - .foregroundStyle(SybilTheme.text) - .lineLimit(1) - } + ToolbarItem(placement: .principal) { + Text(viewModel.selectedTitle) + .font(.sybil(.headline, weight: .semibold)) + .foregroundStyle(SybilTheme.text) + .lineLimit(1) } - if isCompact && !viewModel.isSearchMode && !isSettingsSelected { + if !isSettingsSelected { ToolbarItem(placement: .topBarTrailing) { - compactProviderModelMenu + if viewModel.isSearchMode { + searchModeChip + } else { + providerModelMenu + } } } } @@ -83,30 +81,6 @@ struct SybilWorkspaceView: View { private var header: some View { VStack(alignment: .leading, spacing: 12) { - if !isCompact { - HStack(alignment: .top, spacing: 12) { - Spacer() - - if !viewModel.isSearchMode && !isSettingsSelected { - providerControls - } else if viewModel.isSearchMode { - Label("Search mode", systemImage: "globe") - .font(.sybil(.caption, weight: .medium)) - .foregroundStyle(SybilTheme.accent) - .padding(.horizontal, 10) - .padding(.vertical, 7) - .background( - RoundedRectangle(cornerRadius: 10) - .fill(SybilTheme.accent.opacity(0.10)) - .overlay( - RoundedRectangle(cornerRadius: 10) - .stroke(SybilTheme.accent.opacity(0.24), lineWidth: 1) - ) - ) - } - } - } - if let error = viewModel.errorMessage { Text(error) .font(.sybil(.footnote)) @@ -119,7 +93,7 @@ struct SybilWorkspaceView: View { .background(SybilTheme.panelGradient.opacity(0.58)) } - private var compactProviderModelMenu: some View { + private var providerModelMenu: some View { Menu { Text("\(viewModel.provider.displayName) • \(viewModel.model)") .font(.sybil(.caption)) @@ -163,55 +137,20 @@ struct SybilWorkspaceView: View { .accessibilityLabel("Provider and model") } - private var providerControls: some View { - HStack(spacing: 8) { - Menu { - ForEach(Provider.allCases, id: \.self) { candidate in - Button(candidate.displayName) { - viewModel.setProvider(candidate) - } - } - } label: { - Label(viewModel.provider.displayName, systemImage: "chevron.down") - .labelStyle(.titleAndIcon) - .font(.sybil(.caption, weight: .medium)) - .foregroundStyle(SybilTheme.text) - .padding(.horizontal, 10) - .padding(.vertical, 7) - .background( - RoundedRectangle(cornerRadius: 10) - .fill(SybilTheme.surface.opacity(0.78)) - .overlay( - RoundedRectangle(cornerRadius: 10) - .stroke(SybilTheme.border.opacity(0.88), lineWidth: 1) - ) + private var searchModeChip: some View { + Label("Search", systemImage: "globe") + .font(.sybil(.caption, weight: .medium)) + .foregroundStyle(SybilTheme.accent) + .padding(.horizontal, 10) + .padding(.vertical, 7) + .background( + Capsule() + .fill(SybilTheme.accent.opacity(0.10)) + .overlay( + Capsule() + .stroke(SybilTheme.accent.opacity(0.24), lineWidth: 1) ) - } - - Menu { - ForEach(viewModel.providerModelOptions, id: \.self) { model in - Button(model) { - viewModel.setModel(model) - } - } - } label: { - Label(viewModel.model, systemImage: "chevron.down") - .labelStyle(.titleAndIcon) - .font(.sybil(.caption, weight: .medium)) - .foregroundStyle(SybilTheme.text) - .lineLimit(1) - .padding(.horizontal, 10) - .padding(.vertical, 7) - .background( - RoundedRectangle(cornerRadius: 10) - .fill(SybilTheme.surface.opacity(0.78)) - .overlay( - RoundedRectangle(cornerRadius: 10) - .stroke(SybilTheme.border.opacity(0.88), lineWidth: 1) - ) - ) - } - } + ) } private var composerBar: some View {