Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 55 additions & 4 deletions packages/installer/assets/runtime/preload.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* gap-1 gap-0">` wrapper that holds one or more `<div class="flex flex-col
* gap-px">` groups of buttons. There are no stable `role` / `aria-label` /
* `data-testid` hooks on the shell so we identify the sidebar by text-content
* match against known item labels (General, Appearance, Configuration, …).
* match against known item labels (General, Appearance, Configuration, …)
* across Codex's supported UI languages.
*
* Layout we inject:
*
Expand Down
54 changes: 53 additions & 1 deletion packages/installer/assets/runtime/preload/settings-injector.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

54 changes: 53 additions & 1 deletion packages/runtime/src/preload/settings-injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* gap-1 gap-0">` wrapper that holds one or more `<div class="flex flex-col
* gap-px">` groups of buttons. There are no stable `role` / `aria-label` /
* `data-testid` hooks on the shell so we identify the sidebar by text-content
* match against known item labels (General, Appearance, Configuration, …).
* match against known item labels (General, Appearance, Configuration, …)
* across Codex's supported UI languages.
*
* Layout we inject:
*
Expand Down Expand Up @@ -525,96 +526,147 @@ function compactSettingsText(value: string): string {

const CODEXPP_CORE_SETTINGS_LABELS = [
"General",
"일반",
"常规",
"通用",
"Appearance",
"외관",
"外观",
"Configuration",
"구성",
"配置",
"Default permissions",
"기본 권한",
"默认权限",
"Personalization",
"개인화",
"个性化",
].map(normalizeCodexPpSettingsLabel);

const CODEXPP_EXTENDED_SETTINGS_LABELS = [
"Account",
"계정",
"账户",
"账号",
"General",
"일반",
"常规",
"通用",
"Appearance",
"외관",
"外观",
"Configuration",
"구성",
"配置",
"Default permissions",
"기본 권한",
"默认权限",
"Personalization",
"개인화",
"个性化",
"Keyboard shortcuts",
"키보드 단축키",
"Archived chats",
"보관된 채팅",
"Usage",
"사용량",
"Computer use",
"컴퓨터 사용",
"Browser use",
"브라우저 사용",
"MCP servers",
"MCP Servers",
"MCP 서버",
"MCP 服务器",
"Git",
"Environments",
"환경",
"环境",
"Cloud Environments",
"클라우드 환경",
"Worktrees",
"작업 트리",
"Connections",
"연결",
"Plugins",
"플러그인",
"Skills",
"스킬",
].map(normalizeCodexPpSettingsLabel);

const CODEXPP_SETTINGS_ONLY_LABELS = [
"General",
"일반",
"常规",
"通用",
"Appearance",
"외관",
"外观",
"Configuration",
"구성",
"配置",
"Default permissions",
"기본 권한",
"默认权限",
"Personalization",
"개인화",
"个性化",
"Keyboard shortcuts",
"키보드 단축키",
"Archived chats",
"보관된 채팅",
"Usage",
"사용량",
"Computer use",
"컴퓨터 사용",
"Browser use",
"브라우저 사용",
"MCP servers",
"MCP Servers",
"MCP 서버",
"MCP 服务器",
"Git",
"Environments",
"환경",
"环境",
"Cloud Environments",
"클라우드 환경",
"Worktrees",
"작업 트리",
"Connections",
"연결",
].map(normalizeCodexPpSettingsLabel);

const CODEXPP_MAIN_APP_NAV_LABELS = [
"New chat",
"새 채팅",
"Quick chat",
"빠른 채팅",
"快速对话",
"Search",
"검색",
"搜索",
"Plugins",
"플러그인",
"插件",
"Automations",
"Automation",
"자동화",
"自动化",
"Chats",
"Chat",
"채팅",
"对话",
"Projects",
"프로젝트",
"项目",
"Pinned",
"고정됨",
"Settings",
"설정",
"设置",
"Work locally",
"로컬에서 작업",
].map(normalizeCodexPpSettingsLabel);

function normalizeCodexPpSettingsLabel(value: string): string {
Expand Down
61 changes: 61 additions & 0 deletions packages/runtime/test/settings-injector-labels.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import test from "node:test";

const repoRoot = process.cwd();
const runtimeSource = readFileSync(
resolve(repoRoot, "packages/runtime/src/preload/settings-injector.ts"),
"utf8",
);
const bundledPreload = readFileSync(
resolve(repoRoot, "packages/installer/assets/runtime/preload/settings-injector.js"),
"utf8",
);

const koreanSettingsLabels = [
"일반",
"외관",
"구성",
"기본 권한",
"개인화",
"키보드 단축키",
"보관된 채팅",
"사용량",
"컴퓨터 사용",
"브라우저 사용",
"MCP 서버",
"환경",
"클라우드 환경",
"작업 트리",
"연결",
];

const koreanMainNavLabels = [
"새 채팅",
"빠른 채팅",
"검색",
"플러그인",
"자동화",
"채팅",
"프로젝트",
"고정됨",
"설정",
"로컬에서 작업",
];

test("source settings injector recognizes Korean Codex settings labels", () => {
assertLabelsPresent(runtimeSource, koreanSettingsLabels);
assertLabelsPresent(runtimeSource, koreanMainNavLabels);
});

test("bundled settings injector recognizes Korean Codex settings labels", () => {
assertLabelsPresent(bundledPreload, koreanSettingsLabels);
assertLabelsPresent(bundledPreload, koreanMainNavLabels);
});

function assertLabelsPresent(source: string, labels: string[]): void {
for (const label of labels) {
assert.ok(source.includes(label), `missing Korean label: ${label}`);
}
}