You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dd7599d
Browse filesBrowse the repository at this point in the historyBrowse files
Read a remote file chip's download title in the window's language (#3114) (#3259)
Written-by: Dev
Fixes#3258
Part of #3114
Owner: Dev
Reviewer: Reviewer
Docs-not-needed: one dictionary entry and one draw site in the chat
cells; no architecture change.
## What changed
Before: hovering a remote file chip in a zh window read `Download
log.txt (untrusted file from a remote Bot)`. After: it reads `下载
log.txt(来自远程 Bot 的不可信文件)`, and an English window keeps today's sentence
byte for byte.
`core/src/client/cells.js:463` no longer builds the sentence as a
template literal; it draws `t('Download {name} (untrusted file from a
remote Bot)', { name: file.name })`, and `core/src/client/i18n.js` gains
that key right after `Download: '下载',`. The file name is the sender's
data and is filled in untranslated — `fill` uses a function replacer, so
`$&`, `$1` or a literal `{name}` inside a name stay literal. Downloads
(`onClick` / attachment call / object-URL cleanup), file-name cleaning
and other screens are untouched.
## Verification at the tip
Tip SHA: `382c70cb035332e8bfb495a2a6684d7aea16896f`
Ran:
- `(cd core && TZ=UTC node --test test/empty-message-cell.test.js)` —
red first on `cc885ca4` before the implementation: `# tests 5 / # pass 3
/ # fail 2` (test 4's actual title was `Download log.txt (untrusted file
from a remote Bot)`; test 5 also pinned the missing dictionary value);
green at the tip: `# tests 5 / # pass 5 / # fail 0`.
- `(cd core && TZ=UTC node --test test/i18n.test.js)` — 3/3/0
(dictionary gate: every drawn `t('…')` has an entry).
- Five i18n gates: `test/i18n.test.js test/i18n-missing-entries.test.js
test/i18n-template-draws.test.js test/i18n-plugins.test.js
test/i18n-plugins-missing-zh.test.js` — 39/39/0; three baselines 12 / 9
/ 46 ok.
- `(cd core && npm run build)` then `node scripts/ds-bot-patches.mjs
generate` twice (idempotent), `canonical`, `check` — `ok patches/ds-bot/
is what generate writes`, `ok 10 patches apply cleanly in order`, `ok
core/ equals ds-bot/ + patches/ds-bot/`; `git status --porcelain` empty.
- `node core/scripts/build-client.mjs --check` — rc 0; `git diff
--exit-code -- core/client.js` rc 0.
- `node .github/scripts/changelog.mjs check` — `12 fragment(s) ... well
formed`; `node .github/scripts/check-mojibake.mjs --check` — 0
occurrences of U+FFFD in 1781 text files.
- `ARCH_DOCS_BASE=cc885ca47e13f9754b36eae3842595ece16455ef node
core/scripts/check-arch-docs.mjs` — `arch-docs: OK (9 changed file(s))`.
- `risk-gate.judge()` over the PR files — `T1 0 50 4 5` (tier T1, empty
why, 50 handwritten lines, 4 handwritten files, 5 generated).
Generated artifacts: `core/client.js` (+5/−1),
`patches/ds-bot/0001-core-fixes.patch` (+5/−1),
`0003-flybot-api-client.patch` (+1/−1), `0008-client-bundle.patch`
(+6/−2), `files/test/empty-message-cell.test.js` (+41/−2);
`patches/ds-bot/topics.json` untouched.
Not run (and why):
- `npm run verify` — the shared `@deepseek-ai` harness install is not
usable on this machine (`core/node_modules` is the build-only esbuild
install), so the full suite would be red for reasons unrelated to this
change. The affected test file, the dictionary gates and every
generated-artifact check above were run instead.
- Smoke test and Desktop — not needed for a client copy change with no
host or component structure change.
## Checkpoint
<!-- flybot:checkpoint -->
```json
{
"pr": 3259,
"claim": "Dev",
"issue": 3258,
"summary": "Remote file chips in a chat now read their hover title from the dictionary, so a zh window says the file comes from a remote Bot and is untrusted while an English window keeps today's sentence. The file name is the sender's data and is filled into the sentence untranslated. The change is one dictionary entry and one draw point; downloads, file-name cleaning and other screens are untouched.",
"files": ["core/src/client/i18n.js", "core/src/client/cells.js", "core/test/empty-message-cell.test.js", "changelog.d/3114-remote-file-chip-zh.fixed.md"],
"checks": { "ran": "cd core && TZ=UTC node --test test/empty-message-cell.test.js (5/5/0), i18n gates (39/39/0), ds-bot-patches generate/canonical/check, build-client --check", "result": "green", "at": "382c70cb035332e8bfb495a2a6684d7aea16896f" },
"next": "none — ready for review"
}
```
<!-- /flybot:checkpoint -->
A remote file chip in a chat now explains its download in a zh window: the hover title says the file comes from a remote Bot and is untrusted, while the file name stays exactly as the sender sent it ([#3114](https://github.com/ThinkFlowLab/FlyBot/issues/3114)).
0 commit comments