From 0d6748731e60c31f6ad01a92ec0b6b2984e0ef26 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 4 Nov 2026 12:57:28 +0100 Subject: [PATCH] AI: make the arrow history reachable, by a setting rather than by chance ArrowHistoryView's only call site selects it with `#if TALER_WALLET`, inside a view that only exists under `#if OIM`. From project.pbxproj the three app targets are GNU_TALER+OIM, TALER_NIGHTLY+OIM+USELAYOUT and TALER_WALLET+EMPTY, so no target defines both and the `#else` branch always wins: 512 lines are dead in every build. The file already has the idiom for choosing a history presentation -- `oimChart`, an @AppStorage toggle in More Settings -- so the arrow/river choice becomes a second one beside it, shown only when the chart is off, since it has no meaning otherwise. Default false, which is the river, so every shipped target draws exactly what it drew before and this changes no behaviour until someone turns it on. This is the option that preserves the code and makes it testable. If the arrow presentation is in fact unwanted, the alternative is to delete ArrowHistoryView.swift and the branch, which is a smaller diff -- that choice belongs to whoever knows whether it is still wanted, so it is not made here. Assisted by LLM --- TalerWallet1/Views/OIM/OIMtransactions.swift | 13 ++++++++----- TalerWallet1/Views/Settings/MoreSettingsView.swift | 6 ++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/TalerWallet1/Views/OIM/OIMtransactions.swift b/TalerWallet1/Views/OIM/OIMtransactions.swift index 444c057c..da40e1a2 100755 --- a/TalerWallet1/Views/OIM/OIMtransactions.swift +++ b/TalerWallet1/Views/OIM/OIMtransactions.swift @@ -56,7 +56,12 @@ struct OIMtransactions: View { @Environment(\.dismiss) var dismiss // pop back once @EnvironmentObject private var controller: Controller @EnvironmentObject private var wrapper: NamespaceWrapper - @AppStorage("oimChart") var oimChart: Bool = false // false = river + @AppStorage("oimChart") var oimChart: Bool = false // false = river or arrows + /// Which of the two non-chart history presentations to draw. Default + /// false = river, which is what every shipped target drew before, because + /// the arrow branch was selected by `#if TALER_WALLET` inside a view that + /// only exists under `#if OIM`, and no target defines both. + @AppStorage("oimArrows") var oimArrows: Bool = false @State private var availableVal: UInt64 = 0 @State private var available: Amount? = nil @@ -195,8 +200,7 @@ struct OIMtransactions: View { scrollBack: scrollBack, maxIndex: maxIndex, maxValue: chartMaxY) - } else { -#if TALER_WALLET + } else if oimArrows { ArrowHistoryView(stack: stack.push(), currency: cash.currency, shownItems: $shownItems, @@ -204,7 +208,7 @@ struct OIMtransactions: View { scrollBack: scrollBack, maxIndex: maxIndex, maxValue: chartMaxY) -#else + } else { RiverHistoryView(stack: stack.push(), currency: cash.currency, shownItems: $shownItems, @@ -212,7 +216,6 @@ struct OIMtransactions: View { scrollBack: scrollBack, maxIndex: maxIndex, maxValue: chartMaxY) -#endif } } sidePosition diff --git a/TalerWallet1/Views/Settings/MoreSettingsView.swift b/TalerWallet1/Views/Settings/MoreSettingsView.swift index e0739c35..73f83f97 100644 --- a/TalerWallet1/Views/Settings/MoreSettingsView.swift +++ b/TalerWallet1/Views/Settings/MoreSettingsView.swift @@ -33,6 +33,7 @@ struct MoreSettingsView: View { @AppStorage("preferredColorScheme") var preferredColorScheme: Int = 0 @AppStorage("oimEuro") var oimEuro: Bool = false @AppStorage("oimChart") var oimChart: Bool = false + @AppStorage("oimArrows") var oimArrows: Bool = false @AppStorage("payTokenAutomatically") var payTokenAutomatically: Bool = true @AppStorage("payMoneyAutomatically") var payMoneyAutomatically: Bool = false @@ -111,6 +112,11 @@ struct MoreSettingsView: View { SettingsToggle(name: String(localized: "OIM: Chart"), value: $oimChart, id1: "oimChart", description: String(localized: "OIM history as chart")) + if !oimChart { + SettingsToggle(name: String(localized: "OIM: Arrows"), value: $oimArrows, + id1: "oimArrows", + description: String(localized: "OIM history as arrows instead of a river")) + } } // OIM #endif } .listStyle(myListStyle.style).anyView -- 2.47.3