From 91041af60b5a98ef01f5588478302c1ef04e043d Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 20 Jul 2026 14:16:52 -0500 Subject: fix: Generate Now tap target, remove keyboard dismiss button and launch focus Scheduled Reports: the entire Overview section was wrapped in a single VStack inside one List row, so SwiftUI collapsed every control into one tap target and the menu-style Cadence Picker captured taps intended for the Generate Now button. Unwraps the VStack so each control is its own row, matching the pattern used in IntegrationsView and elsewhere. Also extends the .automatedMonitoring gate to the two Pickers and the Generate Now button. Previously only the Toggle was disabled, leaving a button that appeared active on Free but silently no-opped against the guard in ScheduledReportService. Inspect tab: removes the keyboard toolbar's Dismiss Keyboard button and the onAppear that focused the single-domain field at launch. --- .../xcschemes/xcschememanagement.plist | 4 +- DomainDig/ContentView.swift | 10 --- DomainDig/ScheduledReportsView.swift | 95 +++++++++++----------- 3 files changed, 49 insertions(+), 60 deletions(-) diff --git a/DomainDig.xcodeproj/xcuserdata/cmc.xcuserdatad/xcschemes/xcschememanagement.plist b/DomainDig.xcodeproj/xcuserdata/cmc.xcuserdatad/xcschemes/xcschememanagement.plist index cb3b8b8..5f600f0 100644 --- a/DomainDig.xcodeproj/xcuserdata/cmc.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/DomainDig.xcodeproj/xcuserdata/cmc.xcuserdatad/xcschemes/xcschememanagement.plist @@ -12,12 +12,12 @@ DomainDigShareExtension.xcscheme_^#shared#^_ orderHint - 2 + 1 DomainDigWidgetExtension.xcscheme_^#shared#^_ orderHint - 1 + 2 SuppressBuildableAutocreation diff --git a/DomainDig/ContentView.swift b/DomainDig/ContentView.swift index 8f4eada..3e1015d 100644 --- a/DomainDig/ContentView.swift +++ b/DomainDig/ContentView.swift @@ -186,21 +186,11 @@ struct ContentView: View { } } } - - ToolbarItemGroup(placement: .keyboard) { - Spacer() - Button("Dismiss Keyboard") { - focusedInputField = nil - } - } } .navigationDestination(for: WorkflowNavigationTarget.self) { target in WorkflowDetailView(viewModel: viewModel, workflowID: target.workflowID) } } - .onAppear { - focusedInputField = .singleDomain - } .task { await viewModel.refreshUsageCredits() } diff --git a/DomainDig/ScheduledReportsView.swift b/DomainDig/ScheduledReportsView.swift index f97ee77..170e02d 100644 --- a/DomainDig/ScheduledReportsView.swift +++ b/DomainDig/ScheduledReportsView.swift @@ -10,63 +10,62 @@ struct ScheduledReportsView: View { var body: some View { List { Section("Overview") { - VStack(alignment: .leading, spacing: 8) { - if !FeatureAccessService.hasAccess(to: .automatedMonitoring) { - Text("Scheduled reports require Pro.") - .font(appDensity.font(.caption)) - .foregroundStyle(.secondary) - } + if !FeatureAccessService.hasAccess(to: .automatedMonitoring) { + Text("Scheduled reports require Pro.") + .font(appDensity.font(.caption)) + .foregroundStyle(.secondary) + } - Toggle("Scheduled Reports", isOn: Binding( - get: { settings.isEnabled }, - set: { newValue in - settings.isEnabled = newValue - saveSettings() - } - )) - .disabled(!FeatureAccessService.hasAccess(to: .automatedMonitoring)) + Toggle("Scheduled Reports", isOn: Binding( + get: { settings.isEnabled }, + set: { newValue in + settings.isEnabled = newValue + saveSettings() + } + )) + .disabled(!FeatureAccessService.hasAccess(to: .automatedMonitoring)) - Picker("Cadence", selection: Binding( - get: { settings.cadence }, - set: { newValue in - settings.cadence = newValue - saveSettings() - } - )) { - ForEach(ScheduledReportCadence.allCases) { cadence in - Text(cadence.title).tag(cadence) - } + Picker("Cadence", selection: Binding( + get: { settings.cadence }, + set: { newValue in + settings.cadence = newValue + saveSettings() } + )) { + ForEach(ScheduledReportCadence.allCases) { cadence in + Text(cadence.title).tag(cadence) + } + } + .disabled(!FeatureAccessService.hasAccess(to: .automatedMonitoring)) - Picker("Format", selection: Binding( - get: { settings.format }, - set: { newValue in - settings.format = newValue - saveSettings() - } - )) { - ForEach([DomainExportFormat.markdown, .pdf, .json]) { format in - Text(format.title).tag(format) - } + Picker("Format", selection: Binding( + get: { settings.format }, + set: { newValue in + settings.format = newValue + saveSettings() } + )) { + ForEach([DomainExportFormat.markdown, .pdf, .json]) { format in + Text(format.title).tag(format) + } + } + .disabled(!FeatureAccessService.hasAccess(to: .automatedMonitoring)) - LabeledContent( - "Last Generated", - value: settings.lastGeneratedAt?.formatted(date: .abbreviated, time: .shortened) ?? "Never" - ) + LabeledContent( + "Last Generated", + value: settings.lastGeneratedAt?.formatted(date: .abbreviated, time: .shortened) ?? "Never" + ) - if let statusMessage { - Text(statusMessage) - .font(appDensity.font(.caption)) - .foregroundStyle(.secondary) - } + if let statusMessage { + Text(statusMessage) + .font(appDensity.font(.caption)) + .foregroundStyle(.secondary) + } - Button(isGenerating ? "Generating…" : "Generate Now") { - Task { await generateNow() } - } - .disabled(isGenerating) + Button(isGenerating ? "Generating…" : "Generate Now") { + Task { await generateNow() } } - .padding(.vertical, 4) + .disabled(isGenerating || !FeatureAccessService.hasAccess(to: .automatedMonitoring)) } .listRowBackground(Color(.systemGray6).opacity(0.5)) -- cgit v1.2.3