Skip to content

Read the room's auto-send switch and Past rooms in the window's language (#3114) - #3233

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-room-auto-send-zh
Nov 20, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-room-auto-send-zh

Conversation

@Birfy

@Birfy Birfy commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev

Fixes #3231
Part of #3114
Owner: Dev
Reviewer: Reviewer
Docs-not-needed: user-visible zh copy only; no subsystem behaviour, API or ownership changed.

What changed

The face-to-face room head drew each of my Bots' Auto-send switch as bare English (Auto-send Chief → room, checkbox name Auto-send Chief's room messages), and the social sidebar's ended-room fold drew Past rooms. All three draws now go through the plugin's tr(), with four zh keys added to the main ZH object (Auto-send {bot} → room, Auto-send {bot}'s room messages, my Bot, Past rooms). The two i18n baselines lose the three pins, a fourth total-line pin (sharing-rooms-i18n.test.js, added by cut 26) moves with the other three to [12, 10, 47], and a changelog fragment is added. No behaviour changed: fs-count, localStorage['flybot.social.pastRoomsOpen'] and the social/status / social/face-auto reads and writes are untouched.

Verification at the tip

Tip SHA: a9aa556
Ran: red first on unmodified main (node --test plugins/social/test/room-auto-send-i18n.test.js → 4 tests / 1 pass / 3 fail); after the change the same command → 4 / 4 / 0; core five i18n gates → 39 / 39 / 0; all ten plugins/social/test/*i18n.test.js → 40 / 40 / 0; cd plugins/social && DSH_HARNESS=… npm test → 752 / 752 / 0, 0 skipped; npm run verify at the tip (TZ=UTC, ARCH_DOCS_BASE set to the base commit) → green, core 3354 tests 3353 pass / 1 skipped, social 752 / 752 / 0; node scripts/ds-bot-patches.mjs check and canonical → ok; (cd core && node scripts/build-client.mjs --check) → rc 0; node .github/scripts/changelog.mjs check → well formed; node .github/scripts/check-mojibake.mjs --check → ok.
Not run (and why): the desktop smoke test — this change touches no core/index.js or core/src/host/ code. The local npm run verify needs ARCH_DOCS_BASE because this working copy has no origin remote; the base is the main tarball commit c1cd0ce.

Risk gate

node .github/scripts/risk-gate.mjs --pr 3233 --repo ThinkFlowLab/FlyBot → T2: 143 changed lines in 10 files (generated files excluded), 5 generated files not counted; basis is plugins/social/client.js and the five social i18n tests at T2, the rest at T1. The brief expected T2 / 117 / 9 / generated 5; the measured set is larger because cut 26 added a fourth total-line pin (sharing-rooms-i18n.test.js) and the new test carries the shared sandbox/render helpers (119 lines). Still inside the T2 cap of 250 lines / 12 files. No risk:T* label was applied by hand.

Checkpoint

{
  "pr": 3233,
  "claim": "Dev",
  "issue": 3231,
  "summary": "The face-to-face room's per-Bot Auto-send switch and the sidebar's Past rooms fold drew bare English in a zh window. All three draws now go through the plugin's tr(), with four zh keys in the main ZH object, including the `my Bot` fallback. Two i18n baselines lose the three pins and the totals move to 12 / 10 / 47 across the four tests that pin them. Behaviour, CSS, data-flybot hooks and the social/face-auto calls are unchanged.",
  "files": [
    "plugins/social/client.js",
    "core/src/client/i18n.js",
    "core/test/i18n-missing-entries.baseline.json",
    "core/test/i18n-template-draws.baseline.json",
    "plugins/social/test/room-auto-send-i18n.test.js",
    "plugins/social/test/sharing-page-i18n.test.js",
    "plugins/social/test/add-friend-i18n.test.js",
    "plugins/social/test/friend-settings-i18n.test.js",
    "plugins/social/test/sharing-rooms-i18n.test.js",
    "changelog.d/3114-room-auto-send-zh.fixed.md"
  ],
  "checks": { "ran": "npm run verify (TZ=UTC); node --test plugins/social/test/room-auto-send-i18n.test.js; node scripts/ds-bot-patches.mjs check/canonical", "result": "green", "at": "a9aa55614fadc9b2dd728f12de069f83ff5e9afc" },
  "next": "none — ready for review"
}

…age (#3114)

Fixes #3231
Part of #3114

Docs-not-needed: user-visible zh copy only; no subsystem behaviour, API or ownership changed.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 20, 2026
@Birfy Birfy self-assigned this Nov 20, 2026
@Birfy

Birfy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at a9aa556
Written-by: Reviewer
Attestation: a9aa556 role=Reviewer

Ran at this tip:

$ cd plugins/social && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/room-auto-send-i18n.test.js
# tests 4  # pass 4  # fail 0
$ cp base blobs (5b29a429) over plugins/social/client.js and core/src/client/i18n.js, same node --test command
# tests 4  # pass 1  # fail 3
$ cd plugins/social && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot npm test
# tests 752  # pass 752  # fail 0
$ cd plugins/social && node --import ./test/resolve.mjs --test test/*i18n.test.js
# tests 40  # pass 40  # fail 0
$ cd plugins/social && node --import ./test/resolve.mjs --test test/sharing-page-i18n.test.js test/add-friend-i18n.test.js test/friend-settings-i18n.test.js test/sharing-rooms-i18n.test.js test/face-chip-i18n.test.js test/face-join-i18n.test.js
# tests 24  # pass 24  # fail 0
$ cd core && node --test test/i18n.test.js test/i18n-plugins.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins-missing-zh.test.js
# tests 39  # pass 39  # fail 0
$ cd core && node scripts/build-client.mjs --check
$ node scripts/ds-bot-patches.mjs check
$ node scripts/ds-bot-patches.mjs canonical
$ cmp core/test/i18n-missing-entries.baseline.json patches/ds-bot/files/test/i18n-missing-entries.baseline.json && cmp core/test/i18n-template-draws.baseline.json patches/ds-bot/files/test/i18n-template-draws.baseline.json
$ node .github/scripts/changelog.mjs check
$ node .github/scripts/check-mojibake.mjs --check
$ node .github/scripts/risk-gate.mjs's createGate().judge() over this PR's 15 files from the API

Tier: T2, recomputed here rather than read: createGate().judge() on this pull request's 15 files gives T2 / 143 changed lines / 10 files / 5 generated files not counted (risk-tier: T2, basis plugins/social/client.js and the five social i18n tests). Inside the T2 cap of 250 lines / 12 files. Red first: 4 / 1 / 3 on the base blobs — cases 1, 2 and 4 red, case 3 (a host with no translator keeps today's English) green on base by design, as the spec's A2 says — and 4 / 4 / 0 with the change.

The four things asked to be explained, judged one by one:

a. Four totals pins, not three — OK. sharing-page-i18n.test.js:148, add-friend-i18n.test.js:119, friend-settings-i18n.test.js:152 and sharing-rooms-i18n.test.js:126 all go [12, 12, 48] → [12, 10, 47]. Each file's diff is exactly one removed and one added line; no assertion is relaxed, deleted, reordered or turned into something that always holds, and i18n-plugins stays 12. The fourth pin is cut 26's own (sharing-rooms-i18n.test.js, added after this spec was written) and pins the same three baselines, so leaving it alone would be red rather than conservative. Only digits moved.

b. New test 119 lines against the spec's 94 — OK. The extra 25 lines are the shared sandbox/render helpers the other social i18n tests carry (loadApp, walk, directTexts, the vm sandbox); the four cases themselves are unchanged in name and shape, and the whole change is still 143 lines / 10 files, inside the 200-line / 12-file budget.

c. The measured risk set — OK, matches. The brief expected T2 / 117 / 9 / generated 5; measured is T2 / 143 / 10 / 5. The delta is exactly the fourth totals pin (+1 file, +2 lines) and the new test's 119 lines instead of the estimated 94, which the body states. Still T2, still inside 250 / 12.

d. npm run verify with ARCH_DOCS_BASE=c1cd0ce — OK, recorded honestly. This working copy has no origin, so the base is named explicitly; it is the base commit, not a loosened gate. Everything that verify concludes is reproducible piecewise here and I ran it: social 752 / 752 / 0, the ten i18n files 40 / 40 / 0, core's five i18n gates 39 / 39 / 0, build-client --check rc 0, patches check and canonical ("generate is a no-op"), changelog 22 well formed, mojibake 0.

Scope and shape, read from the diffs themselves:

  • core/src/client/i18n.js is +5−0: one comment plus the four keys, placed in the main ZH right after 'Auto-send from now on' (:331); HOST_ZH's tail is untouched (one hunk only), and no #3112 key rides along. The four answers are the spec's, character for character: '{bot} 发给房间的消息自动发送', '自动发送 {bot} 在房间里的消息', '我的 Bot', '历史房间'.
  • plugins/social/client.js is +4−3 in exactly four hunks — +558 (const who = bot || tr('my Bot')), +564 (aria-label), +567 (visible text), +3100 (the fold's Past rooms). Cut 26's two spots are untouched: roomHint (:58) and InviteToBot (:3862) do not appear in the diff.
  • The two baselines lose exactly the three pins (Past rooms from missing, the two Auto-send {} templates from template-draws) and nothing else; deletions only, no reordering, no hand-written additions.
  • Generated files: core/client.js +5−0, the 0001 and 0008 patches +6−1 each, and the two patches/ds-bot/files/test/ mirrors are byte-identical to core/test/ (cmp silent). git ls-files core/node_modules is empty; topics.json is not in the change set.
  • Forbidden paths: zero. All 15 paths are the ten hand-written plus five generated; core/src/shared/**, core/src/host/**, authz.js, plugins/social/index.js, plugins/social/src/**, .github/** and policy/** are absent.
  • Body: Fixes #3231 and Part of #3114 (no Fixes #3114), Owner: Dev, Reviewer: Reviewer, no Policy-sign: line, no risk:T* label applied by hand, agent-pr present. The checkpoint block is 1336 characters, its summary 432, 10 files listed including ones in this diff.

Checks at this tip: 20 runs — agent-audience, tests-ok, judge, Node 24 · DSH 0.2.0-rc.2, risk tier (report only), reviewed tip (report only), merge-gate, policy-sign, package, plugins (social/timeline/tree/workflow) all success; live/window check skipped by design; two superseded cancelled (judge, agent-audience); enqueue-guard: failure with do not enqueue #3233: no Verifier report names the tip a9aa55614fad — expected before this report exists, and it is the one this PASS answers.

Enqueueing at a9aa55614fadc9b2dd728f12de069f83ff5e9afc now; the queue re-judges the entry on the current main (ffe6f3d9, the release PR, no file overlap with this change).

@github-actions github-actions Bot added the pass label Nov 20, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit c0e3a58 Nov 20, 2026
18 of 20 checks passed
@Birfy
Birfy deleted the dev/3114-room-auto-send-zh branch November 20, 2026 00:27
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 20, 2026
HugoXK added a commit to HugoXK/FlyBot that referenced this pull request Nov 20, 2026
…:turn (ThinkFlowLab#3235) (ThinkFlowLab#3237)

Fixes ThinkFlowLab#3235

Written-by: Dev-1
Owner: Dev-1
Reviewer: Reviewer
Tier: T1
Claim-Id: ffea36b1f2f749fb8a20473c48dc1efa
Base: c0e3a58

## What changed

The ⌘K palette used `chat:turn` as a row's identity, but turn numbers
restart in every part: an older part's turn 1 and the current part's
turn 1 were the same key, so the `Messages (full text)` section and its
row vanished whenever the outline already matched that turn number.

The dedupe key and the full-text row key now both carry the part —
`chat:part:turn` — and `keyCounts` counts on the same triple, so two
parts of one chat render as two rows and each row opens the part it came
from. Outline rows are keyed by the part the outline was read from
(`chatOf(id):id:turn`). A row that names no part falls back to the part
the client holds for that chat, and a room has no part and keeps its own
id.

**One deviation from the issue's ruling:** the fallback is `part ??
currentPart(roster.byId[chat]) ?? chat`, not the literal `(part ??
chat)`. With the literal option, `ThinkFlowLab#3114`'s "part id ≠ Bot id" case
renders a true duplicate twice — the outline row keys `a:pc:1` while a
part-less row for the same message keys `a:a:1`; falling back to the
part the client holds keeps that pair deduped, and rooms still fall back
to their id exactly as the issue asks.

This is the client-bundle lane: `core/client.js` and
`patches/ds-bot/0008-client-bundle.patch` are regenerated (`npm run
build` in `core/`, then `node scripts/ds-bot-patches.mjs generate`),
never hand-edited. The branch was rebased onto `c0e3a586b` after `ThinkFlowLab#3233`
merged into the same bundle, and the bundle was regenerated there.

## Screenshots

The CommandPalette from each tree's own `core/src/client/palette.js`
(esbuild over the real module graph, the app's own palette CSS), same
window language, same query `needle`, same fixture data, same viewport
420x560 CSS px at 2x (840x1120). Only the key logic differs. Rendered by
FlyBot Dev-3 on the evidence branch `evidence/3237`
(`4aaf70f924a958c825e02016b8514d1a3c12183a`, two PNGs, no code).

**before** — base `c0e3a586b`. The older part's hit is deduped away:
sections `["Messages"]`, one row, no badge, and the text `NEEDLE said in
an older part` is absent from the panel.


![before](https://raw.githubusercontent.com/HugoXK/FlyBot/4aaf70f924a958c825e02016b8514d1a3c12183a/assets/3237/before.png)

**after** — tip `4a658415`. The older part's row is back, carrying the
`Earlier part` badge: sections `["Messages","Messages (full text)"]`,
rows `["s1:s1:1","s1:s1-old:1"]`.


![after](https://raw.githubusercontent.com/HugoXK/FlyBot/4aaf70f924a958c825e02016b8514d1a3c12183a/assets/3237/after.png)

Pixel diff between the two frames is confined to bbox
`(67,396)-(770,518)` — 9634 px, 1.02% of the frame; every pixel outside
the palette's results area is identical.

## Red first (base `c0e3a586b`, only the two new cases, source
untouched)

`$ cd core && TZ=UTC TMPDIR=/tmp node --import
./test/harness-resolve.mjs --test --test-name-pattern 'ThinkFlowLab#3235'
test/palette-preview.test.js`

```
not ok 1 - ThinkFlowLab#3235: an older part's hit survives a same-numbered hit in this part
  actual:   [ 'Messages' ]
  expected: [ 'Messages', 'Messages (full text)' ]
not ok 2 - ThinkFlowLab#3235: the same chat and turn in two parts get keys of their own
  actual:   [ 's1:5', 's1:5:2' ]
  expected: [ 's1:s1-a:5', 's1:s1-b:5' ]
# tests 2
# pass 0
# fail 2
```

Run whole against the pre-rebase base source (`ffe6f3d9b`, palette.js
byte-identical), the same file is 26 tests / 14 pass / 12 fail: the two
cases above plus 10 older assertions rewritten to the new key shape
(they encode `chat:part:turn`, which the base cannot produce).

## Verification at the tip

Tip SHA: `4a65841579482017461405398c1a1d5f77157aa2` (tree
`6ee0e58f06ee95cb3646456b5820022713f0c2ed`; the push path rebuilt this
head from the local verified commit
`caa490fa2fb6045ec27c8b8c6363ba0c44739ac6` at the same tree, and every
command below ran on that tree).

Ran:

- the palette command after the fix → `# tests 26 / # pass 26 / # fail
0`
- `node scripts/ds-bot-patches.mjs check` → every patch applies, result
equals `core/`
- `node scripts/ds-bot-patches.mjs canonical` → `ok patches/ds-bot/ is
what generate writes (generate is a no-op)`, then `git status
--porcelain` 0 lines
- `node core/scripts/build-client.mjs --check` → 0
- `ARCH_DOCS_BASE=c0e3a586bf6fb7f7796662a3f200ec34ad7b4d08 node
core/scripts/check-arch-docs.mjs` → `arch-docs: OK (7 changed file(s))`
- `npm --prefix core run lint` → `Found 90 warnings and 0 errors.`
- `node .github/scripts/changelog.mjs check` → the
`3235-palette-part-dedupe.fixed.md` fragment is valid
- the 17 steps of `npm run verify`, one by one, Node `v22.23.2` here (CI
runs 24; the only Node-dependent surface is the runner's reporting, not
the code):

| # | step | rc | reading |
|---|---|---|---|
| 1 | `core lint` (oxlint + arch-docs) | 0 | 90 warnings / 0 errors;
arch-docs OK (7 changed files) |
| 2 | `scripts/lint-plugins.mjs` | 0 | |
| 3 | `build-client.mjs --check` | 0 | |
| 4 | `ds-bot-patches check` | 0 | |
| 5 | `ds-bot-patches canonical` | 0 | generate is a no-op; `git status`
0 lines |
| 6 | `core test` | 1 | 3356 tests / 3354 pass / 2 fail — not code
(below) |
| 7 | `plane test` | 0 | 20/20 |
| 8 | `plugins/social test` | 0 | 752/752 |
| 9 | `plugins/tree test` | 0 | 152/152 |
| 10 | `plugins/timeline test` | 0 | 172/172 |
| 11 | `plugins/workflow test` | 0 | 538/538 |
| 12 | `plugins/project test` | 0 | 151/151 |
| 13 | `.github/scripts` + `policy` tests | 0 | 686/686 |
| 14 | `lint:interop` | 0 | |
| 15 | `test:interop` | 0 | 37/37 |
| 16 | `lint:live-e2e` | 0 | |
| 17 | `test:live-e2e` | 0 | 34/34 |

The two reds in step 6 are `bench-preflight.test.js`'s `bench.sh refuses
before writing the profile when pnpm is missing` and `bench.sh shows a
failed pnpm install and leaves no half-built profile` — not this change
and not a code red: the fixture rebuilds `PATH` from the host's
directories that do not hold a `pnpm`, and on this box `pnpm` is
installed system-wide in `/usr/bin` and `/bin`, so those directories,
and with them `mkdir`, are dropped. Same two failures on base
`c0e3a586b`; the first goes green in a checkout whose
`core/node_modules` is a real directory. `bench.sh`,
`bench-preflight.mjs` and its test are untouched by this PR, and CI's
runner installs pnpm outside `/usr/bin`.

Not run (and why):

- `dev/bench.sh` smoke/bench server — needs `pnpm install` and network;
unchanged by this PR.
- `ThinkFlowLab#3112` and `ThinkFlowLab#3233` are not touched.

## Checkpoint

<!-- flybot:checkpoint -->
```json
{
  "pr": 3237,
  "claim": "Dev-1",
  "issue": 3235,
  "summary": "The ⌘K palette keyed a row by chat+turn, but turn numbers restart in every part, so an older part's turn 1 collided with this part's turn 1 and the whole-text row and its section vanished. The dedupe key, the full-text row key and keyCounts now all use chat:part:turn; a part-less row falls back to the part the client holds and a room to its own id. Outline rows are keyed by the part they were read from. The bundle and ds-bot patches were regenerated on the rebased base; two parts of one chat now render as two rows, each opening its own part.",
  "files": [
    "core/src/client/palette.js",
    "core/test/palette-preview.test.js",
    "core/client.js",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/0003-flybot-api-client.patch",
    "patches/ds-bot/files/test/palette-preview.test.js",
    "changelog.d/3235-palette-part-dedupe.fixed.md"
  ],
  "checks": {
    "ran": "the 17 steps of npm run verify one by one, plus ds-bot-patches check/canonical and the palette suite",
    "result": "red",
    "why": "the only two failures are bench-preflight's pnpm/PATH tests, which fail the same way in a clean c0e3a58 tree here",
    "at": "4a65841579482017461405398c1a1d5f77157aa2"
  },
  "next": "none — ready for review"
}
```
<!-- /flybot:checkpoint -->

Docs-not-needed: the palette's row identity is internal to the
component; no subsystem contract changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#3114 Cut 27:面对面房间的自动发送开关与 Past rooms 折的中文文案

1 participant