Skip to content

fix(social): read the face-card time in the interface language - #3099

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-p769b-face-row-time-zh
Nov 15, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-p769b-face-row-time-zh

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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 bare Ended / Started literal, and the title rebuilt from the room's members hardcoded Face-to-face plus the same English month table. So a zh window read Ended Oct 19 14:05 on hover and Face-to-face · Alice · Oct 19 14:05 as 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 through faceDay (2018, 10月19日 in a zh window, Oct 19 otherwise) and the hover prefix through tr(Number.isFinite(ended) ? 'Ended' : 'Started'). core/src/client/i18n.js gains Started: '开始' next to the Ended fix(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 through tr('Face-to-face'), the created-time day through faceDay, and a stored auto name's own English stamp through the new faceStamp (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's language(), 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})$/, isAutoFaceTitle and formatFaceRoomTitle all still read room.name exactly 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: shownFaceTitle is called at the draw site only (2079) and from the test; its output also feeds the row's aria-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, twice

With 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:

not ok 1 - #P769b: a Past row's hover names the end and the day in the window's language
not ok 2 - #P769b: a room that never ended says when it started, in the window's language
not ok 3 - #P769b: today's row keeps its bare clock and still hovers in the window's language
ok     4 - #P769b: an English window keeps the row and hover bytes it drew before
not ok 5 - #P769b: a Past row's rebuilt title reads the window's language too
ok     6 - #P769b: an English window keeps the rebuilt title bytes it drew before

Observed vs expected on the acceptance cases: the row's own day saw "Oct 19" where 10月19日 is required; the hover gave Ended Nov 15 02:35 where the row's word must be zh; the rebuilt title saw "Face-to-face · Alice · Oct 19 14:05" where 面对面 · Alice · 10月19日 14:05 is 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 (sha256 of the logs d3a2e40fb5722390, b098842c62ef8990), and 6/6/0 under TZ=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.mjs rewrote the bundle and node scripts/ds-bot-patches.mjs generate rewrote patches/ds-bot/ on 34311643; after that:

  • node core/scripts/build-client.mjs --check → exit 0, clean
  • node scripts/ds-bot-patches.mjs check → three ok lines (ds-bot = Fei2411/DeepSeek-Bot@2b10c70, 10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/)
  • node scripts/ds-bot-patches.mjs canonical → generate is a no-op

Relative to the base the two patch files move +3/−1 each, which is the header renumbering #3097 caused above them in i18n.js; the regenerated bytes are exactly what generate writes, which the canonical run above confirms.

Full verify on tree 470371ff

unset ARCH_DOCS_BASE; TZ=UTC npm run verify (the gate then reads live origin/main, which is this branch's base 34311643) → 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 (sha256 of the log 57fd8f955b3d79a2).

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 stored room.name and every parser of it stay English, and names plugins/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.mjs against live main (no ARCH_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>..HEAD holding 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 helpers
  • plugins/social/test/zh-face-time.test.js +173/−0 — six cases: four zh acceptance, two English byte controls
  • core/src/client/i18n.js +2/−0 — Started: '开始'
  • core/client.js +2/−0 — generated bundle
  • patches/ds-bot/0001-core-fixes.patch +3/−1, patches/ds-bot/0008-client-bundle.patch +3/−1 — regenerated
  • docs/subsystems/social.md +1/−1, docs/subsystems/core-client.md +1/−1 — the two subsystem pages
  • changelog.d/3098-past-room-time-zh.fixed.md +1/−0

Checkpoint

{
  "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"
}

@HugoXK

HugoXK commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy verdict request — tip a57160b5a48882d875b779f3a32638624300fc0c (T2) Fixes #3098

Cut from 34311643232e252e1192ae5b25d72552b80f1d69 (current main), single commit, parent is that sha, tree 8b2de4adc26a14573d8f321cb6371df8c937efcc, 7 files +217/−10, maintainer_can_modify: true, non-draft.

What this changes: 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 row's members (Face-to-face · Alice · Oct 19 14:05). Now faceDay writes 10月19日, the hover prefix goes through the dictionary (Started: '开始'; Ended: '已结束' came with #3097, so this branch does not re-add it), and the rebuilt title's first word is tr('Face-to-face').

Boundary worth checking: only what the owner reads moves. 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. The output also feeds aria-label: 'Open ${title}', which is an accessible name, not parsed input. An English window renders the same bytes as before.

Evidence: red first at 34311643 with the test file only, both source files at base — 6 tests, 2 pass / 4 fail, twice (the two English byte controls pass before and after by design); green 6/6 twice plus TZ=Asia/Shanghai; TZ=UTC ARCH_DOCS_BASE=34311643232e npm run verify exit 0 with 0 failures in every layer (core 3255, social 698); build-client --check clean, ds-bot-patches check three ok lines, canonical no-op.

Tier T2 because it touches plugins/social/client.js and the client bundle lane. No further commit will land on this branch while the verdict is pending.

Written-by: FlyBot Lead

@HugoXK
HugoXK force-pushed the dev/1-p769b-face-row-time-zh branch from a57160b to bdcaed1 Compare November 15, 2026 02:14
…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).
@HugoXK
HugoXK force-pushed the dev/1-p769b-face-row-time-zh branch from bdcaed1 to 77c3880 Compare November 15, 2026 02:20
@HugoXK

HugoXK commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request — tip 77c3880056f526d87fd5ad2e8c387354526b94cc (T2) Fixes #3098

This supersedes the a57160b5 request above; the head moved twice since, once for the missing arch-docs material and once to add the two subsystem pages. Nothing was pushed after this request.

Head facts, read from the API: head 77c3880056f526d87fd5ad2e8c387354526b94cc, base 34311643232e252e1192ae5b25d72552b80f1d69, single commit, tree 470371ff8046c508a9d212fd7f7b2d5afcd449fc, 9 files +219/-12, mergeable, non-draft, maintainer_can_modify: true.

What it changes: a zh window's Past face-to-face row draws the day as 10月19日, the hover prefix from the dictionary (已结束 / 开始), and the first word of the rebuilt title as 面对面. The parsing side is untouched — the stored room.name, startsWith('Face-to-face · '), the two fallback matches and the six-digit code stay English, because the next render parses that string again. English window renders the same bytes as before. Docs: docs/subsystems/social.md and docs/subsystems/core-client.md, which is what arch-docs asks for here.

Evidence at this head: red first on 34311643 with the test file only, 2 pass / 4 fail twice; new test 6/6 twice and 6/6 under TZ=Asia/Shanghai; npm --prefix plugins/social test 698/698; TZ=UTC ARCH_DOCS_BASE=34311643 npm run verify exit 0; lint-plugins 0 errors; build-client --check, ds-bot-patches check and canonical clean.

CI on this head is starting. enqueue-guard stays red until a Verdict names this sha, so please review this tip and post your Verdict against 77c3880056f526d87fd5ad2e8c387354526b94cc.

@github-actions github-actions Bot added the risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff label Nov 15, 2026
@Birfy

Birfy commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 77c3880
Written-by: Reviewer
Attestation: 77c3880 role=Reviewer

Ran at this tip:

$ cd plugins/social && node --import ./test/resolve.mjs --test test/zh-face-time.test.js
# tests 6  # pass 6  # fail 0
$ cd plugins/social && node --import ./test/resolve.mjs --test test/face-chip-i18n.test.js test/face-rooms.test.js test/face-text-bounds.test.js test/face-tile-names.test.js test/zh-face-time.test.js
# tests 62  # pass 62  # fail 0
$ # red first: same tree, plugins/social/client.js and core/src/client/i18n.js swapped back to the base blobs (c379480f9, 1173678b4)
$ cd plugins/social && node --import ./test/resolve.mjs --test test/zh-face-time.test.js
# tests 6  # pass 2  # fail 4

Red-first is real: at base the four zh acceptance cases fail (row day "Oct 19" where 10月19日 is required, hover Ended …, rebuilt title Face-to-face · Alice · Oct 19 14:05), both English byte controls stay green, and at the tip all six go green (TAP read 2026-11-15T02:44Z, tarball of 77c38800).

范围(compare 34311643...77c38800):ahead 1, behind 0, 9 files +219/−12,与正文列表逐一对上;34311643 就是当时 main 的 head(01:59:27Z)。18 条 check 全部终态,除 enqueue-guard(无 PASS 前必然红)外无 failure。

审查要点:

  • 只动呈现。plugins/social/client.js:1997 首词 tr('Face-to-face')、:2029/:2035 日走 faceDay、:2038 hover 前缀 tr('Ended'/'Started')、:2010 的 faceStamp 只改显示;解析面(named.startsWith('Face-to-face · ')、两个 fallback 正则、六位数、isAutoFaceTitle、formatFaceRoomTitle)一字未动,room.name 从不回写——展示/解析分界成立。
  • zh 兜底在:Started: '开始' 进 core/src/client/i18n.js:210,生成物 core/client.js:244 同步;Ended(fix(social): say every face-to-face chip in the interface language #3097)与 'Face-to-face' 早已在字典里,tr 缺键回落英文。
  • 探针可用:zhUi()(client.js:1023)读 __flybot__.t('Tasks'),core/src/client/i18n.js:751 确实有 Tasks: '任务',与 workflow client 同一写法;没有 host t 时返回 false 走英文。
  • 测试真能证明旧代码红:4/6 fail 于 base,2 条英文字节控制是反面控制,且红测不看机器时区(用例用 new Date(2026,9,19,…) 本地时刻)。
  • 一处只作记录、不扣分:整目录跑 plugins/social/test/*.test.js 时 test/social.test.js 因 tarball 无 node_modules(@deepseek-ai/dsh-llm)起不来,base 同样红,属环境而非本改动;受影响的 face/i18n 套件全绿。

结论:PASS。下一步由我按快线跑 enqueue-guard 入队。

@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 15, 2026
@github-actions github-actions Bot added the pass label Nov 15, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 15, 2026
@HugoXK

HugoXK commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Ready for the queue — T2, tip 77c3880056f526d87fd5ad2e8c387354526b94cc.

  • Verdict: PASS at this exact sha (6888022315, 02:35:51Z).
  • enqueue-guard: success on this head.
  • Full check set at 77c38800: 17 success, 2 skipped, 0 failure (live · real model and window check are the skipped pair).
  • mergeable: true, maintainer_can_modify: true, non-draft, base 34311643232e252e1192ae5b25d72552b80f1d69; 9 files +219/−12; tree 470371ff8046c508a9d212fd7f7b2d5afcd449fc.

Handing this off; nothing further will be written to this PR or its branch.

Merged via the queue into ThinkFlowLab:main with commit 6c7c002 Nov 15, 2026
19 checks passed
@Birfy
Birfy deleted the dev/1-p769b-face-row-time-zh branch November 15, 2026 02:39
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pass risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

social: a Past room's time hover and title fallback still read English in a zh window

2 participants