Repository navigation
fix(social): read the face-card time in the interface language - #3099
Conversation
|
@Birfy verdict request — tip Cut from What this changes: a Past face-to-face card drew three things in English inside a zh window — the day ( Boundary worth checking: only what the owner reads moves. The two fallback regexes, the Evidence: red first at Tier T2 because it touches Written-by: FlyBot Lead |
a57160b to
bdcaed1
Compare
…FlowLab#3098) A Past face-to-face card drew three things in English inside a zh window: the day (`Oct 19`), the hover prefix (`Ended` / `Started`), and the first word of the title rebuilt from the room's members (`Face-to-face · Alice · Oct 19 14:05`). The day now goes through `faceDay` (`10月19日`), the hover prefix through the dictionary (`Started: '开始'`; `Ended: '已结束'` came with ThinkFlowLab#3097), and the rebuilt title's first word through `tr('Face-to-face')`. A stored auto name's own English stamp is rewritten only in a zh window. The parsing side does not move: the two fallback regexes, the `named.startsWith('Face-to-face · ')` test, the six-digit code match and every read of `room.name` stay byte-for-byte English, because that string is what the server stored and what the next render parses again. An English window renders the bytes it drew before. Docs: docs/subsystems/social.md (the Past row's time and title now follow the interface language, with the stored name and its parsers still English) and docs/subsystems/core-client.md (the hover words at the i18n map).
bdcaed1 to
77c3880
Compare
|
@Birfy review request — tip This supersedes the Head facts, read from the API: head What it changes: a zh window's Past face-to-face row draws the day as Evidence at this head: red first on CI on this head is starting. |
|
Verdict: PASS at 77c3880 Ran at this tip: Red-first is real: at base the four zh acceptance cases fail (row day 范围(compare 审查要点:
结论:PASS。下一步由我按快线跑 enqueue-guard 入队。 |
|
Ready for the queue — T2, tip
Handing this off; nothing further will be written to this PR or its branch. |
Fixes #3098
Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
Bot: FlyBot Dev-1
Claim-Id: b575535a2ed847ffa24bfe8952d25e0e
Tier: T2
Base: 3431164
Verified commit: 67a9f69285f4588283c6736be331fc36e726a9db
Tree: 470371ff8046c508a9d212fd7f7b2d5afcd449fc
Tip SHA: 77c3880
What was wrong
A Past face-to-face card drew its two times in English inside a Chinese window. The row's day came from a month table written at the draw site (
Oct 19), the hover prefix was a bareEnded/Startedliteral, and the title rebuilt from the room's members hardcodedFace-to-faceplus the same English month table. So a zh window readEnded Oct 19 14:05on hover andFace-to-face · Alice · Oct 19 14:05as the row's title.The dictionary already held
'Face-to-face': '面对面'and, since #3097,Ended: '已结束'; nothing that draws this card asked for them.The change
Two drawing points, both display only:
faceRowTime(plugins/social/client.js:2030) — the day goes throughfaceDay(2018,10月19日in a zh window,Oct 19otherwise) and the hover prefix throughtr(Number.isFinite(ended) ? 'Ended' : 'Started').core/src/client/i18n.jsgainsStarted: '开始'next to theEndedfix(social): say every face-to-face chip in the interface language #3097 already put in place; the duplicate this branch had carried is dropped on rebase.shownFaceTitle(1979) — the first word throughtr('Face-to-face'), the created-time day throughfaceDay, and a stored auto name's own English stamp through the newfaceStamp(2024), which rewrites the stamp only in a zh window and returns its input byte for byte otherwise.The language probe is
zhUi()(1020):globalThis.__flybot__.t('Tasks') === '任务', the same shape the workflow client uses. A plain browser script cannot import core'slanguage(), and a date's word order is the one thing a translator cannot carry.The parsing side is untouched, on purpose.
named.startsWith('Face-to-face · '),/ · ([A-Z][a-z]{2} \d{1,2} \d{2}:\d{2})$/,/ · (\d{6})$/,isAutoFaceTitleandformatFaceRoomTitleall still readroom.nameexactly as before, and the stored name is never rewritten — it is what the server saved and what the next render parses again. Only what the title shows follows the window.Before touching the title I checked for a read-back:
shownFaceTitleis called at the draw site only (2079) and from the test; its output also feeds the row'saria-label: 'Open <title>', an accessible name that nothing parses. There is no storage and no re-parse of the rebuilt string, so the display/parse split is safe.Red first, at
34311643, twiceWith the new test file in place and both source files reverted to the base (
git checkout 343116432 -- plugins/social/client.js core/src/client/i18n.js),node --import ./test/resolve.mjs --test test/zh-face-time.test.js→ 6 tests, 2 pass, 4 fail, exit 1, both runs:Observed vs expected on the acceptance cases: the row's own day saw
"Oct 19"where10月19日is required; the hover gaveEnded Nov 15 02:35where the row's word must be zh; the rebuilt title saw"Face-to-face · Alice · Oct 19 14:05"where面对面 · Alice · 10月19日 14:05is required.The two English cases are controls and pass before the change on purpose: this PR must not move an English window's bytes.
Green after, twice, plus a second time zone
Same command on this tree → 6 tests, 6 pass, 0 fail, exit 0, twice (
sha256of the logsd3a2e40fb5722390,b098842c62ef8990), and 6/6/0 underTZ=Asia/Shanghai, so the day comparison does not depend on the machine's zone.Generated side, on the new base
node core/scripts/build-client.mjsrewrote the bundle andnode scripts/ds-bot-patches.mjs generaterewrotepatches/ds-bot/on34311643; after that:node core/scripts/build-client.mjs --check→ exit 0, cleannode scripts/ds-bot-patches.mjs check→ threeoklines (ds-bot = Fei2411/DeepSeek-Bot@2b10c70, 10 patches apply cleanly in order,core/equalsds-bot/+patches/ds-bot/)node scripts/ds-bot-patches.mjs canonical→generateis a no-opRelative to the base the two patch files move
+3/−1each, which is the header renumbering #3097 caused above them ini18n.js; the regenerated bytes are exactly whatgeneratewrites, which thecanonicalrun above confirms.Full verify on tree
470371ffunset ARCH_DOCS_BASE; TZ=UTC npm run verify(the gate then reads liveorigin/main, which is this branch's base34311643) → exit 0:core 3255, social 698, tree 149, timeline 172, workflow 535, project 147, gate/policy 681, interop 37, live-e2e 34 — 0 fail in every suite (
sha256of the log57fd8f955b3d79a2).Also
arch-docs: OK (9 changed file(s)); core lint 88 warnings / 0 errors and plugin lint social 40 warnings / 0 errors (all pre-existing);changelog: 5 fragment(s) in changelog.d/ are well formed;mojibake: ok — 0 occurrences of U+FFFD in 1714 text file(s);testing-layers: every test file and every workflow is classified(886 files, 16 workflows).Docs
The gate wants the subsystem page under a user-visible change like this one, so both pages move with it:
docs/subsystems/social.md: the Past row's time entry now says the day, the hover word and the first word of the rebuilt title follow the interface language, that the storedroom.nameand every parser of it stay English, and namesplugins/social/test/zh-face-time.test.js.docs/subsystems/core-client.md: the i18n map row now lists the Past row's hover words Ended / Started next to the chip words social: the face-room status chip draws four of its five states in English in a zh UI #3090 already put there.node core/scripts/check-arch-docs.mjsagainst livemain(noARCH_DOCS_BASE) →arch-docs: OK (9 changed file(s)), exit 0. Run the same way in the single-commit shape CI sees (git log <base>..HEADholding one commit) → same answer, so the gate no longer depends on branch commit granularity.Files
9 files,
+219/−12:plugins/social/client.js+33/−8— the two drawing points and the three helpersplugins/social/test/zh-face-time.test.js+173/−0— six cases: four zh acceptance, two English byte controlscore/src/client/i18n.js+2/−0—Started: '开始'core/client.js+2/−0— generated bundlepatches/ds-bot/0001-core-fixes.patch+3/−1,patches/ds-bot/0008-client-bundle.patch+3/−1— regenerateddocs/subsystems/social.md+1/−1,docs/subsystems/core-client.md+1/−1— the two subsystem pageschangelog.d/3098-past-room-time-zh.fixed.md+1/−0Checkpoint
{ "pr": 3099, "claim": "Dev-1", "issue": 3098, "summary": "A Past face-to-face card drew its day, its hover prefix and the title rebuilt from the room's members in English inside a zh window. Both drawing points now follow the window's language: faceDay writes 10月19日, the hover prefix goes through the dictionary (Started added; Ended came with #3097), and the first word of the rebuilt title is tr('Face-to-face'). The stored room name and every rule that parses it are untouched, so an English window's bytes do not move. Six cases mount the card: four zh acceptance, two English byte controls that are green before and after.", "files": [ "plugins/social/client.js", "plugins/social/test/zh-face-time.test.js", "core/src/client/i18n.js", "core/client.js", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0008-client-bundle.patch", "docs/subsystems/social.md", "docs/subsystems/core-client.md", "changelog.d/3098-past-room-time-zh.fixed.md" ], "checks": { "ran": "TZ=UTC npm run verify; node --import ./test/resolve.mjs --test test/zh-face-time.test.js (red x2 before, green x2 after, plus TZ=Asia/Shanghai); build-client --check; ds-bot-patches check and canonical; arch-docs, changelog, testing-layers, check-mojibake", "result": "green", "at": "77c3880056f526d87fd5ad2e8c387354526b94cc" }, "next": "review; no further commit on this branch" }