From 42de561085239fb95320fec712f57c543b2b46d8 Mon Sep 17 00:00:00 2001 From: maksarsanjeev Date: Sat, 10 Oct 2026 03:24:49 +0300 Subject: [PATCH] Memoji click opens the task manager directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The intermediate menu (Дела, пипетка, переводчик, кофе) is gone: those live in Func and the header. The popover is the «Дела» panel itself. Co-Authored-By: Claude Opus 5.5 --- NotchBuddy/Sources/App/Ops.swift | 62 ++++---------------------------- 1 file changed, 6 insertions(+), 56 deletions(-) diff --git a/NotchBuddy/Sources/App/Ops.swift b/NotchBuddy/Sources/App/Ops.swift index a739325..e0d5762 100644 --- a/NotchBuddy/Sources/App/Ops.swift +++ b/NotchBuddy/Sources/App/Ops.swift @@ -115,63 +115,16 @@ final class OpsClient: ObservableObject { var attentionCount: Int { agenda.overdue.count + agenda.today.count } } -// MARK: - Menu on the Memoji +// MARK: - Menu on the Memoji: the task manager struct BroMenu: View { @ObservedObject var state: AppState @ObservedObject private var ops = OpsClient.shared - @ObservedObject private var coffee = Coffee.shared - @State private var page = 0 // 0 = menu, 1 = «Дела» var body: some View { - Group { - if page == 1 { - OpsPanel(state: state, back: { withAnimation(.easeOut(duration: 0.15)) { page = 0 } }) - } else { - VStack(alignment: .leading, spacing: 2) { - FuncRow(symbol: "checklist", color: "#D97757", title: "Дела", - subtitle: opsSubtitle, hint: ops.attentionCount > 0 ? "\(ops.attentionCount)" : nil) { - withAnimation(.easeOut(duration: 0.15)) { page = 1 } - } - if let r = ops.agenda.running { - FuncRow(symbol: "stop.circle", color: "#F4505E", title: "Стоп таймер", - subtitle: "\(r.title) · \(r.minutes) мин", hint: nil) { - Task { await ops.act(["op": "stop_timer"]) } - } - } - Divider().padding(.vertical, 4) - FuncRow(symbol: "eyedropper", color: "#F472B6", title: "Пипетка", - subtitle: "цвет пикселя во всех форматах", hint: nil) { - state.botMenuOpen = false - ColorPicking.start(state: state) - } - FuncRow(symbol: "character.bubble", color: "#60A5FA", title: "Переводчик", - subtitle: "выделенный текст RU ↔ EN", hint: "⌥`") { - state.botMenuOpen = false - TranslatorRun.start(state: state) - } - FuncRow(symbol: coffee.on ? "cup.and.saucer.fill" : "cup.and.saucer", color: "#D97757", - title: coffee.on ? "Кофе: включён" : "Кофе-режим", - subtitle: coffee.on ? "Мак не засыпает — нажми, чтобы выключить" : "не давать Маку засыпать", - hint: nil) { - coffee.toggle() - } - } - .padding(8) - .frame(width: 290) - } - } - .notchPopoverStyle() - .task { await ops.refresh() } - } - - private var opsSubtitle: String { - guard ops.configured else { return "подключи сервис в Настройках → Чат" } - if ops.reachable == false { return "сервис не отвечает" } - let a = ops.agenda - if a.overdue.isEmpty && a.today.isEmpty { return a.soon.isEmpty ? "ничего не горит" : "на неделе: \(a.soon.count)" } - return [a.overdue.isEmpty ? nil : "просрочено \(a.overdue.count)", - a.today.isEmpty ? nil : "сегодня \(a.today.count)"].compactMap { $0 }.joined(separator: " · ") + OpsPanel(state: state) + .notchPopoverStyle() + .task { await ops.refresh() } } } @@ -179,7 +132,6 @@ struct BroMenu: View { struct OpsPanel: View { @ObservedObject var state: AppState - let back: () -> Void @ObservedObject private var ops = OpsClient.shared @State private var text = "" @FocusState private var focused: Bool @@ -187,10 +139,8 @@ struct OpsPanel: View { var body: some View { VStack(alignment: .leading, spacing: 8) { HStack(spacing: 6) { - Button(action: back) { - Image(systemName: "chevron.left").font(.system(size: 11, weight: .semibold)) - } - .buttonStyle(.plain) + Image(systemName: "checklist").font(.system(size: 12, weight: .semibold)) + .foregroundColor(Color(hex: "#D97757")) Text("Дела").font(.system(size: 14, weight: .semibold)) Spacer() if ops.busy { ProgressView().controlSize(.mini) }