From fdb94c931643c9775b5ec9e7b78a04368b1d280c Mon Sep 17 00:00:00 2001 From: x Date: Tue, 24 Nov 2026 13:51:55 -0500 Subject: [PATCH 1/3] feat(fork): replace remaining T3 branding with no3y The build-time rename now takes a phrase table: besides "T3 Code" it renames bare-T3 phrases such as "T3 thread", so delegate rows read "Started a no3y thread". Upstream's T3 letter glyph is shadowed with the no3y flower outline, which marks the app's own tool rows and heads the auth pages. Mobile runs the same table through a Metro Babel-transformer wrapper, and its wordmark, header title, loading tile, widget copy and widget logo show no3y. T3 Connect, T3 Chat, the T3 server and server-sent text keep their names. Co-Authored-By: Claude Opus 5.5 --- .fork/customizations.yaml | 38 +++++++++++++-- apps/mobile/assets/widget/T3Mark.svg | 4 +- apps/mobile/fork/forkBrandNameTransformer.cjs | 32 +++++++++++++ apps/mobile/metro.config.js | 26 +++++++++-- .../src/components/CompactBrandTitle.tsx | 5 +- apps/mobile/src/components/T3Wordmark.tsx | 13 ++++-- apps/mobile/src/components/brandAssets.ts | 9 ++-- .../src/widgets/AgentActivityWidget.tsx | 9 +++- .../src/widgets/SubscriptionUsage.android.tsx | 15 ++++-- apps/mobile/src/widgets/SubscriptionUsage.tsx | 17 ++++--- .../src/widgets/subscriptionUsageSnapshot.ts | 19 +++++--- .../src/__fork_guards__/forkBrandName.test.ts | 41 +++++++++++++++++ .../web/src/components/ui/standalone-page.tsx | 10 ++-- .../src/overrides/components/T3Wordmark.tsx | 23 ++++++++++ scripts/lib/fork-brand-name.ts | 46 +++++++++++++------ 15 files changed, 250 insertions(+), 57 deletions(-) create mode 100644 apps/mobile/fork/forkBrandNameTransformer.cjs create mode 100644 apps/web/src/overrides/components/T3Wordmark.tsx diff --git a/.fork/customizations.yaml b/.fork/customizations.yaml index fec8e79f12b9e..71329a73d70e4 100644 --- a/.fork/customizations.yaml +++ b/.fork/customizations.yaml @@ -583,7 +583,7 @@ - id: fork-brand-name intent: > - Every web and desktop string a user reads names the app "no3y Code", the + Every web, desktop and mobile string a user reads names the app "no3y Code", the same name fork-app-identity gives the installed app, and the fork still says where it comes from. Upstream writes "T3 Code" inline in hundreds of strings and adds more each sync, so the name is rewritten at build time @@ -605,21 +605,49 @@ "no3y Code link"), so a host's Connections list names the fork's clients; nothing compares those labels. Connection copy about software on another host is renamed too, though a linked VPS may run upstream. - T3 Connect, the T3 server, and the t3 CLI keep their names. + Bare "T3" is renamed only inside the phrases RENAMED_PHRASES lists (the + t3_thread_* tool rows read "Started a no3y thread"); alone it also names + T3 Connect, T3 Chat, the T3 server, the t3 CLI and identifiers, which + keep their names. The tool-row lookups key on the same rewritten labels, + so they keep matching. + Upstream's "T3" letter glyph (T3Wordmark), which marks the app's own tool + rows in the transcript and heads the standalone auth pages, is shadowed + with the no3y flower as currentColor line art (the outline cells of + assets/fork/n3-favicon.svg); the auth header spells "no3y Code" beside it. + Mobile runs the same table through a Metro Babel-transformer wrapper + (apps/mobile/fork/forkBrandNameTransformer.cjs), and draws the flower in + its T3Wordmark, its header title, its loading-screen tile, and the + widget's app name ("Open no3y"). The iOS widgets bundle through + expo-widgets' own Metro config, so their fallback copy and their + T3Mark.svg logo (the flower, centred in the 1.5:1 frame they draw it in) + are edited in place. Not bundled, so edited in place: public/manifest.webmanifest and the macOS permission prompts (local network, screen capture, camera) in build-desktop-artifact.ts, beside fork-local-dictation's microphone prompt. Settings, About carries a row crediting T3 Code with a link to the upstream repository, and the macOS About panel credits it. - Server-sent text and the mobile app are out of scope and still say - T3 Code. + Server-sent text (including agent-facing prompts) is out of scope and + still says T3 Code. tier: 4 files: - scripts/lib/fork-brand-name.ts - apps/web/src/custom/ForkUpstreamCreditRow.tsx - shadows: [] + - apps/mobile/fork/forkBrandNameTransformer.cjs + shadows: + - apps/web/src/components/T3Wordmark.tsx watch: - apps/web/vite.config.ts + - apps/web/src/components/ui/standalone-page.tsx + - apps/mobile/metro.config.js + - apps/mobile/src/components/T3Wordmark.tsx + - apps/mobile/src/components/CompactBrandTitle.tsx + - apps/mobile/src/components/brandAssets.ts + - apps/mobile/src/widgets/subscriptionUsageSnapshot.ts + # Widget layouts bundle through expo-widgets' own Metro config, outside the rename. + - apps/mobile/src/widgets/SubscriptionUsage.tsx + - apps/mobile/src/widgets/SubscriptionUsage.android.tsx + - apps/mobile/src/widgets/AgentActivityWidget.tsx + - apps/mobile/assets/widget/T3Mark.svg - apps/desktop/vite.config.ts - apps/web/public/manifest.webmanifest - apps/web/src/components/settings/SettingsPanels.tsx diff --git a/apps/mobile/assets/widget/T3Mark.svg b/apps/mobile/assets/widget/T3Mark.svg index 48d1b09446f69..23abef970c696 100644 --- a/apps/mobile/assets/widget/T3Mark.svg +++ b/apps/mobile/assets/widget/T3Mark.svg @@ -1,3 +1,3 @@ - - + + diff --git a/apps/mobile/fork/forkBrandNameTransformer.cjs b/apps/mobile/fork/forkBrandNameTransformer.cjs new file mode 100644 index 0000000000000..726b924725e15 --- /dev/null +++ b/apps/mobile/fork/forkBrandNameTransformer.cjs @@ -0,0 +1,32 @@ +// Fork display-name rewrite for Metro — see .fork/customizations.yaml#fork-brand-name. +// The same rewrite the web and desktop builds run (scripts/lib/fork-brand-name.ts), +// applied to each app module's source before Expo's Babel transformer sees it. +const NodeCrypto = require("node:crypto"); +const NodeFS = require("node:fs"); +const NodePath = require("node:path"); + +const brandNameSource = NodePath.resolve(__dirname, "../../../scripts/lib/fork-brand-name.ts"); +const { isRebrandedModule, rewriteUpstreamDisplayName } = require(brandNameSource); +const upstreamPath = process.env.NO3Y_UPSTREAM_BABEL_TRANSFORMER; +if (!upstreamPath) { + throw new Error("NO3Y_UPSTREAM_BABEL_TRANSFORMER is unset; load this through metro.config.js."); +} +const upstream = require(upstreamPath); + +module.exports = { + ...upstream, + transform(props) { + const src = isRebrandedModule(props.filename) + ? (rewriteUpstreamDisplayName(props.src) ?? props.src) + : props.src; + return upstream.transform(src === props.src ? props : { ...props, src }); + }, + // Metro hashes this file in place of the transformer it wraps, and neither one's imports. + getCacheKey(options) { + const sources = NodeCrypto.createHash("sha1") + .update(NodeFS.readFileSync(brandNameSource)) + .update(NodeFS.readFileSync(require.resolve(upstreamPath))) + .digest("hex"); + return `${upstream.getCacheKey?.(options) ?? ""}:${sources}`; + }, +}; diff --git a/apps/mobile/metro.config.js b/apps/mobile/metro.config.js index 6371da34fd190..34c6eae4d988c 100644 --- a/apps/mobile/metro.config.js +++ b/apps/mobile/metro.config.js @@ -112,9 +112,25 @@ async function prepareStreamScripts() { module.exports = Promise.all([generateMobileThirdPartyLicenses(), prepareStreamScripts()]).then( () => - withUniwindConfig(config, { - cssEntryFile: "./global.css", - extraThemes, - polyfills: { rem: 14 }, - }), + /* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ + withForkBrandName( + /* fork:end fork-brand-name */ + withUniwindConfig(config, { + cssEntryFile: "./global.css", + extraThemes, + polyfills: { rem: 14 }, + }), + ), ); + +/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ +// Workers inherit the environment, so the wrapper finds the transformer it replaces there. +function withForkBrandName(finalConfig) { + const wrapper = require.resolve("./fork/forkBrandNameTransformer.cjs"); + if (finalConfig.transformer.babelTransformerPath !== wrapper) { + process.env.NO3Y_UPSTREAM_BABEL_TRANSFORMER = finalConfig.transformer.babelTransformerPath; + finalConfig.transformer.babelTransformerPath = wrapper; + } + return finalConfig; +} +/* fork:end fork-brand-name */ diff --git a/apps/mobile/src/components/CompactBrandTitle.tsx b/apps/mobile/src/components/CompactBrandTitle.tsx index bf70682462bf4..13877e88c0067 100644 --- a/apps/mobile/src/components/CompactBrandTitle.tsx +++ b/apps/mobile/src/components/CompactBrandTitle.tsx @@ -11,7 +11,10 @@ import { resolveMobileStageLabel } from "../lib/mobileBranding"; import { useAndroidControlSizing } from "./ui/useAndroidControlSizing"; const BRAND_MAX_FONT_SCALE = 1.4; -const WORDMARK_SUFFIX = "Code"; +/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ +// The glyph is the no3y flower, not letters, so the name is spelled out beside it. +const WORDMARK_SUFFIX = "no3y Code"; +/* fork:end fork-brand-name */ export function brandTitleOffset(): number { if (Platform.OS !== "ios") return 0; diff --git a/apps/mobile/src/components/T3Wordmark.tsx b/apps/mobile/src/components/T3Wordmark.tsx index d7cac80d8f58f..cc7b6dedcd2b3 100644 --- a/apps/mobile/src/components/T3Wordmark.tsx +++ b/apps/mobile/src/components/T3Wordmark.tsx @@ -9,20 +9,23 @@ export function T3Wordmark(props: { readonly color?: ColorValue; readonly colorClassName?: string; }) { - const aspectRatio = 94.3941 / 56.96; + /* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ + // The no3y flower as line art in place of upstream's "T3" letters: the outline + // cells of assets/fork/n3-favicon.svg, drawn square. return ( ); + /* fork:end fork-brand-name */ } diff --git a/apps/mobile/src/components/brandAssets.ts b/apps/mobile/src/components/brandAssets.ts index dbf7ab552aa8c..93655b380c55c 100644 --- a/apps/mobile/src/components/brandAssets.ts +++ b/apps/mobile/src/components/brandAssets.ts @@ -2,9 +2,10 @@ import Constants from "expo-constants"; const appVariant = Constants.expoConfig?.extra?.appVariant; +/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ +// The no3y flower tile, orange for development like the installed dev app. export const T3_CODE_BRAND_MARK_SOURCE = appVariant === "development" - ? require("../../../../assets/dev/blueprint-ios-1024.png") - : appVariant === "preview" - ? require("../../../../assets/nightly/nightly-ios-1024.png") - : require("../../../../assets/prod/black-ios-1024.png"); + ? require("../../../../assets/fork/n3-dev-web-apple-touch-180.png") + : require("../../../../assets/fork/n3-web-apple-touch-180.png"); +/* fork:end fork-brand-name */ diff --git a/apps/mobile/src/widgets/AgentActivityWidget.tsx b/apps/mobile/src/widgets/AgentActivityWidget.tsx index 8dff1156da63d..e958c393c51c0 100644 --- a/apps/mobile/src/widgets/AgentActivityWidget.tsx +++ b/apps/mobile/src/widgets/AgentActivityWidget.tsx @@ -95,7 +95,9 @@ export function AgentActivityWidget( const summaryTint = rows[0] ? phaseTint(rows[0].phase) : secondaryForeground; const emptyMessage = loaded ? (props.subtitle ?? text?.noActiveAgents ?? "No active agents") - : "Open T3 Code to load agent activity"; + : /* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ + "Open no3y Code to load agent activity"; + /* fork:end fork-brand-name */ // Widget taps open the containing app, and every build accepts the prod // scheme as a link prefix, so dev and preview builds route this too. @@ -181,7 +183,10 @@ export function AgentActivityWidget( lineLimit(1), ]} > - {summary || (accessory ? "T3 Code" : "")} + {/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */} + {/* oxlint-disable-next-line t3code/no-untranslated-copy -- product name */} + {summary || (accessory ? "no3y Code" : "")} + {/* fork:end fork-brand-name */} diff --git a/apps/mobile/src/widgets/SubscriptionUsage.android.tsx b/apps/mobile/src/widgets/SubscriptionUsage.android.tsx index 3af0705f06342..b3cdf60219dd2 100644 --- a/apps/mobile/src/widgets/SubscriptionUsage.android.tsx +++ b/apps/mobile/src/widgets/SubscriptionUsage.android.tsx @@ -55,19 +55,22 @@ export function SubscriptionUsage(props: SubscriptionUsageProps, environment: Wi error: material.error, }; // English until the app publishes its first snapshot in the UI language. + /* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ + // Widget layouts bundle outside the app's Metro rename, so their fallbacks name the fork here. const text = props.text ?? { - refresh: "Open T3 to refresh", + refresh: "Open no3y to refresh", left: "left", asOf: "As of {time}", - tapToConnect: "Tap to connect in T3", + tapToConnect: "Tap to connect in no3y", moreInApp: {} as Record, }; const providers = props.providers ?? [ // oxlint-disable-next-line t3code/no-untranslated-copy -- widget fallback until the app publishes translated text - { name: "Codex", detail: "Open T3 to connect", windows: [], expiresAt: 0, totalWindows: 0 }, + { name: "Codex", detail: "Open no3y to connect", windows: [], expiresAt: 0, totalWindows: 0 }, // oxlint-disable-next-line t3code/no-untranslated-copy -- widget fallback until the app publishes translated text - { name: "Claude", detail: "Open T3 to connect", windows: [], expiresAt: 0, totalWindows: 0 }, + { name: "Claude", detail: "Open no3y to connect", windows: [], expiresAt: 0, totalWindows: 0 }, ]; + /* fork:end fork-brand-name */ const pad = 14; const labelWidth = 92; @@ -337,8 +340,10 @@ export function SubscriptionUsage(props: SubscriptionUsageProps, environment: Wi {shown.map(row)} {hidden > 0 ? ( + {/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */} {/* oxlint-disable-next-line t3code/no-untranslated-copy -- widget fallback until the app publishes translated text */} - {text.moreInApp[String(hidden)] ?? `${hidden} more in T3`} + {text.moreInApp[String(hidden)] ?? `${hidden} more in no3y`} + {/* fork:end fork-brand-name */} ) : null} diff --git a/apps/mobile/src/widgets/SubscriptionUsage.tsx b/apps/mobile/src/widgets/SubscriptionUsage.tsx index eb47d7b97f816..ddcc9ea8a46e9 100644 --- a/apps/mobile/src/widgets/SubscriptionUsage.tsx +++ b/apps/mobile/src/widgets/SubscriptionUsage.tsx @@ -56,28 +56,31 @@ function SubscriptionUsage( const primary = palette?.foreground ?? "primary"; const secondary = palette?.secondary ?? "secondary"; // English until the app publishes its first snapshot in the UI language. + /* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ + // Widget layouts bundle outside the app's Metro rename, so their fallbacks name the fork here. const text = props.text ?? { - refresh: "Open T3 to refresh", + refresh: "Open no3y to refresh", noSessionLimit: "No session limit reported", noWeeklyLimit: "No weekly limit reported", subscriptionRemaining: "Subscription remaining", percentLeft: "{remaining}% left", windowPercentLeft: "{window} · {remaining}% left", notApplicable: "N/A", - openApp: "Open T3", + openApp: "Open no3y", noLimits: "No subscription limits available.", asOf: "As of {time}", - tapToConnect: "Tap to connect in T3", + tapToConnect: "Tap to connect in no3y", providerAccessibility: "{provider}. {detail}.", windowAccessibility: "{provider}, {window}, {remaining} percent remaining. {reset}. {detail}.", moreInApp: {} as Record, }; const providers = props.providers ?? [ // oxlint-disable-next-line t3code/no-untranslated-copy -- widget fallback until the app publishes translated text - { name: "Codex", detail: "Open T3 to connect", windows: [], expiresAt: 0 }, + { name: "Codex", detail: "Open no3y to connect", windows: [], expiresAt: 0 }, // oxlint-disable-next-line t3code/no-untranslated-copy -- widget fallback until the app publishes translated text - { name: "Claude", detail: "Open T3 to connect", windows: [], expiresAt: 0 }, + { name: "Claude", detail: "Open no3y to connect", windows: [], expiresAt: 0 }, ]; + /* fork:end fork-brand-name */ const columns = providers.map((provider) => { const stale = provider.windows.length > 0 && now >= provider.expiresAt; const period = @@ -262,8 +265,10 @@ function SubscriptionUsage( + {/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */} {/* oxlint-disable-next-line t3code/no-untranslated-copy -- widget fallback until the app publishes translated text */} - {text.moreInApp[String(hiddenCount)] ?? `${hiddenCount} more in T3`} + {text.moreInApp[String(hiddenCount)] ?? `${hiddenCount} more in no3y`} + {/* fork:end fork-brand-name */} ) : null} diff --git a/apps/mobile/src/widgets/subscriptionUsageSnapshot.ts b/apps/mobile/src/widgets/subscriptionUsageSnapshot.ts index bd65da8beec6c..08066947293d3 100644 --- a/apps/mobile/src/widgets/subscriptionUsageSnapshot.ts +++ b/apps/mobile/src/widgets/subscriptionUsageSnapshot.ts @@ -14,6 +14,11 @@ import { m, type MessageResolver } from "../i18n/messages"; import { providerColors } from "../features/usage/providerColors"; import type { WidgetTheme } from "./widgetTheme"; +/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */ +// The widget names the app it opens; upstream writes "T3" at each use. +const FORK_WIDGET_APP_NAME = "no3y"; +/* fork:end fork-brand-name */ + /** * Copy for the widget, which runs without the app's catalogs. `{name}` tokens are filled in by the * widget; `moreInApp` is keyed by count. @@ -159,7 +164,7 @@ function subscriptionUsageText( maxHiddenWindows: number, ): SubscriptionUsageText { return { - refresh: resolve(msg("Open {app} to refresh", { app: "T3" })), + refresh: resolve(msg("Open {app} to refresh", { app: FORK_WIDGET_APP_NAME })), noSessionLimit: resolve(msg("No session limit reported")), noWeeklyLimit: resolve(msg("No weekly limit reported")), subscriptionRemaining: resolve(msg("Subscription remaining")), @@ -169,10 +174,10 @@ function subscriptionUsageText( ), left: resolve(msg("left", { $context: "follows a bold percentage, as in 40% left" })), notApplicable: resolve(msg("N/A", { $context: "no usage limit for the chosen period" })), - openApp: resolve(msg("Open {app}", { app: "T3" })), + openApp: resolve(msg("Open {app}", { app: FORK_WIDGET_APP_NAME })), noLimits: resolve(msg("No subscription limits available.")), asOf: resolve(msg("As of {time}", { time: "{time}" })), - tapToConnect: resolve(msg("Tap to connect in {app}", { app: "T3" })), + tapToConnect: resolve(msg("Tap to connect in {app}", { app: FORK_WIDGET_APP_NAME })), providerAccessibility: resolve( // oxlint-disable-next-line t3code/no-untranslated-copy -- placeholders the widget fills in msg("{provider}. {detail}.", { provider: "{provider}", detail: "{detail}" }), @@ -193,7 +198,7 @@ function subscriptionUsageText( resolve( msg("{count, plural, one {{count} more in {app}} other {{count} more in {app}}}", { count: index + 1, - app: "T3", + app: FORK_WIDGET_APP_NAME, }), ), ]), @@ -258,7 +263,7 @@ function subscriptionUsageProps( name, colors, detail: !fresh - ? resolve(msg("Open {app} to refresh", { app: "T3" })) + ? resolve(msg("Open {app} to refresh", { app: FORK_WIDGET_APP_NAME })) : pool.accounts.length > 1 ? resolve( msg( @@ -338,7 +343,9 @@ export function subscriptionUsageTimeline(snapshot: SubscriptionUsageSnapshot, n provider.windows.length > 0 && provider.expiresAt <= date ? { ...provider, - detail: snapshot.text?.refresh ?? m(msg("Open {app} to refresh", { app: "T3" })), + detail: + snapshot.text?.refresh ?? + m(msg("Open {app} to refresh", { app: FORK_WIDGET_APP_NAME })), windows: [], totalWindows: 0, } diff --git a/apps/web/src/__fork_guards__/forkBrandName.test.ts b/apps/web/src/__fork_guards__/forkBrandName.test.ts index b7cac5d56d52c..3f83dfa957ca4 100644 --- a/apps/web/src/__fork_guards__/forkBrandName.test.ts +++ b/apps/web/src/__fork_guards__/forkBrandName.test.ts @@ -40,6 +40,13 @@ describe("fork guard: fork-brand-name", () => { ["T3 Code (Beta)", "no3y Code (Beta)"], ["`${reason}\\n\\nT3 Code will restart`", "`${reason}\\n\\nno3y Code will restart`"], ["Sign in to T3 Connect on the T3 server", null], + ["Link T3 Chat for more tunnels", null], + [ + '"Start\\nStarting\\nStarted\\na T3 thread"', + '"Start\\nStarting\\nStarted\\na no3y thread"', + ], + ["{completed {Created T3 threads}}", "{completed {Created no3y threads}}"], + ["Use T3 desktop. T3 could not ask.", "Use no3y Code desktop. no3y Code could not ask."], ] as const) { expect(rewriteUpstreamDisplayName(input)).toBe(expected); } @@ -57,6 +64,7 @@ describe("fork guard: fork-brand-name", () => { map: null, }); expect(transform(source, "/repo/node_modules/pkg/index.js")).toBeNull(); + expect(transform(source, "node_modules/pkg/index.js")).toBeNull(); expect(transform(source, "/repo/apps/web/src/index.css")).toBeNull(); for (const path of ["/repo/apps/desktop/src/app/DesktopUserData.ts"]) { expect(EXCLUDED_MODULES.some((pattern) => pattern.test(path))).toBe(true); @@ -88,6 +96,39 @@ describe("fork guard: fork-brand-name", () => { } }); + it("draws the no3y flower where upstream draws its T3 letters", () => { + const glyph = read("apps/web/src/overrides/components/T3Wordmark.tsx"); + expect(glyph).toContain("export function T3Wordmark("); + expect(glyph).toContain('viewBox="-0.5 -0.5 16 16"'); + expect(glyph).not.toContain("M33.4509 93V47.56"); + const standalone = read("apps/web/src/components/ui/standalone-page.tsx"); + expect(standalone).toContain('aria-label="no3y Code"'); + expect(standalone).toContain(">no3y Code"); + }); + + it("rebrands the mobile app through Metro and its own marks", () => { + expect(read("apps/mobile/metro.config.js")).toContain("withForkBrandName("); + expect(read("apps/mobile/fork/forkBrandNameTransformer.cjs")).toContain( + "rewriteUpstreamDisplayName(props.src)", + ); + expect(read("apps/mobile/src/components/T3Wordmark.tsx")).not.toContain("M33.4509 93V47.56"); + expect(read("apps/mobile/src/components/CompactBrandTitle.tsx")).toContain( + 'const WORDMARK_SUFFIX = "no3y Code";', + ); + expect(read("apps/mobile/src/components/brandAssets.ts")).not.toMatch( + /assets\/(dev|nightly|prod)\//u, + ); + expect(read("apps/mobile/src/widgets/subscriptionUsageSnapshot.ts")).not.toContain('app: "T3"'); + for (const widget of [ + "apps/mobile/src/widgets/SubscriptionUsage.tsx", + "apps/mobile/src/widgets/SubscriptionUsage.android.tsx", + "apps/mobile/src/widgets/AgentActivityWidget.tsx", + ]) { + expect(read(widget)).not.toMatch(/\bT3( Code)?\b[^_]/u); + } + expect(read("apps/mobile/assets/widget/T3Mark.svg")).not.toContain("M33.4509 93V47.56"); + }); + it("credits upstream in Settings and the desktop About panel", () => { expect(read("apps/web/src/components/settings/SettingsPanels.tsx")).toContain( "", diff --git a/apps/web/src/components/ui/standalone-page.tsx b/apps/web/src/components/ui/standalone-page.tsx index de74836db8dbd..88822662a119b 100644 --- a/apps/web/src/components/ui/standalone-page.tsx +++ b/apps/web/src/components/ui/standalone-page.tsx @@ -28,11 +28,15 @@ export function StandalonePageHeader({ return ( <>
- - + {/* fork:begin fork-brand-name — see .fork/customizations.yaml#fork-brand-name */} + {/* The glyph is the no3y flower, not letters, so the name is spelled out beside it. */} + {/* oxlint-disable-next-line t3code/no-untranslated-copy -- product name */} + + {/* oxlint-disable-next-line t3code/no-untranslated-copy -- product wordmark */} - Code + no3y Code + {/* fork:end fork-brand-name */} {context ? {context} : null}

{title}

diff --git a/apps/web/src/overrides/components/T3Wordmark.tsx b/apps/web/src/overrides/components/T3Wordmark.tsx new file mode 100644 index 0000000000000..1b9f9e77696b8 --- /dev/null +++ b/apps/web/src/overrides/components/T3Wordmark.tsx @@ -0,0 +1,23 @@ +import type { SVGProps } from "react"; + +/** + * Fork brand glyph — see `.fork/customizations.yaml#fork-brand-name`. The no3y flower as + * currentColor line art (the outline cells of assets/fork/n3-favicon.svg, one per pixel at 16px) + * where upstream draws its "T3" letters: its own tool rows and the standalone auth pages. + */ +export function T3Wordmark(props: SVGProps) { + return ( + + + + ); +} diff --git a/scripts/lib/fork-brand-name.ts b/scripts/lib/fork-brand-name.ts index 4cbcd54037111..397c57562a211 100644 --- a/scripts/lib/fork-brand-name.ts +++ b/scripts/lib/fork-brand-name.ts @@ -10,6 +10,22 @@ import type { Plugin } from "vite-plus"; export const FORK_DISPLAY_NAME = "no3y Code"; +/** + * Upstream's names for the app, and what the fork shows instead. Bare "T3" is + * matched only inside these phrases: alone it also names T3 Connect, T3 Chat, + * the T3 server and identifiers, which keep their names. + */ +export const RENAMED_PHRASES = [ + ["T3 Code", FORK_DISPLAY_NAME], + // The t3_thread_* tool labels; lookups key on the same rewritten text, so they keep matching. + ["T3 thread", "no3y thread"], + ["T3 desktop", `${FORK_DISPLAY_NAME} desktop`], + ["T3 process", `${FORK_DISPLAY_NAME} process`], + ["T3 system footprint", `${FORK_DISPLAY_NAME} system footprint`], + ["T3 operations", `${FORK_DISPLAY_NAME} operations`], + ["T3 could not", `${FORK_DISPLAY_NAME} could not`], +] as const; + /** Phrases that name something other than this app, kept exactly as written. */ export const PRESERVED_PHRASES = [ // The fork's credit, and prose about upstream itself. @@ -29,35 +45,39 @@ export const PRESERVED_PHRASES = [ /** Modules whose "T3 Code" strings are identities (legacy profile names). */ export const EXCLUDED_MODULES = [/\/apps\/desktop\/src\/app\/DesktopUserData\.ts$/u] as const; -const UPSTREAM_DISPLAY_NAME = "T3 Code"; +const RENAMES = new Map(RENAMED_PHRASES); const escapeRegExp = (text: string) => text.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"); -const PRESERVED_OR_NAME = new RegExp( - [...PRESERVED_PHRASES, UPSTREAM_DISPLAY_NAME].map(escapeRegExp).join("|"), +const PRESERVED_OR_RENAMED = new RegExp( + [...PRESERVED_PHRASES, ...RENAMES.keys()].map(escapeRegExp).join("|"), "gu", ); export function rewriteUpstreamDisplayName(code: string): string | null { - if (!code.includes(UPSTREAM_DISPLAY_NAME)) { + if (!code.includes("T3 ")) { return null; } - const rewritten = code.replace(PRESERVED_OR_NAME, (match) => - match === UPSTREAM_DISPLAY_NAME ? FORK_DISPLAY_NAME : match, - ); + const rewritten = code.replace(PRESERVED_OR_RENAMED, (match) => RENAMES.get(match) ?? match); return rewritten === code ? null : rewritten; } const SCRIPT_MODULE = /\.[cm]?[jt]sx?$/u; +/** Whether a bundled module's source gets the rewrite: app scripts, never dependencies. */ +export function isRebrandedModule(id: string): boolean { + const path = (id.split("?", 1)[0] ?? id).replaceAll("\\", "/"); + return ( + SCRIPT_MODULE.test(path) && + // Metro passes project-relative paths, so a dependency can start with "node_modules/". + !/(?:^|\/)node_modules\//u.test(path) && + !EXCLUDED_MODULES.some((pattern) => pattern.test(path)) + ); +} + export function forkBrandName(): Plugin { return { name: "fork:brand-name", transform(code, id) { - const path = id.split("?", 1)[0] ?? id; - if ( - !SCRIPT_MODULE.test(path) || - path.includes("/node_modules/") || - EXCLUDED_MODULES.some((pattern) => pattern.test(path)) - ) { + if (!isRebrandedModule(id)) { return null; } const rewritten = rewriteUpstreamDisplayName(code); From c976f5a13e9fe84a51f0da772fbb46b2ce48baeb Mon Sep 17 00:00:00 2001 From: x Date: Tue, 24 Nov 2026 14:24:50 -0500 Subject: [PATCH 2/3] fix(fork): rename bare T3 by default and share one flower path Bare "T3 " now becomes "no3y " unless PRESERVED_PHRASES names it (T3 Connect, Chat, Account, server, home), so new upstream copy is covered without a per-phrase list. The rule lives in an import-free core both Vite and Metro load. The flower glyph is one merged-run path in all three copies, derived from the favicon by the guard. Every inline edit is fenced, the Metro hook is one appended statement, and the auth label relies on the rewrite. Co-Authored-By: Claude Opus 5.5 --- .fork/customizations.yaml | 73 +++++++++++-------- apps/mobile/assets/widget/T3Mark.svg | 2 +- apps/mobile/fork/forkBrandNameTransformer.cjs | 8 +- apps/mobile/metro.config.js | 21 +++--- apps/mobile/src/components/T3Wordmark.tsx | 6 +- apps/mobile/src/components/brandAssets.ts | 3 +- .../src/widgets/AgentActivityWidget.tsx | 4 +- .../src/widgets/subscriptionUsageSnapshot.ts | 16 +++- .../src/__fork_guards__/forkBrandName.test.ts | 48 +++++++++--- .../web/src/components/ui/standalone-page.tsx | 3 +- .../src/overrides/components/T3Wordmark.tsx | 7 +- apps/web/tsconfig.json | 3 +- scripts/lib/fork-brand-name-core.ts | 71 ++++++++++++++++++ scripts/lib/fork-brand-name.ts | 73 +++---------------- 14 files changed, 203 insertions(+), 135 deletions(-) create mode 100644 scripts/lib/fork-brand-name-core.ts diff --git a/.fork/customizations.yaml b/.fork/customizations.yaml index 42495f1d8943d..6b8530b012ebf 100644 --- a/.fork/customizations.yaml +++ b/.fork/customizations.yaml @@ -583,53 +583,64 @@ - id: fork-brand-name intent: > - Every web, desktop and mobile string a user reads names the app "no3y Code", the - same name fork-app-identity gives the installed app, and the fork still - says where it comes from. Upstream writes "T3 Code" inline in hundreds of - strings and adds more each sync, so the name is rewritten at build time - instead of in each file: one plugin (scripts/lib/fork-brand-name.ts) runs - in the web Vite build and dev server and in both desktop pack entries - (main, workers), and replaces "T3 Code" in script modules and index.html. - The web config leaves it out under Vitest so upstream tests keep - asserting upstream copy; desktop pack never runs under Vitest. - The whole keep-as-written policy is two lists in that file: + Every web, desktop and mobile string a user reads names the app "no3y + Code", the same name fork-app-identity gives the installed app, and the + fork still says where it comes from. Upstream writes "T3 Code" and bare + "T3 " inline in hundreds of strings and adds more each sync, so the + name is rewritten at build time instead of in each file. The rewrite is + a rename-by-default rule in scripts/lib/fork-brand-name-core.ts: every + "T3 " that starts a word and precedes a letter becomes "no3y " ("T3 Code" + → "no3y Code", "Started a T3 thread" → "Started a no3y thread"). The + t3_thread_* tool-row lookups key on the same rewritten labels, so they + keep matching. The core is import-free because two bundlers load it: + the Vite plugin (scripts/lib/fork-brand-name.ts) in the web build and dev + server and in both desktop pack entries (main, workers), and a Metro + Babel-transformer wrapper (apps/mobile/fork/forkBrandNameTransformer.cjs) + for mobile. The web config leaves it out under Vitest so upstream tests + keep asserting upstream copy; desktop pack and Metro never run under + Vitest. + The whole keep-as-written policy is two lists in the core: PRESERVED_PHRASES (the fork's credit, prose about upstream, the Linux capture extension's own name, upstream's registered "T3 Code for GitHub" - app, and the server-issued "T3 Code ·