From aceca8b5dfc8edd378ee9ff891bccb0f94c69f31 Mon Sep 17 00:00:00 2001 From: gigagamerchaddhruv-spec Date: Wed, 14 Oct 2026 20:18:20 +0530 Subject: feat: launch Bubomb - native macOS menu bar utility ('Configure the boom') --- Sources/BubombUI/Settings/SettingsView.swift | 95 ++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Sources/BubombUI/Settings/SettingsView.swift (limited to 'Sources/BubombUI/Settings/SettingsView.swift') diff --git a/Sources/BubombUI/Settings/SettingsView.swift b/Sources/BubombUI/Settings/SettingsView.swift new file mode 100644 index 0000000..02d2287 --- /dev/null +++ b/Sources/BubombUI/Settings/SettingsView.swift @@ -0,0 +1,95 @@ +import SwiftUI +import BubombCore + +/// Main Settings Window for Bubomb. +@MainActor +public struct SettingsView: View { + @ObservedObject var settingsStore: SettingsStore + @ObservedObject var executor: PayloadExecutor + + @State private var selectedTab: Int = 0 + + public init(settingsStore: SettingsStore = .shared, executor: PayloadExecutor? = nil) { + self.settingsStore = settingsStore + self.executor = executor ?? PayloadExecutor.shared + } + + public var body: some View { + VStack(spacing: 0) { + topTabBar + + Divider().background(BubombTheme.borderSubtle) + + Group { + switch selectedTab { + case 0: + PayloadEditorView(settingsStore: settingsStore, executor: executor) + case 1: + ExecutionStatusView(settingsStore: settingsStore, executor: executor) + case 2: + GeneralSettingsView(settingsStore: settingsStore) + default: + EmptyView() + } + } + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + .frame(minWidth: 620, idealWidth: 680, minHeight: 520, idealHeight: 580) + .background(BubombTheme.windowBackground) + } + + // MARK: - Top Tab Bar + + private var topTabBar: some View { + HStack(spacing: 16) { + HStack(spacing: 8) { + AnimatedBombView(size: 28, isDetonating: executor.currentState.isRunning) + Text("Bubomb") + .font(.headline.bold()) + .foregroundColor(BubombTheme.textPrimary) + } + .padding(.leading, 8) + + Spacer() + + Picker("", selection: $selectedTab) { + Label("Payload", systemImage: "flame.fill").tag(0) + Label("Execution", systemImage: "clock.arrow.circlepath").tag(1) + Label("General", systemImage: "gearshape.fill").tag(2) + } + .pickerStyle(.segmented) + .frame(width: 320) + .labelsHidden() + + Spacer() + + // Armed Status Pill + if settingsStore.settings.activePayload != nil { + HStack(spacing: 5) { + Circle().fill(BubombTheme.successGreen).frame(width: 6, height: 6) + Text("Armed") + .font(.caption2.bold()) + .foregroundColor(BubombTheme.successGreen) + } + .padding(.horizontal, 8) + .padding(.vertical, 4) + .background(BubombTheme.successGreen.opacity(0.12)) + .cornerRadius(12) + } else { + HStack(spacing: 5) { + Circle().fill(BubombTheme.accentAmber).frame(width: 6, height: 6) + Text("Unarmed") + .font(.caption2.bold()) + .foregroundColor(BubombTheme.accentAmber) + } + .padding(.horizontal, 8) + .padding(.vertical, 4) + .background(BubombTheme.accentAmber.opacity(0.12)) + .cornerRadius(12) + } + } + .padding(.horizontal, 16) + .padding(.vertical, 12) + .background(BubombTheme.surface) + } +} -- cgit v1.2.3