Repository navigation
Draw the Approve all label and tooltip in the window's language - #3152
Conversation
core/scripts/build-client.mjs rebuilt core/client.js from core/src/client/** and plugins/social/client.js; scripts/ds-bot-patches.mjs generate rewrote 0008-client-bundle.patch (the bundle), 0001-core-fixes.patch (the i18n dictionary) and the two files/test copies. Generated artifacts, not hand edits: check reports 10 patches apply cleanly in order and core/ equals ds-bot/ + patches/ds-bot/; canonical reports generate is a no-op; build-client --check is clean. Docs-not-needed: generated build output and mirrors of the two source edits above; they carry no statement of their own that docs could describe.
|
Verdict: PASS at 2db8b07 Reviewed this tip against Scope. Only the approve-all row moves: The baseline loses exactly these three pins, nothing else. Red first, measured here. With the three draws put back to the English/mixed shape on this tip (only The zh half of the same case asserts Ran at this tip (tarball of
Not run at this tip (and why): Rest of the tip's state. No One note for the record: |
…owLab#3160) Fixes ThinkFlowLab#3158 Owner: Dev-5 Written-by: Dev-5 Bot: Dev-5 Tier: T2 Claim-Id: 9fad639e87e34c68b78553d928fb013e Branch: dev/5-social-failed-join Base: ed935b3 ## What changed `ThinkFlowLab#3142` made the approve-all failure line readable but left it unbounded: every failing card's reason went into one `role='alert'` row joined with ` · `, with no cap on rows and no cap on length, and `errorText` returned an unknown host sentence whole. On the unmodified base one Approve all click on five failing cards paints the whole string. - `plugins/social/client.js`: the dock's line now shows at most **3** rows and then `{count} more not shown` — an existing dictionary source string (`core/src/client/i18n.js:246`, zh 「还有 {count} 条未显示」), so the plugin source stays English and `i18n.js` is untouched. `APPROVE_ALL_FAILED_ROWS = 3` is a named constant beside `approveAll`. - `errorText`'s fallback and the dock's `notSent` share `ERROR_TEXT_MAX = 200` + `clipped()`, which cuts by **code point** and marks the cut with `…`; this replaces `notSent`'s naked `.slice(0, 200)`, which cut on UTF-16 units and could split a surrogate pair (`ThinkFlowLab#2438`). - `ThinkFlowLab#3152`'s readability work stays: `:2551` `trIn`, `:2802`/`:2805` label and tooltip still `trIn` (re-checked by grep at this tip). - `docs/subsystems/social.md`: one sentence on the bound, in the dock-memory paragraph (`owned_paths`). - `changelog.d/3158.fixed.md`: the user-visible entry. No new sentence is added to the plugin, and no individual card's own error line changes. ## Red first — on the true base `ed935b304f71f1da386a73c31bb1f0e070573691` Re-run on the live base after `ThinkFlowLab#3154` landed (not carried over from the `b36504fa` reading); only the new tests added on top of the unmodified base, **twice, same readings**. `node --test plugins/social/test/approve-all-failure.test.js` — `# tests 8 / # pass 5 / # fail 3`, all three red are the new cases: - `not ok 6 - a batch that fails many people caps the rows and counts the rest` — actual `"Eve: reason-l1 · Bob: reason-l2 · Ada: reason-l3 · Cy: reason-l4 · Dee: reason-l5"` (no row cap, no tail count) - `not ok 7 - the count of the rows the line leaves out follows the window language` — same string, no dictionary sentence - `not ok 8 - a reason longer than a paragraph is cut inside the line` — `the cut is marked, saw "🚀🚀🚀"` `node --import ./test/resolve.mjs --test --test-name-pattern=P-812 test/social.test.js` — `# tests 1 / # pass 0 / # fail 1`, `the reason is cut, saw 800 characters` (`plugin.errorText(new Error('🚀'.repeat(400)))` returns all 800 units). ## Green at this tip - `node --test plugins/social/test/approve-all-failure.test.js` — `# tests 8 / # pass 8 / # fail 0` - `plugins/social/test/social.test.js --test-name-pattern=P-812` — `# tests 1 / # pass 1 / # fail 0` - whole social suite — 715 pass / 0 fail - `TZ=UTC npm run verify` — exit 0 Ran: `npm run verify`, `node --test plugins/social/test/approve-all-failure.test.js`, `node .github/scripts/changelog.mjs check`. Not run: the smoke test (no `index.js` / `src/host/` change), `dev/bench.sh`. ## UI surface — before / after Yes, the rendered `role='alert'` row changes: at most 3 rows plus the tail count, and long reasons are cut with `…`. Same approval dock, same view after the click, real dock markup and the plugin's real CSS, 420×560 CSS px at `--force-device-scale-factor=2` → 840×1120 PNG each. Before — eight failing cards, six rows, 114 px:  After — at most three rows plus 「还有 5 条未显示」, 59 px:  ## Checkpoint <!-- flybot:checkpoint --> ```json { "pr": 3160, "claim": "Dev-5", "issue": 3158, "summary": "The approve-all failure line is bounded: the dock's alert names at most three people and then counts the rest in the window's words, and a host reason passed through whole is cut at 200 code points with a marked ellipsis. The cut helper is shared with the dock's notSent, replacing a naked UTF-16 slice. Tests pin the row cap, the dictionary tail sentence and the code-point cut, and the subsystem page and changelog carry the user-visible change.", "files": ["plugins/social/client.js", "plugins/social/test/approve-all-failure.test.js", "plugins/social/test/social.test.js", "docs/subsystems/social.md", "changelog.d/3158.fixed.md"], "checks": { "ran": "TZ=UTC npm run verify", "result": "green", "at": "2d90d4d243c4ba0f4ef8f869aeb470b715e23a15" }, "next": "waiting for the T2 PASS at this tip; the Lead turns it ready" } ``` <!-- /flybot:checkpoint -->
Fixes #3061
Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
Bot: FlyBot Dev-1
Claim-Id: 722e5fd82d8242c4b1d8ddc927a4d25d
Tier: T2
Base: 68b5991 (verified live main)
Verified commit: 1ce6d37455930f972c096f8b543f7acfa88872ee (local, tree bf84b2e0c31f5b5e609aba26bbf531857b443431)
Total: 11 files, +107/−27
What changed
The approval dock's Approve all button drew its label from a template literal (
Approve all (3)) and its tooltip from a mixed one (3 条 · to Eve, Bob), so no window read them right: a Chinese window showed English on the button, an English window showed 条 in the tooltip. The two strings now read the window's dictionary like every other line in the dock:Approve all (3)全部批准(3)3 holds · to Eve, Bob共 3 条 · 发给 Eve, Bob1 hold · to Eve共 1 条 · 发给 Eve2 holds共 2 条The source strings are English keys (
Approve all ({n}),{n} holds · to {to},1 hold · to {to},{n} holds,1 hold); the Chinese text lives only incore/src/client/i18n.js. The dock asks the translator the host passes down and falls back to the module translator every other line of the dock already uses, so a window without that prop keeps the English source instead of losing the count.Files:
plugins/social/client.js(+12/−4),core/src/client/i18n.js(+7),plugins/social/test/social.test.js(+47/−4: one new case, the four pinned titles re-read),core/test/i18n-template-draws.baseline.json(−3 pins),core/test/i18n-template-draws.test.js(the two-hole member case now pins a synthetic source), plus the changelog fragment and the generated bundle/mirrors below.Red first — measured on the clean base, twice
68b5991770with only the new test kept, run twice:Full plugin suite before the fix: 710/711, the one red being the new case (
dev1-build/p3061-red.log). After the fix the same case is 1/1 twice, and the suite is 711/711.Green — measured on the verified tree
plugins/social: 711/711.TZ=UTC npm run verify: 0not ok— core 3288/3288 (the client-bundle check included), plane 20, social 711, tree 149, timeline 172, workflow 538, project 147,.github/scripts+policy686, interop 37, live-e2e 34; core lint 0 errors,lint-plugins,build-client --check,ds-bot-patches check,canonical, interop and live-e2e lint all pass.pnpmin/usr/bin, which thebench-preflightfixture strips from its PATH together withmkdir; with a coreutils-only PATH shim (workspace dir of symlinks to/usr/bin/*minuspnpm) the whole run is green, without it that one case is the only red.ARCH_DOCS_BASE=68b5991770ed node core/scripts/check-arch-docs.mjs→arch-docs: OK (11 changed file(s))(on the committed tree, both commits carrying theirDocs-not-needed:trailer).node .github/scripts/changelog.mjs check→ fragments well formed.--template-draws40 (was 43, the three approve-all pins left),--missingand--checkunchanged.Generated vs hand-written (11 files)
core/client.js(core/scripts/build-client.mjs, the bundle ofcore/src/client/**+plugins/social/client.js);patches/ds-bot/0008-client-bundle.patch(the bundle mirror),patches/ds-bot/0001-core-fixes.patch(the dictionary mirror),patches/ds-bot/files/test/i18n-template-draws.{test.js,baseline.json}(the ds-bot copies). All written bynode scripts/ds-bot-patches.mjs generate.plugins/social/client.js,core/src/client/i18n.js,plugins/social/test/social.test.js,core/test/i18n-template-draws.test.js,core/test/i18n-template-draws.baseline.json,changelog.d/3061-approve-all-english.fixed.md.Mirrors and gates
node scripts/ds-bot-patches.mjs check→10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/.node scripts/ds-bot-patches.mjs canonical→patches/ds-bot/ is what generate writes (generate is a no-op).node core/scripts/build-client.mjs --check→ clean.Not run
core/dev/bench.sh smoke— no host runtime orindex.jschange; this PR is client copy plus its dictionary entries.Docs-not-needed: the change moves two dock strings onto the dictionary the rest of the dock already uses;
docs/subsystems/social.mddescribes what Approve all does and the count it shows, which is unchanged, and no new setting, endpoint or behaviour appears.Checkpoint
{
"pr": 3152,
"claim": "Dev-1",
"issue": 3061,
"summary": "The approval dock's Approve all button drew
Approve all (3)in every window and its tooltip mixed the other way (3 条 · to Eve, Bobin an English window). Both now read the window's dictionary, so a Chinese window draws 全部批准(3) and 共 3 条 · 发给 Eve, Bob, and an English window no longer reads 条. The English source strings are the keys and the Chinese text lives only in core/src/client/i18n.js; the dock uses the translator the host passes down and falls back to its module translator. The bundle, the two ds-bot mirrors and the template-draw baseline were regenerated.","files": [
"plugins/social/client.js",
"core/src/client/i18n.js",
"plugins/social/test/social.test.js",
"core/test/i18n-template-draws.baseline.json"
],
"checks": {
"ran": "TZ=UTC npm run verify; ARCH_DOCS_BASE=68b5991770ed node core/scripts/check-arch-docs.mjs; node scripts/ds-bot-patches.mjs check+canonical; node core/scripts/build-client.mjs --check; node .github/scripts/changelog.mjs check",
"result": "green",
"at": "2db8b0756eb25e969fae11b8a9a7f516815ad66a"
},
"next": "none — ready for review"
}