@devries-cameron20 / t3code Mirror · read-only / commits / a16796b956
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 11:00 UTC

fix(shared): ß no longer splits words in generated folder and branch names (#37152)

Co-authored-by: lowlyleon <183293296+lowlyleon@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

Leon committed Nov 15, 2026 at 12:18 UTC a16796b956ae670db221df6178ab7f724c2f817c
4 files changed +15 -5
packages/shared/src/git.test.ts
+7
@@ -363,6 +363,13 @@ describe("sanitizeFeatureBranchName", () => {
363 "fix/anadir-validacion-del-cafe",
364 );
365 });
366 +
367 + it("keeps words with letters that have no Unicode decomposition whole", () => {
368 + expect(sanitizeFeatureBranchName("Größe der Straße korrigieren")).toBe(
369 + "feature/grosse-der-strasse-korrigieren",
370 + );
371 + expect(sanitizeFeatureBranchName("fix/Đặt tên")).toBe("fix/dat-ten");
372 + });
373 });
374
375 describe("resolveAutoFeatureBranchName", () => {
packages/shared/src/git.ts
+3 -3
@@ -9,6 +9,8 @@ import type {
9 import * as Arr from "effect/Array";
10 import * as Result from "effect/Result";
11
12 +import { foldLatinDiacritics } from "./path.ts";
13 +
14 export const WORKTREE_BRANCH_PREFIX = "t3";
15 const TEMP_WORKTREE_HEX_TOKEN = "[0-9a-f]{8}";
16 const TEMP_WORKTREE_UUID_V4_TOKEN =
@@ -18,9 +20,7 @@ const TEMP_WORKTREE_BRANCH_PATTERN = new RegExp(
20 );
21
22 export function sanitizeBranchFragment(raw: string): string {
21 - const normalized = raw
22 - .normalize("NFKD")
23 - .replace(/[̀-ͯ]/g, "")
23 + const normalized = foldLatinDiacritics(raw)
24 .trim()
25 .toLowerCase()
26 .replace(/['"`]/g, "")
packages/shared/src/path.test.ts
+1
@@ -30,6 +30,7 @@ describe("path helpers", () => {
30 expect(newProjectFolderName("Pinball Stats")).toBe("pinball-stats");
31 expect(newProjectFolderName(" Café & Crème! ")).toBe("cafe-creme");
32 expect(newProjectFolderName("Đặt tên dự án")).toBe("dat-ten-du-an");
33 + expect(newProjectFolderName("Straßenbahn GROẞ")).toBe("strassenbahn-gross");
34 expect(newProjectFolderName("../../etc")).toBe("etc");
35 expect(newProjectFolderName("🎱🎱")).toBe("project");
36 expect(newProjectFolderName(`${"a".repeat(63)} b`)).toBe("a".repeat(63));
packages/shared/src/path.ts
+4 -2
@@ -68,8 +68,10 @@ export function foldLatinDiacritics(text: string): string {
68 return text
69 .normalize("NFKD")
70 .replace(/[\u0300-\u036f]/g, "")
71 - .replace(/đ/g, "d") // d-with-stroke has no Unicode decomposition
72 - .replace(/Đ/g, "D");
71 + .replace(/đ/g, "d") // d-with-stroke and sharp s have no Unicode decomposition
72 + .replace(/Đ/g, "D")
73 + .replace(/ß/g, "ss")
74 + .replace(/ẞ/g, "SS");
75 }
76
77 export function newProjectFolderName(name: string): string {