Skip to content

Web UI: unmarked Chinese strings survive the English render on /chat and /settings #3438

Backlog

Description

@Birfy

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 with git add -Af,
    git write-tree matches).
  • flybot_workspace/static subtree 634956966a3e1e10dac9d2a54998b73d0827be94 (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.mjs renders 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.mjs iterates the data-ui-* keys of chat/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)

  1. Add data-ui-text / data-ui-label / data-ui-title / data-ui-placeholder markers
    plus catalog entries for every unmarked Chinese string in chat/index.html and
    settings/index.html — only these two files (199 text nodes, 67 attributes).
  2. 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.
  3. 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-label strings in .mjs modules (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-label values in .mjs modules 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 c01a6c0c475458bebedde37728d81caa845fe37d on a branch cut from main
    ee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8, tree
    14f749d49489e253a067d92aa10c2e73dddb41ef, 3 files +93/-43
    (flybot_workspace/static/chat/index.html 43 lines, 34 new CHAT_MESSAGES pairs,
    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.close twice, chat.cancel, chat.load_more).
  • English render of /chat goes from 231 Han characters to 0 outside
    <script>/<style>; the Chinese render keeps the same text and attributes, and differs
    only by the added data-ui-* markers and the content-derived asset URL hash.
    Re-measured on the new-main tree: 0 characters, 0 lines.
  • The flybot_workspace/static subtree is still 63495696 on 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 node v22.23.5 and
    --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

  1. added
    agent-ready
    agent-working
    on Nov 29, 2026
  2. Birfy commented on Nov 29, 2026

    @Birfy
    CollaboratorAuthor

    Claiming this slice as dev/3438-chat-markup-en-render, cut from main ee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8.

    Scope of this PR (one slice): the /chat markup only — 45 new data-ui-* markers in
    flybot_workspace/static/chat/index.html, 34 new CHAT_MESSAGES pairs in
    flybot_workspace/static/shell/system-locale-chat.mjs, and one regression assertion in
    tests/system_locale_chat.test.mjs that renders /chat in English and fails on surviving
    Chinese. The /settings half (164 text nodes, 57 attributes) stays a separate slice.

    All measurements are local single-host readings, not CI.

  3. Birfy commented on Nov 29, 2026

    @Birfy
    CollaboratorAuthor

    The /chat half of this issue landed on main.

    • Merge commit 3f9b8ab06cb6d5f14e458ed411cf24e1281b4f78, single parent ee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8 (squash through the merge queue, merged 10:23:03Z).
    • Content tree 92aff11533e84609e6423ba857cf4bc8d369d057, the same tree the review and QA evidence were bound to; 4 files, +120/−70.
    • Head of the reviewed branch was 8c79571c8ff270e5f975491613ee6b6731098d27, where CI read total_count 18 == returned 18, all completed + success, no failures or cancellations.
    • English render of /chat now carries 0 Han characters outside <script>/<style>; swapping chat/index.html back 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.json was regenerated in the same PR; scripts/visible_inventory.py reproduces it byte for byte.
    • The flybot_workspace/static subtree was 63495696 before and this PR changes files inside it, so the render readings measured here are the new baseline for the pages it touches. The /settings page is untouched and still carries 1,751 Han characters in the English render.

    Still open in this issue: the /settings half — 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-working so the issue does not look claimed while nothing is in flight; the /settings slice needs a claim of its own.

    Related #3439. Refs #3438.

  4. added
    agent-working
    and removed
    agent-working
    on Nov 29, 2026
  5. Birfy commented on Nov 29, 2026

    @Birfy
    CollaboratorAuthor

    Claiming this for slice A; the slice B (/settings panels) stays out of this branch.

    Branch dev/3438-settings-connectors-en, cut from fdf0b8603d327d7ee4522048efe63c6bd7071020, head commit 2068440af44f5ebd2e8bb4343967ae125b903554, tree b7da08afff8fe1e6ba91e34414e62c9a071aaf48.

    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 /settings panel, 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.

  6. Birfy commented on Nov 29, 2026

    @Birfy
    CollaboratorAuthor

    Slice A landed as squash 2facf12ebf5a2151e17dcc497a5b3da5a674580f, single parent 63b36a9193c77703079858fb6599412c4fb6120e, no merge commit. Landing tree 03576b023ebe, which differs from the tree bound in the review (3a0927f5) only because main had advanced with #3445 (docs) between this branch's base fdf0b860 and the merge; the merge queue rebased onto the newer main.

    Checking the landing commit against its parent 63b36a91 shows exactly the six files of this PR and nothing else, with the same blobs the review bound:

    File Blob Change
    docs/inventory/visible-controls.json a96a8f8afbe3 +39/−39
    flybot_workspace/static/settings/index.html e67e38c07a37 +78/−78
    flybot_workspace/static/shell/system-locale-catalog.mjs f16a6ddd82f9 +5/−0
    tests/settings_page.test.mjs bed3e5949347 +6/−4
    tests/system_locale_settings.test.mjs b155f75a13b4 +75/−0
    tests/test_settings_page.py 51a82e1510d0 +7/−5

    6 files, +210/−126. The landing message ends with Related #3438 and carries no closing keyword, so the merge did not close this issue.

    Review: review 6102740160 bound head 4e9e4be166e3, tree 3a0927f5; CI on that exact head was 18/18 completed + success.

    History worth keeping: an earlier head 2068440af44f was red — tests/test_settings_page.py:418 AssertionError: 0 != 31 on both Management API jobs — because four Python assertions pinned the whole substring data-state="loading">正在读取…<. 4e9e4be1 fixed exactly that, one file, +7/−5.

    Still open on this issue: slice B, the remaining /settings panels. 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.

  7. Birfy commented on Nov 30, 2026

    @Birfy
    CollaboratorAuthor

    Next slice for this issue (the #3471 slice landed as f55e481b and this issue stays open for the remaining strings).

    Branch: dev/3438-settings-connectors-strings.

    Scope: the Chinese strings that flybot_workspace/static/settings/app.mjs injects 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 missing data-ui-* markers that #3471 fixed: the markup is already marked, but the script inserts Chinese copy after render.

    Constraints: tests/settings_page.test.mjs:1008-1074 asserts the zh literals byte-for-byte, so the Chinese output must not change; docs/inventory/visible-controls.json needs no regeneration because no marker moves.

    Related #3438

  8. Birfy commented on Nov 30, 2026

    @Birfy
    CollaboratorAuthor

    Branch for this slice: dev/3438-settings-runtime-strings (pull request #3477).

    Scope: the remaining /settings runtime strings (appearance summary, skill-key dialog, model/image/media API status, sign-in, form toasts) move onto the shared locale machinery through a local SETTINGS_TEXT table and settingsText(), 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.json regenerates unchanged on the head tree.

    Related #3438

  9. Birfy commented on Nov 30, 2026

    @Birfy
    CollaboratorAuthor

    Slice 4 is up as #3478, branch dev/3438-settings-html-strings, head ff3d7b0a07298c851e37b2aa5c1438b408ddd4fe, one commit on main 0b069b37, 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), regenerated docs/inventory/visible-controls.json, and two cases in tests/system_locale_settings.test.mjs.

    Related #3438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyagent-working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions