From 380bba368a9071828616b1b03bde1876cc0af4c8 Mon Sep 17 00:00:00 2001 From: Wout Stiens <71498452+StiensWout@users.noreply.github.com> Date: Tue, 13 Oct 2026 21:02:49 +0200 Subject: [PATCH] fix(desktop): stop unsolicited Messages code autofill (#19118) --- apps/desktop/scripts/electron-launcher.mjs | 4 +++- scripts/build-desktop-artifact.test.ts | 1 + scripts/build-desktop-artifact.ts | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/desktop/scripts/electron-launcher.mjs b/apps/desktop/scripts/electron-launcher.mjs index 48f66ab76b560f217d80403dfa660680f4ea3708..b355650f841fe956a78c6130b4d8f1463b334c98 100644 --- a/apps/desktop/scripts/electron-launcher.mjs +++ b/apps/desktop/scripts/electron-launcher.mjs @@ -20,7 +20,7 @@ const APP_BUNDLE_ID = isDevelopment ? `com.t3tools.t3code.dev.${devBundleIdSuffix || "local"}` : "com.t3tools.t3code"; const APP_PROTOCOL_SCHEMES = isDevelopment ? ["t3code-dev"] : ["t3code"]; -const LAUNCHER_VERSION = 19; +const LAUNCHER_VERSION = 20; const developmentMacIconPngPath = NodePath.join( repoRoot, "assets", @@ -280,6 +280,8 @@ function patchMainBundleInfoPlist(appBundlePath, iconPath, executableName) { for (const [key, value] of Object.entries(resolveMacBundleInfoPlistStrings(executableName))) { setPlistString(infoPlistPath, key, value); } + // macOS 26 offers Messages/Mail codes in every text field unless opted out. + setPlistJson(infoPlistPath, "NSAutoFillRequiresTextContentTypeForOneTimeCodeOnMac", true); setPlistJson(infoPlistPath, "CFBundleURLTypes", [ { CFBundleURLName: APP_BUNDLE_ID, diff --git a/scripts/build-desktop-artifact.test.ts b/scripts/build-desktop-artifact.test.ts index 2d86a9c89d5ba3234cbc8d697c0c09e08d5aa6f8..0ec6f72eb56ebfd4c1e8550b557416ccbf48aed5 100644 --- a/scripts/build-desktop-artifact.test.ts +++ b/scripts/build-desktop-artifact.test.ts @@ -726,6 +726,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => { ]); // macOS lists a default browser only when it also opens web pages as documents. const macInfo = (mac.mac as { extendInfo: Record }).extendInfo; + assert.strictEqual(macInfo.NSAutoFillRequiresTextContentTypeForOneTimeCodeOnMac, true); assert.deepStrictEqual(macInfo.CFBundleDocumentTypes, [ { CFBundleTypeName: "Web page", diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index 618aec4d6bba3675055d8636487487c52c2db63b..5dd431bc4d9e625f01cee386a492a83abbe4d6a5 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -2821,6 +2821,8 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* ( icon: "icon.icns", category: "public.app-category.developer-tools", extendInfo: { + // macOS 26 offers Messages/Mail codes in every text field unless opted out. + NSAutoFillRequiresTextContentTypeForOneTimeCodeOnMac: true, NSLocalNetworkUsageDescription: "T3 Code connects to devices on your local network for remote environments and commands run by terminals and coding agents.", NSScreenCaptureUsageDescription: -- 2.54.0