Restrict contribution fields to detailed mode only
AddSnapshotView: restore inputMode == .detailed guard for contribution section. BatchUpdateView: show contribution field per row only when the source's account is configured with inputMode == .detailed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -990,6 +990,7 @@ struct BatchUpdateView: View {
|
||||
?? AppSettings.getOrCreate(in: CoreDataStack.shared.viewContext).currency
|
||||
let symbol = CurrencyFormatter.symbol(for: currencyCode)
|
||||
let previousValue = source.latestSnapshot?.decimalValue
|
||||
let isDetailed = InputMode(rawValue: source.account?.inputMode ?? "") == .detailed
|
||||
let valueBinding = Binding<String>(
|
||||
get: { values[source.id] ?? "" },
|
||||
set: { values[source.id] = $0 }
|
||||
@@ -1024,6 +1025,7 @@ struct BatchUpdateView: View {
|
||||
.background(Color.gray.opacity(0.08))
|
||||
.cornerRadius(8)
|
||||
|
||||
if isDetailed {
|
||||
HStack {
|
||||
Image(systemName: "plus.circle")
|
||||
.font(.caption)
|
||||
@@ -1037,6 +1039,7 @@ struct BatchUpdateView: View {
|
||||
.background(Color.appSecondary.opacity(0.06))
|
||||
.cornerRadius(8)
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 2)
|
||||
}
|
||||
|
||||
|
||||
@@ -499,6 +499,7 @@ struct AddSnapshotView: View {
|
||||
}
|
||||
}
|
||||
|
||||
if viewModel.inputMode == .detailed {
|
||||
Section {
|
||||
Toggle("Include Contribution", isOn: $viewModel.includeContribution)
|
||||
|
||||
@@ -516,6 +517,7 @@ struct AddSnapshotView: View {
|
||||
} footer: {
|
||||
Text("Track new capital added to separate it from investment growth.")
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
TextField("Notes", text: $viewModel.notes, axis: .vertical)
|
||||
|
||||
Reference in New Issue
Block a user