Skip to content

Settings: mark the connectors panel for English - #3471

Open
Birfy wants to merge 1 commit into
mainfrom
dev/3438-settings-connectors-en
Open

Birfy wants to merge 1 commit into
mainfrom
dev/3438-settings-connectors-en

Conversation

@Birfy

@Birfy Birfy commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

What

The connectors subtree of /settings was the largest Chinese block left in the English render: 304 CJK characters over 29 text nodes and 4 attributes (返回设置, 粘贴你的 Composio API key, 搜索应用…, 按分类筛选, plus the key card, the catalog chrome, the empty state, the custom-MCP section and the MCP dialog). Unlike /chat, this subtree has no page-level dictionary, so every visible string is static text in settings/index.html that renderSystemLocale had nothing to match.

This PR tags those strings and adds their catalog entries. It does not touch the Composio row state machine or any runtime message string (see Out of scope).

Shape

Base d57d6da41941822b9067cc579ad4944da3715eb3 (tree 8d620c66), patch tree 937a965f, 4 files, +84/−52. The patch applies to that base without fuzz and touches nothing else: the patched tree differs from the base tree in exactly these four paths (both trees have 2228 entries).

path base blob head blob lines
flybot_workspace/static/settings/index.html e058820b 39f18cd7 32/32
flybot_workspace/static/shell/system-locale-catalog.mjs 95cb0990 bd8999ab 32/0
docs/inventory/visible-controls.json 49bfde63 6dc1ca1a 19/19
tests/test_settings_page.py 23eb5535 dec7caf1 1/1

Changes

  • flybot_workspace/static/settings/index.html — 33 new markers (29 data-ui-text, 2 data-ui-label, 2 data-ui-placeholder) over 32 changed lines, backed by 32 new keys; the back link (返回设置) reuses the existing settings.back. Both hunks land inside the connectors block (it starts at line 534); nothing above it moves, and the sub-page keys already in this file are untouched.
  • flybot_workspace/static/shell/system-locale-catalog.mjs — 32 new settings.connectors.* key pairs appended to the existing block (6 → 38 keys; SETTINGS_MESSAGES 116 → 148). The zh-CN values are copied from the existing static text byte for byte. Every added key is referenced by a marker in this page, so the catalog gains no orphan keys, and every added English value is CJK-free. No JS logic changes.
  • docs/inventory/visible-controls.json — regenerated with the tree's own scripts/visible_inventory.py; only line values move (the markers add no controls). Regenerating again on the patched tree leaves the file byte-identical.
  • tests/test_settings_page.py — one pinned assertion matched the retry button's exact attribute string (id="composio-retry" class="secondary" hidden>重试读取状态</button>); it now matches id="composio-retry" plus hidden plus the Chinese text, keeping the same guarantee while allowing locale markers beside them.

Two structural edits were needed because renderSystemLocale only translates leaf nodes:

  • the category chips split into <span data-ui-text=…>label</span> <span data-count></span>, since the count is written at runtime and a node with children is skipped;
  • the three custom-MCP form labels wrap their text in a <span> for the same reason.

Evidence (local, not CI)

Every reading below was taken on the patched tree built from base d57d6da4 + this patch (tree 937a965f), rendered through the real createPageHandler (not a direct renderSystemLocale call), with getSystemLanguage: () => 'en'.

settings block en CJK base → head zh visible text + attributes
connectors 304 → 0 (29 nodes and 4 attributes → 0) byte-identical
appearance / shortcuts / privacy / agent-access 0 → 0 byte-identical
language 30 → 30 byte-identical
model-api 193 → 193 byte-identical
skill-configuration 225 → 225 byte-identical
channels 63 → 63 byte-identical
shell / page chrome 6 → 6 byte-identical
page total 821 → 517 byte-identical
  • zh-CN: all 9 blocks compare equal between base and head for visible text and for every aria-label / placeholder / title / alt / label value (connectors: text 3,671 B, attributes 1,795 B, unchanged).
  • inventory: scripts/visible_inventory.py on the patched tree reports 1913 / 266 / 6 / 24, and rerunning it leaves docs/inventory/visible-controls.json byte-identical (sha256 b3e1dd95…).
  • marker audit: 38 markers in the connectors panel, every key present in SETTINGS_MESSAGES, every zh-CN value equal to the static text, every en value free of CJK — 0 problems.
  • live HTTP, same data dir and cookie, head tree then base tree (10 settings routes, 200 on both): visible text after tag stripping is identical (4,639 characters each), the attribute multiset differs by exactly the 33 new markers and nothing else, and the body grows by 1,768 B. The only per-node difference is whitespace: wrapping the chip labels and the MCP form labels in <span> drops one trailing space each.
  • python -m unittest tests.test_visible_inventory tests.test_settings_page → 23 tests OK (13.4 s).
  • node --test --test-concurrency=2 tests/*.test.mjs .github/scripts/*.test.mjs → 1093 pass / 0 fail / 0 cancelled (23.7 s), including settings_page.test.mjs, system_locale.test.mjs, system_locale_chat.test.mjs and system_locale_catalog.test.mjs (46/46 when run alone).

Out of scope (residual, next slice)

The Composio row state machine in static/settings/app.mjs writes Chinese at runtime and overwrites these markers once the catalog loads: the key badge (已保存 / 未配置 Composio / 正在读取配置… / 状态暂不可用), the key input placeholder, the two counters (N 个已连接, N 个应用 · M 个分类), composioRowState (~12 status/button/title strings) and COMPOSIO_ERRORS (8 strings). Their catalog keys belong to the slice that wires them, so none are added here. Those strings are not in this PR; the counts above are the server-rendered HTML, not a browser session. The language (30), model-api (193), skill-configuration (225), channels (63) and shell (6) blocks are also untouched. No browser screenshot: Playwright/Chromium is not available on this host, so the English reading stops at the rendered HTML.

Related #3438

The connectors subtree of /settings was the largest Chinese block left in the
English render: 304 CJK characters over 29 text nodes and 4 attributes. It sits
in settings/index.html with no page-level dictionary, so every visible string is
static text that renderSystemLocale could not reach.

Tag each of those strings with data-ui-text / data-ui-label / data-ui-placeholder
and add the matching settings.connectors.* keys (38 now, 32 new) to
SETTINGS_MESSAGES in system-locale-catalog.mjs. The zh values are copied from the
existing static text byte for byte, so the Chinese render is unchanged, and every
new key is referenced by a marker in this page, so the file gains no orphan keys.

Two structural edits were needed: the category chips split their label and count
into two spans (the count is filled at runtime, so the label alone must be a leaf
node for the translator), and the three custom-MCP form labels wrap their text in
a span for the same reason.

The pinned assertion in tests/test_settings_page.py matched the retry button's
exact attribute string; it now matches the id plus hidden plus the Chinese text,
which keeps the same guarantee while allowing locale markers beside them.

Related #3438
@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant