From f16c6d4c967b9119cd96f3bf9aa3b158bba378c1 Mon Sep 17 00:00:00 2001 From: offyotto Date: Sat, 6 Jun 2026 04:15:06 +0500 Subject: [PATCH 1/5] fix: remove stale /etc/hosts references from changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0ea4b..d44d25b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,6 @@ ## 1.0.0 - 2026-06-04 - Initial GitHub-ready release. -- Added real `/etc/hosts` apply and revert flow through a bundled privileged helper. -- Added managed-block replacement, backups, and DNS cache flushing. -- Added SwiftUI app shell with sidebar contexts, hosts editor, settings, menu bar access, import/export, and notarization scripts. +- DNS Proxy Network Extension for applying host mappings without editing system files. +- App Group shared configuration between main app and DNS proxy extension. +- SwiftUI app shell with sidebar contexts, hosts editor, settings, menu bar access, import/export, and notarization scripts. From 8ea90a494059d92906d05e23e76895ff99703cf9 Mon Sep 17 00:00:00 2001 From: offyotto Date: Sat, 6 Jun 2026 04:15:21 +0500 Subject: [PATCH 2/5] fix: remove stale /etc/hosts safety guidance from contributing guide --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 550bf9b..f372364 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,5 +31,4 @@ Run the app locally with: ## Safety -Locale edits `/etc/hosts`, so changes to `SystemApplyService` should be reviewed carefully. The app must preserve all content outside its managed block and keep creating backups before writes. - +Locale applies DNS mappings through a sandboxed DNS Proxy Network Extension. Changes to `SystemApplyService`, `DNSProxyController`, or `DNSProxyProvider` should be reviewed carefully. The app must not introduce direct `/etc/hosts` edits, privileged helpers, or `osascript` calls. From 34784858c79037fd29562bf3db89af32dd0d0174 Mon Sep 17 00:00:00 2001 From: offyotto Date: Sat, 6 Jun 2026 04:15:36 +0500 Subject: [PATCH 3/5] fix: use deterministic UUID for homeContext to prevent identity instability --- Sources/LocaleApp/Models.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/LocaleApp/Models.swift b/Sources/LocaleApp/Models.swift index 8714654..c26e79c 100644 --- a/Sources/LocaleApp/Models.swift +++ b/Sources/LocaleApp/Models.swift @@ -68,8 +68,10 @@ struct NetworkContext: Identifiable, Codable, Equatable, Sendable { var activeHostCount: Int { hosts.filter(\.isEnabled).count } var disabledHostCount: Int { hosts.filter { !$0.isEnabled }.count } + static let homeContextID = UUID(uuidString: "00000000-0000-0000-0000-000000000001")! + static let homeContext = NetworkContext( - id: UUID(), + id: homeContextID, name: "Home", color: .green, isActive: true, From 2b506e191e330bcb42e01820adb8809ded5ca82e Mon Sep 17 00:00:00 2001 From: offyotto Date: Sat, 6 Jun 2026 04:16:07 +0500 Subject: [PATCH 4/5] fix: wire up sidebar context menu actions (activate, duplicate, delete) --- Sources/LocaleApp/SidebarView.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Sources/LocaleApp/SidebarView.swift b/Sources/LocaleApp/SidebarView.swift index 8520bd7..fc50ba8 100644 --- a/Sources/LocaleApp/SidebarView.swift +++ b/Sources/LocaleApp/SidebarView.swift @@ -92,6 +92,8 @@ struct SidebarContextRow: View { @State private var isActivePulse = false + @EnvironmentObject var store: LocaleStore + var body: some View { Button(action: onSelect) { HStack(spacing: 9) { @@ -159,10 +161,11 @@ struct SidebarContextRow: View { if context.isActive { isActivePulse = true } } .contextMenu { - Button("Activate") {} - Button("Duplicate") {} + Button("Activate") { store.activateContext(context) } + Button("Duplicate") { store.duplicateContext(context) } Divider() - Button("Delete", role: .destructive) {} + Button("Delete", role: .destructive) { store.deleteContext(context) } + .disabled(context.id == NetworkContext.homeContextID) } } } From 52e3dedd8806d02dc95b1d5685be8287c14dda55 Mon Sep 17 00:00:00 2001 From: offyotto Date: Sat, 6 Jun 2026 04:20:11 +0500 Subject: [PATCH 5/5] fix: regenerate host IDs when duplicating contexts --- Sources/LocaleApp/LocaleStore.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/LocaleApp/LocaleStore.swift b/Sources/LocaleApp/LocaleStore.swift index 33a3250..5094303 100644 --- a/Sources/LocaleApp/LocaleStore.swift +++ b/Sources/LocaleApp/LocaleStore.swift @@ -151,6 +151,11 @@ final class LocaleStore: ObservableObject { copy.isActive = false copy.lastActivated = nil copy.createdAt = Date() + copy.hosts = context.hosts.map { host in + var newHost = host + newHost.id = UUID() + return newHost + } if let idx = contexts.firstIndex(where: { $0.id == context.id }) { contexts.insert(copy, at: idx + 1) } else {