@@ -12,8 +12,7 @@ struct SettingsMenuView: View {
1212
1313 // MARK: – Local state
1414
15- @State private var showingTabCustomization = false
16- var onDismiss : ( ( ) -> Void ) ?
15+ var onBack : ( ( ) -> Void ) ?
1716
1817 // MARK: – Observed objects
1918
@@ -24,33 +23,40 @@ struct SettingsMenuView: View {
2423 var body : some View {
2524 NavigationStack ( path: $settingsPath. value) {
2625 List {
27- // ───────── Data settings ─────────
2826 dataSection
2927
30- // ───────── App settings ─────────
31- Section ( " App Settings " ) {
32- NavigationRow ( title: " Background Refresh " ,
33- icon: " arrow.clockwise " )
34- {
35- settingsPath. value. append ( Sheet . backgroundRefresh)
36- }
37-
28+ Section ( " Display Settings " ) {
3829 NavigationRow ( title: " General " ,
3930 icon: " gearshape " )
4031 {
4132 settingsPath. value. append ( Sheet . general)
4233 }
43-
4434 NavigationRow ( title: " Graph " ,
4535 icon: " chart.xyaxis.line " )
4636 {
4737 settingsPath. value. append ( Sheet . graph)
4838 }
4939
50- NavigationRow ( title: " Tab Settings " ,
40+ if !nightscoutURL. value. isEmpty {
41+ NavigationRow ( title: " Information Display " ,
42+ icon: " info.circle " )
43+ {
44+ settingsPath. value. append ( Sheet . infoDisplay)
45+ }
46+ }
47+
48+ NavigationRow ( title: " Tabs " ,
5149 icon: " rectangle.3.group " )
5250 {
53- showingTabCustomization = true
51+ settingsPath. value. append ( Sheet . tabSettings)
52+ }
53+ }
54+
55+ Section ( " App Settings " ) {
56+ NavigationRow ( title: " Background Refresh " ,
57+ icon: " arrow.clockwise " )
58+ {
59+ settingsPath. value. append ( Sheet . backgroundRefresh)
5460 }
5561
5662 NavigationRow ( title: " Import/Export " ,
@@ -60,12 +66,6 @@ struct SettingsMenuView: View {
6066 }
6167
6268 if !nightscoutURL. value. isEmpty {
63- NavigationRow ( title: " Information Display " ,
64- icon: " info.circle " )
65- {
66- settingsPath. value. append ( Sheet . infoDisplay)
67- }
68-
6969 NavigationRow ( title: " Remote " ,
7070 icon: " antenna.radiowaves.left.and.right " )
7171 {
@@ -74,7 +74,6 @@ struct SettingsMenuView: View {
7474 }
7575 }
7676
77- // ───────── Alarms ─────────
7877 Section ( " Alarms " ) {
7978 NavigationRow ( title: " Alarms " ,
8079 icon: " bell.badge " )
@@ -83,7 +82,6 @@ struct SettingsMenuView: View {
8382 }
8483 }
8584
86- // ───────── Integrations ─────────
8785 Section ( " Integrations " ) {
8886 NavigationRow ( title: " Calendar " ,
8987 icon: " calendar " )
@@ -98,7 +96,6 @@ struct SettingsMenuView: View {
9896 }
9997 }
10098
101- // ───────── Advanced ─────────
10299 Section ( " Advanced Settings " ) {
103100 NavigationRow ( title: " Advanced " ,
104101 icon: " exclamationmark.shield " )
@@ -108,24 +105,17 @@ struct SettingsMenuView: View {
108105 }
109106 }
110107 . navigationTitle ( " Settings " )
108+ . navigationBarTitleDisplayMode ( . large)
111109 . navigationDestination ( for: Sheet . self) { $0. destination }
112110 . toolbar {
113- if let onDismiss {
114- ToolbarItem ( placement: . navigationBarTrailing ) {
115- Button ( action: onDismiss ) {
116- Image ( systemName: " checkmark " )
111+ if let onBack {
112+ ToolbarItem ( placement: . navigationBarLeading ) {
113+ Button ( action: onBack ) {
114+ Image ( systemName: " chevron.left " )
117115 }
118116 }
119117 }
120118 }
121- . sheet ( isPresented: $showingTabCustomization) {
122- TabCustomizationModal (
123- isPresented: $showingTabCustomization,
124- onApply: {
125- // No-op - changes are applied silently via observers
126- }
127- )
128- }
129119 }
130120 }
131121
@@ -157,11 +147,6 @@ struct SettingsMenuView: View {
157147 }
158148 }
159149 }
160-
161- private func handleTabReorganization( ) {
162- // Rebuild the tab bar with the new configuration
163- MainViewController . rebuildTabsIfNeeded ( )
164- }
165150}
166151
167152// MARK: – Sheet routing
@@ -170,6 +155,7 @@ private enum Sheet: Hashable, Identifiable {
170155 case nightscout, dexcom
171156 case backgroundRefresh
172157 case general, graph
158+ case tabSettings
173159 case infoDisplay
174160 case alarmSettings
175161 case remote
@@ -188,6 +174,7 @@ private enum Sheet: Hashable, Identifiable {
188174 case . backgroundRefresh: BackgroundRefreshSettingsView ( viewModel: . init( ) )
189175 case . general: GeneralSettingsView ( )
190176 case . graph: GraphSettingsView ( )
177+ case . tabSettings: TabCustomizationModal ( )
191178 case . infoDisplay: InfoDisplaySettingsView ( viewModel: . init( ) )
192179 case . alarmSettings: AlarmSettingsView ( )
193180 case . remote: RemoteSettingsView ( viewModel: . init( ) )
0 commit comments