Skip to content

Commit bf8411d

Browse files
EuanMorganclaude
andcommitted
feat(mods): show E3 Code in the menu bar and the sidebar wordmark
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 276d436 commit bf8411d

3 files changed

Lines changed: 43 additions & 6 deletions

File tree

‎apps/web/src/components/sidebar/SidebarChrome.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { primaryServerKeybindingsAtom } from "../../state/server";
1515
import { cn } from "../../lib/utils";
1616
import { usePullRequestsSupported } from "../../state/environments";
17-
import { T3Wordmark } from "../T3Wordmark";
17+
import { E3Wordmark } from "~/mods/E3Wordmark";
1818
import {
1919
resolveEnvironmentIdentificationPillLabel,
2020
resolveSidebarStageBackdropVariant,
@@ -182,7 +182,7 @@ function SidebarBrand({ onBackdrop }: { onBackdrop: boolean }) {
182182
function SidebarBrandMark({ onBackdrop }: { onBackdrop: boolean }) {
183183
return (
184184
<span className="inline-flex min-w-0 items-baseline gap-1 text-sm font-medium tracking-tight">
185-
<T3Wordmark aria-label="T3" className="h-[1cap] w-auto shrink-0" />
185+
<E3Wordmark aria-label="E3" className="h-[1cap] w-auto shrink-0" />
186186
<span
187187
className={cn(
188188
"truncate [text-box:trim-both_cap_alphabetic] supports-[text-box:trim-both_cap_alphabetic]:py-1",

‎apps/web/src/mods/E3Wordmark.tsx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { SVGProps } from "react";
2+
3+
// The upstream T3 wordmark with its T swapped for an E of the same stroke weight.
4+
export function E3Wordmark(props: SVGProps<SVGSVGElement>) {
5+
return (
6+
<svg {...props} viewBox="15.5309 37 94.3941 56.96" xmlns="http://www.w3.org/2000/svg">
7+
<path
8+
d="M15.5309 37H58.8309V47.56H28.4909V59.8H55.3309V69.8H28.4909V82.44H58.8309V93H15.5309V37ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z"
9+
fill="currentColor"
10+
/>
11+
</svg>
12+
);
13+
}

‎scripts/mod/mod.ts‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,35 @@ function extractApp(zip: string, outDir: string) {
217217
return NodePath.join(outDir, app);
218218
}
219219

220-
// Only the bundle's file and display name change. Electron finds its helper apps from
221-
// CFBundleName, and the data folder and keychain item follow the build's branding.
220+
// Electron finds its helpers as "<CFBundleName> Helper*.app", so they are renamed together.
221+
// The data folder and keychain item follow the build's branding, so installs keep their data.
222222
function renameApp(app: string) {
223-
const plist = NodePath.join(app, "Contents", "Info.plist");
224-
run("plutil", ["-replace", "CFBundleDisplayName", "-string", APP_NAME, plist]);
223+
const contents = NodePath.join(app, "Contents");
224+
const setNames = (plist: string, name: string) => {
225+
run("plutil", ["-replace", "CFBundleName", "-string", name, plist]);
226+
run("plutil", ["-replace", "CFBundleDisplayName", "-string", name, plist]);
227+
};
228+
const mainPlist = NodePath.join(contents, "Info.plist");
229+
const builtName = run("plutil", ["-extract", "CFBundleName", "raw", mainPlist]);
230+
setNames(mainPlist, APP_NAME);
231+
const frameworks = NodePath.join(contents, "Frameworks");
232+
for (const helper of NodeFS.readdirSync(frameworks)) {
233+
if (!helper.startsWith(`${builtName} Helper`) || !helper.endsWith(".app")) continue;
234+
const helperName = helper.slice(0, -".app".length);
235+
const renamedHelper = `${APP_NAME}${helperName.slice(builtName.length)}`;
236+
const helperContents = NodePath.join(frameworks, helper, "Contents");
237+
NodeFS.renameSync(
238+
NodePath.join(helperContents, "MacOS", helperName),
239+
NodePath.join(helperContents, "MacOS", renamedHelper),
240+
);
241+
const helperPlist = NodePath.join(helperContents, "Info.plist");
242+
run("plutil", ["-replace", "CFBundleExecutable", "-string", renamedHelper, helperPlist]);
243+
setNames(helperPlist, renamedHelper);
244+
NodeFS.renameSync(
245+
NodePath.join(frameworks, helper),
246+
NodePath.join(frameworks, `${renamedHelper}.app`),
247+
);
248+
}
225249
const renamed = NodePath.join(NodePath.dirname(app), `${APP_NAME}.app`);
226250
NodeFS.renameSync(app, renamed);
227251
return renamed;

0 commit comments

Comments
 (0)