Repository navigation
fix(website): join channel mentions and preset roles by locale - #31887
Conversation
406c086 to
7bc37ac
Compare
The Channels page joined two natural-language lists with a hard-coded ", ": the @mentions a message was addressed to and the roles a New Channel preset brings. A CJK reader saw an English comma-space instead of the list separator their language uses (zh-CN reads A、B和C). Both lists now go through fmtList, which the page already uses for the clear-context roster, so they follow the active locale. Fixes #31877
7bc37ac to
c4d1672
Compare
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Only the list separators change: two inline lists now go through the Notes
[DESIGN-REVIEWED] c4d1672 Description read[DESCRIPTION-READ] b064e906c48e84d285b9de2485ca6cb8e31ad33065847fe305652fe1d2d2ab11 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Both lists now use the page's existing What this change shipsInventory (3 items) — 3 justifiedIntent: readers of the Channels page in a language other than English see the mention list and preset role list joined the way their language joins items. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] c4d1672 Description read[DESCRIPTION-READ] 1b2242fc971093ef63b1143d87a9bce3fe2be9d459991703558e0f2dfe11be91 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing screenshots of the changed mention header and preset-role text. The blind read was not performed because the PR supplies no image this review can accept. Evidence gaps
[UX-REVIEWED] c4d1672 Description read[DESCRIPTION-READ] b402c639de9117509b1fa9ec3f4b10fc2d03c9c5e3a3255d4eee6cde095a6df2 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
bolichen97
left a comment
There was a problem hiding this comment.
Approving at c4d1672. The Channels page now joins a message's @mentions and a preset's agent roles with the existing locale-aware fmtList instead of a hard-coded .join(', '), so each language gets its own list punctuation and conjunction. Only those two display strings change, and the new tests cover both lists. No regex is added. CI is green apart from Publish readiness signal.
The Channels page joined two natural-language lists with a hard-coded ", ": the @mentions a message was addressed to and the roles a New Channel preset brings. A CJK reader saw an English comma-space instead of the list separator their language uses (zh-CN reads A、B和C). Both lists now go through fmtList, which the page already uses for the clear-context roster, so they follow the active locale. Fixes #31877 (cherry picked from commit ecb3d62) Original author: Rohan Khanderia (#31887).
The Channels page joined two natural-language lists with a hard-coded ", ": the @mentions a message was addressed to and the roles a New Channel preset brings. A CJK reader saw an English comma-space instead of the list separator their language uses (zh-CN reads A、B和C). Both lists now go through fmtList, which the page already uses for the clear-context roster, so they follow the active locale. Fixes #31877 (cherry picked from commit ecb3d62) Original author: Rohan Khanderia (#31887).
Problem / Motivation
Goal: On the Channels page, the @mentions a message was sent to and a preset's agent roles are joined the way the reader's language joins a list.
The page built both lists with a hard-coded
.join(', '). A German reader saw@Researcher, @Coder, @Reviewerinstead of@Researcher, @Coder und @Reviewer. A zh-CN reader saw an English comma-space instead of@Researcher、@Coder和@Reviewer. The New Channel dialog's preset roles had the same problem.Why it matters
Anyone who runs the dashboard in a language other than English sees these two lists in English punctuation. The rest of the page already follows the locale.
Not a goal
ChannelPage.tsxis in scope.i18nT, so a switch shows up on the next render, same as main.What changed (motivation → approach → change)
Symptom: two natural-language lists ignore the locale. Root cause: each one is joined with a literal
', '. Change: both now go throughfmtListfromwebsite/src/i18n/format.ts, which this page already imports and uses for the clear-context roster.fmtListwrapsIntl.ListFormat. English output gains its conjunction (@Researcher and @ghost), which is the same style as every otherfmtListlist in the app.Backwards compatibility
Compatible: display text only. No API, payload or stored value changes.
Removes nothing: the two lists render the same items, joined differently.
Tests
website/src/test/ChannelPage.listJoin.test.tsx(new): renders a three-agent mention and the built-in incident preset in en and zh-CN. It expects→ @Researcher, @Coder, and @ghost/→ @Researcher、@Coder和@ghostand(Orchestrator, Logs Agent, and Code Agent)/(Orchestrator、Logs Agent和Code Agent). On main, all four cases fail. With the fix, all four pass.website/src/test/ChannelPageCoverage.test.tsx: the two-item mention now expects→ @Researcher and @ghost.vitest run src/test/ChannelPage src/i18n: 79 files and 1325 tests pass.npm run typecheck, eslint on the changed files, andlint:i18nare clean.Proof: not provable -- frontend test
Manual verification
I built the SPA from main and from this branch, served it with
serveDist, stubbed/api/channels*, and read the rendered text with Playwright:The capture host has no CJK font, so zh-CN is shown as text above only.
Screenshots / video
Real built SPA, dark theme. The images live at commit 7bc37ac. The final commit drops them, so nothing lands on main.
New Channel dialog, preset roles:
Channel view, mention header (full page)
before, en:

after, en:

before, de:

after, de:

Related Issues
Fixes #31877
Sibling sweep
Swept: git grep -nE "join([\x27"], [\x27"])" -- website/src/pages/ChannelPage.tsx
Siblings: none -- no other comma join remains in ChannelPage.tsx; joins on other pages are outside this PR.
Pattern harvest
Not generalizable: a comma-space join is also correct for technical lists (paths, CSS values, payloads), so a blanket rule would misfire; the fmtList doc comment already names the distinction.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.