Bottom Tab Bar Visibility Adjustment
Nucleic-Session: 747527BF-AEE9-4939-BE70-A14F1F3BBBA8 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -46,9 +46,7 @@ struct ProjectsView: View {
|
|||||||
struct ProjectDetailView: View {
|
struct ProjectDetailView: View {
|
||||||
@EnvironmentObject var store: RemoteStore
|
@EnvironmentObject var store: RemoteStore
|
||||||
let project: WireProject
|
let project: WireProject
|
||||||
@State private var draft = ""
|
@State private var showNewChat = false
|
||||||
@State private var model: String?
|
|
||||||
@State private var effort = MobileEfforts.fallback
|
|
||||||
|
|
||||||
private var sessions: [WireSessionSummary] {
|
private var sessions: [WireSessionSummary] {
|
||||||
store.liveSessions
|
store.liveSessions
|
||||||
@@ -58,27 +56,6 @@ struct ProjectDetailView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List {
|
List {
|
||||||
Section {
|
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
|
||||||
HStack {
|
|
||||||
ModelMenu(model: $model, catalog: store.modelCatalog, backend: nil)
|
|
||||||
Spacer()
|
|
||||||
EffortMenu(effort: $effort, catalog: store.modelCatalog, modelSKU: model,
|
|
||||||
controlled: project.isNucleicControlled)
|
|
||||||
}
|
|
||||||
HStack(alignment: .bottom, spacing: 8) {
|
|
||||||
TextField("Start a chat in \(project.name)…", text: $draft, axis: .vertical)
|
|
||||||
.textFieldStyle(.roundedBorder).lineLimit(1...4)
|
|
||||||
.orchestraGlow(active: MobileEfforts.isOrchestra(effort) && project.isNucleicControlled)
|
|
||||||
.keyboardDismissable()
|
|
||||||
Button {
|
|
||||||
store.startChat(in: project.id, message: draft, model: model, effort: effort)
|
|
||||||
draft = ""
|
|
||||||
} label: { Image(systemName: "arrow.up.circle.fill").font(.title2) }
|
|
||||||
.disabled(draft.trimmingCharacters(in: .whitespaces).isEmpty || !store.canControl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Section("Sessions") {
|
Section("Sessions") {
|
||||||
if sessions.isEmpty {
|
if sessions.isEmpty {
|
||||||
Text("No sessions yet.").foregroundStyle(.secondary)
|
Text("No sessions yet.").foregroundStyle(.secondary)
|
||||||
@@ -93,12 +70,8 @@ struct ProjectDetailView: View {
|
|||||||
.navigationTitle(project.name)
|
.navigationTitle(project.name)
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.scrollDismissesKeyboard(.interactively)
|
.scrollDismissesKeyboard(.interactively)
|
||||||
.onChange(of: model) { _, newModel in
|
// A floating "+" scoped to this project — the glass composer sheet opens pre-locked to it,
|
||||||
let levels = store.modelCatalog.offeredEfforts(forModel: newModel)
|
// replacing the old inline start-chat card at the top of the page.
|
||||||
let sentinel = store.modelCatalog.orchestraSentinelOrFallback
|
.newChatAffordance(project: project, isPresented: $showNewChat)
|
||||||
if effort.caseInsensitiveCompare(sentinel) != .orderedSame, !levels.contains(effort) {
|
|
||||||
effort = levels.last ?? MobileEfforts.fallback
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user