From c4307fbaf1afc12218cdf8e843e1e669acd59b7d Mon Sep 17 00:00:00 2001 From: nimbold <11913706+nimbold@users.noreply.github.com> Date: Wed, 3 Jun 2026 04:20:41 +0330 Subject: [PATCH] chore: organize settings sections --- Sources/Firelink/SettingsView.swift | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Sources/Firelink/SettingsView.swift b/Sources/Firelink/SettingsView.swift index 05cd18d..fb9b857 100644 --- a/Sources/Firelink/SettingsView.swift +++ b/Sources/Firelink/SettingsView.swift @@ -3,13 +3,23 @@ import SwiftUI private enum SettingsSection: String, CaseIterable, Hashable { case downloads = "Downloads" - case network = "Network" case locations = "Locations" + case network = "Network" case siteLogins = "Site Logins" case power = "Power" case engine = "Engine" case about = "About" + static let orderedCases: [SettingsSection] = [ + .downloads, + .locations, + .network, + .siteLogins, + .power, + .engine, + .about + ] + var symbolName: String { switch self { case .downloads: "arrow.down.circle" @@ -24,7 +34,7 @@ private enum SettingsSection: String, CaseIterable, Hashable { var groupTitle: String { switch self { - case .about: + case .engine, .about: "App" default: "Preferences" @@ -64,14 +74,14 @@ struct SettingsView: View { private var settingsSidebar: some View { List(selection: $selection) { Section("Preferences") { - ForEach(SettingsSection.allCases.filter { $0.groupTitle == "Preferences" }, id: \.self) { section in + ForEach(SettingsSection.orderedCases.filter { $0.groupTitle == "Preferences" }, id: \.self) { section in Label(section.rawValue, systemImage: section.symbolName) .tag(section) } } Section("App") { - ForEach(SettingsSection.allCases.filter { $0.groupTitle == "App" }, id: \.self) { section in + ForEach(SettingsSection.orderedCases.filter { $0.groupTitle == "App" }, id: \.self) { section in Label(section.rawValue, systemImage: section.symbolName) .tag(section) }