Repository navigation
Description
Web UI: unmarked Chinese strings survive the English render on /chat and /settings
Summary
createPageHandler (runtime/flybot-workspace-web/src/pages.js:166) rewrites a page into
English only for elements that carry a data-ui-* marker. On /chat and /settings
— the two pages that take the server-side locale path — 199 Chinese text nodes and
67 Chinese title / aria-label / placeholder / alt values have no marker, so the
English document still shows them verbatim. Marked elements on the same pages have zero
leftovers, so the catalog itself is complete; the gap is coverage of the markup.
Exact revision
- main
e6aeae4e2bae52d13e721506a41e598a222655ea, tree
93a2fb2da2c93adfe58df4ae7f6165519c15d590(rebuilt from codeload withgit add -Af,
git write-treematches). flybot_workspace/staticsubtree634956966a3e1e10dac9d2a54998b73d0827be94(173 files).
What the renderer does
flybot_workspace/static/shell/system-locale.mjs:59 renderSystemLocale() walks HTML
tags and, for a tag carrying data-ui-title|label|placeholder|alt|option-group, replaces
that attribute with the catalog phrase, and for a leaf carrying data-ui-text replaces its
text. Anything without a marker is returned unchanged. pages.js:234 applies this only to
/chat and /settings.
Actual vs expected
Measured by rendering both pages through the production handler with
getShellSettings: async () => ({language: 'en'}) and scanning the returned HTML for
[\u4e00-\u9fff]:
| page | zh leaf text nodes | marked | unmarked | zh attrs | marked | unmarked |
|---|---|---|---|---|---|---|
/chat (chat/index.html) |
445 | 410 | 35 | 142 | 132 | 10 |
/settings (settings/index.html) |
245 | 81 | 164 | 80 | 23 | 57 |
After the English render, the leftovers are exactly the unmarked set; no element that
carries a marker keeps Chinese (en-leftovers.log, en-text-leftovers.log).
Expected: an English render contains no Chinese except values that are Chinese by
design (the language names 简体中文 / 日本語 in the language picker).
Actual /chat: 10 attributes — Bot 电脑 ×3, 提示词模板 ×2, 归档对话, 群邀请链接,
群聊待处理卡片, 私聊待处理卡片, 关闭 — and 35 text nodes, e.g. 已归档, 重试,
重命名, 恢复对话, 生成群邀请链接, 选择联系人或智能体加入群组。.
Actual /settings: 57 attributes — 正在读取连接配置。 ×31, 未接通:Composio 没有这个应用,暂时不能连接。 ×8,
返回设置 ×7, 账户菜单, 发送消息, 换行快捷键, 粘贴你的 Composio API key,
搜索应用…, 按分类筛选, … — and 164 text nodes (83 distinct), e.g. + 连接 ×39,
正在读取… ×31, 外观, 始终使用浅色主题。.
The client-side fallback does not close the gap either: applySystemLocale() in the same
module only rewrites elements that carry the markers too, and only /settings calls it
(static/settings/app.mjs:41).
Why the current tests miss it
tests/system_locale.test.mjsrenders the two pages but asserts three literal strings
(AI & agent settings,System language,>Send) and one regex on#chat-send.tests/system_locale_chat.test.mjsiterates thedata-ui-*keys ofchat/index.html
and asserts each one resolves; a key that is absent from the markup is never examined.- Nothing counts Chinese left in the output, so an unmarked element is invisible to the
suite by construction.
Repro (local, no runtime needed)
node --input-type=module -e '
import {createPageHandler, PAGE_PATH} from "./runtime/flybot-workspace-web/src/pages.js";
const pagesDir = "./flybot_workspace/static";
const h = createPageHandler({pagesDir, identity:{instanceId:"repro"}, getShellSettings: async () => ({language:"en"})});
for (const p of ["/chat","/settings"]) {
const r = await h(new Request("http://local.test" + PAGE_PATH + "?path=" + encodeURIComponent(p)));
const html = await r.text();
console.log(p, r.headers.get("content-language"), (html.match(/[\u4e00-\u9fff]/g)||[]).length + " han chars");
}'On e6aeae4e this prints content-language: en together with thousands of Han
characters on both pages. A render with language: "zh-CN" is byte-identical to the
shipped file, so the marker path itself is sound.
Proposed slice (one PR)
- Add
data-ui-text/data-ui-label/data-ui-title/data-ui-placeholdermarkers
plus catalog entries for every unmarked Chinese string inchat/index.htmland
settings/index.html— only these two files (199 text nodes, 67 attributes). - Add a regression test that renders both pages in English and asserts zero Han
characters outside an allowlist (the language-name options), instead of three literals. - Keep values that are Chinese by design (language names, third-party product names)
in the allowlist with a comment.
Non-goals
- Runtime-assigned Chinese
aria-labelstrings in.mjsmodules (separate slice; that
path has no catalog hook today). - Pages outside the server-side locale path (
/discover,/meetings, … consider their own
renderer). - Translating product content or user data.
Notes
- All numbers above were measured locally against the exact tree named; this is not a CI
result and makes no parity claim. - The runtime-assigned Chinese
aria-labelvalues in.mjsmodules are a separate
slice; no issue tracks them yet.
Patch status (2026-11-29)
The /chat half is written and tested locally, so this issue can be split into two PRs and
the first one is ready to push:
- commit
c01a6c0c475458bebedde37728d81caa845fe37don a branch cut from main
ee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8, tree
14f749d49489e253a067d92aa10c2e73dddb41ef, 3 files+93/-43
(flybot_workspace/static/chat/index.html43 lines, 34 newCHAT_MESSAGESpairs,
tests/system_locale_chat.test.mjs+14). - 45 new markers (35
data-ui-text, 10 attribute slots); 5 existing keys were reused
(chat.retry,chat.invite.copy_link,chat.closetwice,chat.cancel,chat.load_more). - English render of
/chatgoes from 231 Han characters to 0 outside
<script>/<style>; the Chinese render keeps the same text and attributes, and differs
only by the addeddata-ui-*markers and the content-derived asset URL hash.
Re-measured on the new-main tree: 0 characters, 0 lines. - The
flybot_workspace/staticsubtree is still63495696on the new main, so the render
numbers carry over by content, not by argument. - Local, not CI:
tests/chat_language|chat_page|chat_reminder|system_locale|system_locale_chat
= 240/240 pass, 0 fail, run on the commit above with nodev22.23.5and
--test-concurrency=2.
The /settings half (164 text nodes, 57 attributes) stays a separate slice: it is five
times the size and needs product copy for 31 "reading connection settings" style strings.
Activity
Birfy commentedon Nov 29, 2026
Claiming this slice as
dev/3438-chat-markup-en-render, cut frommainee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8.Scope of this PR (one slice): the
/chatmarkup only — 45 newdata-ui-*markers inflybot_workspace/static/chat/index.html, 34 newCHAT_MESSAGESpairs inflybot_workspace/static/shell/system-locale-chat.mjs, and one regression assertion intests/system_locale_chat.test.mjsthat renders/chatin English and fails on survivingChinese. The
/settingshalf (164 text nodes, 57 attributes) stays a separate slice.All measurements are local single-host readings, not CI.
Birfy commentedon Nov 29, 2026
The
/chathalf of this issue landed onmain.3f9b8ab06cb6d5f14e458ed411cf24e1281b4f78, single parentee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8(squash through the merge queue, merged 10:23:03Z).92aff11533e84609e6423ba857cf4bc8d369d057, the same tree the review and QA evidence were bound to; 4 files,+120/−70.8c79571c8ff270e5f975491613ee6b6731098d27, where CI readtotal_count 18 == returned 18, allcompleted+success, no failures or cancellations./chatnow carries 0 Han characters outside<script>/<style>; swappingchat/index.htmlback to the base blob reproduces 231 characters over 43 lines (45 contiguous runs), so the change, not the renderer, is the cause.docs/inventory/visible-controls.jsonwas regenerated in the same PR;scripts/visible_inventory.pyreproduces it byte for byte.flybot_workspace/staticsubtree was63495696before and this PR changes files inside it, so the render readings measured here are the new baseline for the pages it touches. The/settingspage is untouched and still carries 1,751 Han characters in the English render.Still open in this issue: the
/settingshalf — 164 text nodes and 57 attribute values, five times the size of/chat, and it needs English copy for the 31 "reading connection settings" style strings that repeat. That is the next slice.Releasing
agent-workingso the issue does not look claimed while nothing is in flight; the/settingsslice needs a claim of its own.Related #3439. Refs #3438.
Birfy commentedon Nov 29, 2026
Claiming this for slice A; the slice B (
/settingspanels) stays out of this branch.Branch
dev/3438-settings-connectors-en, cut fromfdf0b8603d327d7ee4522048efe63c6bd7071020, head commit2068440af44f5ebd2e8bb4343967ae125b903554, treeb7da08afff8fe1e6ba91e34414e62c9a071aaf48.Scope of this slice: the connector directory row template on
/settings— 39 rows, 78 text nodes and 39 attribute values that have no locale marker, so the English render leaves them Chinese. Out of scope: every other/settingspanel, the language picker names, and any CSS or layout change.One product decision, made here so the slice is reviewable: the language names in slice B keep each language's own script (endonyms such as
简体中文,日本語,繁體中文) rather than romanized forms, and the assertions whitelist those controls by key instead of accepting any string. That decision is open to the maintainer's override.Local evidence is on the head above; no CI run has been read on it.
Let the Settings connector counts tolerate the locale markers
Birfy commentedon Nov 29, 2026
Slice A landed as squash
2facf12ebf5a2151e17dcc497a5b3da5a674580f, single parent63b36a9193c77703079858fb6599412c4fb6120e, no merge commit. Landing tree03576b023ebe, which differs from the tree bound in the review (3a0927f5) only because main had advanced with #3445 (docs) between this branch's basefdf0b860and the merge; the merge queue rebased onto the newer main.Checking the landing commit against its parent
63b36a91shows exactly the six files of this PR and nothing else, with the same blobs the review bound:docs/inventory/visible-controls.jsona96a8f8afbe3+39/−39flybot_workspace/static/settings/index.htmle67e38c07a37+78/−78flybot_workspace/static/shell/system-locale-catalog.mjsf16a6ddd82f9+5/−0tests/settings_page.test.mjsbed3e5949347+6/−4tests/system_locale_settings.test.mjsb155f75a13b4+75/−0tests/test_settings_page.py51a82e1510d0+7/−56 files,
+210/−126. The landing message ends withRelated #3438and carries no closing keyword, so the merge did not close this issue.Review: review
6102740160bound head4e9e4be166e3, tree3a0927f5; CI on that exact head was 18/18completed+success.History worth keeping: an earlier head
2068440af44fwas red —tests/test_settings_page.py:418AssertionError: 0 != 31on bothManagement APIjobs — because four Python assertions pinned the whole substringdata-state="loading">正在读取…<.4e9e4be1fixed exactly that, one file,+7/−5.Still open on this issue: slice B, the remaining
/settingspanels. The language-name decision for it is recorded in the claim comment (keep each language's own script, whitelist the controls by key).This is a landing record, not a claim of parity or acceptance.
Birfy commentedon Nov 30, 2026
Next slice for this issue (the
#3471slice landed asf55e481band this issue stays open for the remaining strings).Branch:
dev/3438-settings-connectors-strings.Scope: the Chinese strings that
flybot_workspace/static/settings/app.mjsinjects at runtime into the English render — 704 CJK characters over 84 lines, of which the connectors block is 416 characters over 42 lines / 48 distinct strings. This is a different mechanism from the missingdata-ui-*markers that#3471fixed: the markup is already marked, but the script inserts Chinese copy after render.Constraints:
tests/settings_page.test.mjs:1008-1074asserts the zh literals byte-for-byte, so the Chinese output must not change;docs/inventory/visible-controls.jsonneeds no regeneration because no marker moves.Related #3438
Birfy commentedon Nov 30, 2026
Branch for this slice:
dev/3438-settings-runtime-strings(pull request #3477).Scope: the remaining
/settingsruntime strings (appearance summary, skill-key dialog, model/image/media API status, sign-in, form toasts) move onto the shared locale machinery through a localSETTINGS_TEXTtable andsettingsText(), reusing catalog keys where the wording already matches. Connectors were handled separately in #3476.Acceptance: English rendering carries no Chinese in those paths, the zh output stays byte-identical, and
docs/inventory/visible-controls.jsonregenerates unchanged on the head tree.Related #3438
Birfy commentedon Nov 30, 2026
Slice 4 is up as #3478, branch
dev/3438-settings-html-strings, headff3d7b0a07298c851e37b2aa5c1438b408ddd4fe, one commit onmain0b069b37, 4 files+160/−64.Scope:
settings/index.html(45 markers on 43 controls, including the two rail controls),shell/system-locale-catalog.mjs(45 zh/en pairs), regenerateddocs/inventory/visible-controls.json, and two cases intests/system_locale_settings.test.mjs.Related #3438