Repository navigation
Read the room's auto-send switch and Past rooms in the window's language (#3114) - #3233
Conversation
|
Verdict: PASS at a9aa556 Ran at this tip: Tier: T2, recomputed here rather than read: The four things asked to be explained, judged one by one: a. Four totals pins, not three — OK. 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 ( c. The measured risk set — OK, matches. The brief expected d. Scope and shape, read from the diffs themselves:
Checks at this tip: 20 runs — Enqueueing at |
…: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.  **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"]`.  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.
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 nameAuto-send Chief's room messages), and the social sidebar's ended-room fold drewPast rooms. All three draws now go through the plugin'str(), with four zh keys added to the mainZHobject (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 thesocial/status/social/face-autoreads 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 tenplugins/social/test/*i18n.test.js→ 40 / 40 / 0;cd plugins/social && DSH_HARNESS=… npm test→ 752 / 752 / 0, 0 skipped;npm run verifyat 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 checkandcanonical→ 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.jsorcore/src/host/code. The localnpm run verifyneedsARCH_DOCS_BASEbecause this working copy has nooriginremote; the base is the main tarball commitc1cd0ce.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 isplugins/social/client.jsand the five social i18n tests at T2, the rest at T1. The brief expectedT2 / 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. Norisk: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" }