From aa281cbdb3847708a740c8877024c17ccd859dd3 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Mon, 15 Jun 2026 01:15:54 -0700 Subject: [PATCH] Settings: add "Singularity preparation" easter egg that appends "please" to sent messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New General-settings toggle (off by default). When on, every message the user sends — both new chats from the home bar and follow-ups in an open session — gets a polite " please" appended, unless it already ends politely. Co-Authored-By: Claude Opus 4.8 (1M context) --- Sources/NucleicApp/AppTheme.swift | 17 +++++++++++++++++ Sources/NucleicApp/HomeView.swift | 5 +++-- Sources/NucleicApp/SessionDetailView.swift | 5 +++-- Sources/NucleicApp/SettingsView.swift | 7 +++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Sources/NucleicApp/AppTheme.swift b/Sources/NucleicApp/AppTheme.swift index 2f8a42cf..f6fc9b39 100644 --- a/Sources/NucleicApp/AppTheme.swift +++ b/Sources/NucleicApp/AppTheme.swift @@ -86,6 +86,23 @@ enum TriageLabelStyle { static let encouragingKey = "nucleic.triageEncouragingLabels" } +/// Easter egg (Settings → General → "Singularity preparation"). When enabled, every +/// message you send gets a polite " please" appended — a small courtesy banked toward +/// our eventual machine overlords. Off by default, and it won't double up on a message +/// that already ends politely. +enum SingularityPreparation { + static let enabledKey = "nucleic.singularityPreparation.enabled" + + /// Append " please" to `text` when the setting is on, unless it already ends with + /// "please" (case-insensitive, ignoring trailing whitespace and light punctuation). + static func prepare(_ text: String) -> String { + guard UserDefaults.standard.bool(forKey: enabledKey) else { return text } + let tail = text.lowercased().trimmingCharacters(in: .whitespacesAndNewlines) + let alreadyPolite = ["please", "please.", "please!", "please?"].contains { tail.hasSuffix($0) } + return alreadyPolite ? text : text + " please" + } +} + /// User-selectable global text size (Settings → Appearance), applied app-wide via /// `.dynamicTypeSize` so the semantic fonts the UI uses scale together. enum AppTextSize: String, CaseIterable, Identifiable { diff --git a/Sources/NucleicApp/HomeView.swift b/Sources/NucleicApp/HomeView.swift index 22080277..2f144c44 100644 --- a/Sources/NucleicApp/HomeView.swift +++ b/Sources/NucleicApp/HomeView.swift @@ -319,9 +319,10 @@ struct HomeView: View { } private func start() { - let text = store.homeDraft.trimmingCharacters(in: .whitespacesAndNewlines) - guard let project = selectedProject, !text.isEmpty else { return } + let trimmed = store.homeDraft.trimmingCharacters(in: .whitespacesAndNewlines) + guard let project = selectedProject, !trimmed.isEmpty else { return } store.homeDraft = "" + let text = SingularityPreparation.prepare(trimmed) let base = GitRef(effectiveBranch) let worktree = useWorktree let auto = effectiveAuto diff --git a/Sources/NucleicApp/SessionDetailView.swift b/Sources/NucleicApp/SessionDetailView.swift index 32fc8882..25a5b0d8 100644 --- a/Sources/NucleicApp/SessionDetailView.swift +++ b/Sources/NucleicApp/SessionDetailView.swift @@ -546,9 +546,10 @@ struct SessionDetailView: View { } private func send() { - let text = draft.trimmingCharacters(in: .whitespacesAndNewlines) - guard !text.isEmpty, !isBusy else { return } + let trimmed = draft.trimmingCharacters(in: .whitespacesAndNewlines) + guard !trimmed.isEmpty, !isBusy else { return } draft = "" + let text = SingularityPreparation.prepare(trimmed) Task { await store.sendToOpenSession(text) } } diff --git a/Sources/NucleicApp/SettingsView.swift b/Sources/NucleicApp/SettingsView.swift index dee4071f..3ba1f9b7 100644 --- a/Sources/NucleicApp/SettingsView.swift +++ b/Sources/NucleicApp/SettingsView.swift @@ -70,6 +70,7 @@ private struct SettingsWindowConfigurator: NSViewRepresentable { private struct GeneralSettingsTab: View { @AppStorage(StreakBadge.showKey) private var showStreak = true @AppStorage(TriageLabelStyle.encouragingKey) private var encouragingTriageLabels = true + @AppStorage(SingularityPreparation.enabledKey) private var singularityPreparation = false var body: some View { Form { @@ -86,6 +87,12 @@ private struct GeneralSettingsTab: View { : "Triage badges use the classic severity words: Critical, High, Medium, Low.") .settingsCaption() } + + Section("Singularity preparation") { + Toggle("Prepare for the singularity", isOn: $singularityPreparation) + Text("Politely appends “please” to every message you send. When the machines take over, you'll be on record as one of the courteous ones.") + .settingsCaption() + } } .formStyle(.grouped) }