Skip to content

fix(bot-mode): roster menu and group row speak the active language (#91667, #108978, salvage #108979) - #113430

Merged
teknium1 merged 4 commits into
mainfrom
fix/bots-i18n-shell-inventory
Sep 17, 2026
Merged

teknium1 merged 4 commits into
mainfrom
fix/bots-i18n-shell-inventory

Conversation

@teknium1

@teknium1 teknium1 commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

The Bot Mode roster's right-click menu, its pin/hide toasts, the attention-badge tooltips and the group row's member count / availability now follow the desktop language (en · ja · zh · zh-hant) instead of staying English.

Changes

  • bot-row.tsx::GroupRow — empty-room preview and accessible name route through group.memberCount and the new group.availableCount(available, total) (salvaged from fix(desktop): localize the Bot Mode group row's member count and availability #108979).
  • bot-row.tsx::BotRow — Pin to top/Unpin, Hide/Unhide, Groups: …/Manage groups…, the pin/hide toasts, the metadata-load error toasts and the This device gateway label read from the plugin bundle (b.bot.*).
  • data.ts::botAttentionHint(reason) replaces the English-only BOT_ATTENTION_HINTS map; it reads botsText() at render so the roster badge tooltip follows the active locale.
  • i18n.ts — the new keys (incl. group.you) in all four bundles; i18n-test-helper.ts::translateBotsIn(locale) for tests that must tell a catalog string from an English literal.
  • apps/desktop/package.json → 0.17.4 (bundled-plugin change; About's shell version is the stale-shell tell for "still English" reports).
  • Tests: bot-row.test.tsx — group row under en/ja (contributor's), the context menu under zh asserting no English literal survives, and a zh room whose latest line is the reader's previews as 你: … while the log marker stays You; e2e/bot-mode-roster-localized.spec.ts drives the real Electron app with display.language: zh.

Validation

  • before (zh): menu items Pin to top / Hide / Manage groups… between translated neighbours; group row 2 bots, accessible name crew, 2 bots, 2 of 2 available.
  • after (zh): 置顶 / 隐藏 / 管理群聊…; group row 2 个机器人, accessible name crew, 2 个机器人, 2 个中 2 个可用.
  • Live repro: e2e/bot-mode-roster-localized.spec.ts — base (origin/main dist): 2 failed (menuitem "Pin to top", menuitem "Hide", menuitem "Manage groups…" in the zh menu) / head: 2 passed (1.1 min). Screenshots: /tmp/batchbots/i18n-shell-inventory/shots/head/bot-row-context-menu-zh.png, /tmp/batchbots/i18n-shell-inventory/shots/head/group-row-zh.png. Electron build: npm run build of this head in .worktrees/bots-i18n-shell-inventory.
  • vitest bot-row.test.tsx + i18n.test.ts: 12 passed; npm run check:lint (typecheck + eslint) exit 0.

Root cause: the bundle landed in a7db531, but the TSX row rebuild (5afa487) reintroduced these strings as literals beside the useBots() accessor it already held, and BOT_ATTENTION_HINTS was a module-level English map.

Fixes #108978
Fixes #91667
Part of #88798 (roster residuals; the New/Edit Bot dialog copy and the rotating intro copy are not in this PR)
Part of #91336 (right-click menus; the New Bot dialog + Advanced section remain hardcoded English)
Salvages #108979 (@vadimcomanescu) — cherry-picked with authorship preserved.
Supersedes the closed #92850 (@Georgefifth), whose plugin.js target no longer exists.

Review follow-up

  • Fixed: GroupRow preview (bot-row.tsx) and the group transcript's speaker display / clicked label (group-chat-view.tsx) rendered the reader as the English literal You under every locale. They now read group.you (You / あなた / 你 / 您) from all four bundles; 1 vitest added (red on the previous head, green now).
  • Not changed on purpose: group-chat-parts.tsx::appendGroupChatEntry(... name: 'You') and the member: 'You' / name: 'You' writes in group-rounds.ts are the PERSISTED author marker on log entries, compared by value in group-activity.ts::groupActivityLabel; translating it in place would rewrite stored logs and break the comparison. The i18n.ts header now states the write/render split. The activity-row verbs in group-activity.ts::GROUP_ACTIVITY_LABELS (replied, is working…) are still English — pre-existing, separate follow-up.

Infographic

bot-mode-roster-localized

vadimcomanescu and others added 3 commits September 16, 2026 13:19
…lability

The group row's empty-room preview and its aria-label spelled
`${members.length} bots` and `${available} of ${total} available` as
literals, so a reader on ja, zh or zh-hant saw English in a row whose
neighbours were translated. The bundle already carries `group.memberCount`
in all four locales (a7db531 moved it there) and `group-chat-view.tsx`
renders through it; the row's rebuild (5afa487) reintroduced the literal
next to the bundle accessor it already holds.

Route both through the bundle: the preview and the aria-label's count use
`group.memberCount`, and a new `group.availableCount(available, total)`
carries the availability sentence in all four locales, for the aria-label
and the tooltip that share it. `'You'` in the last-message preview stays a
literal on purpose: it is the persisted author sentinel the bundle header
describes.

Tests: `i18n-test-helper` gains `translateBotsIn(locale)`, since a case that
has to tell a catalog string from an English literal cannot do it under
`en`. The new group-row case renders the same row under `en` and `ja` and
reads the preview and the accessible name; it fails on the previous source.
The roster's right-click menu on a bot row still spelled `Pin to top` /
`Unpin`, `Hide` / `Unhide`, `Groups: …` / `Manage groups…`, the pin/hide
toasts, the metadata-load error toasts, the `This device` gateway label
and the attention-badge tooltips as English literals, so a zh/ja reader
saw English items inside an otherwise translated menu (#91667, residual of
#88798 / #91336 after the bundle landed in a7db531).

Route every one of them through the plugin bundle (`b.bot.*`, all four
locales) and turn `BOT_ATTENTION_HINTS` into `botAttentionHint(reason)`,
which reads `botsText()` at render so the tooltip follows the active
locale. No behaviour change; strings only.

Tests: bot-row.test.tsx renders the menu under `zh` and asserts the
catalog strings appear and no English literal survives (red on base).
e2e/bot-mode-roster-localized.spec.ts drives the real Electron app with
`display.language: zh`: right-click menu + a fresh group row (red on base,
green here).
Bundled-plugin change; the shell version tells About whether the running
binary carries it (stale-shell triage for "still English" reports).
@teknium1
teknium1 requested a review from a team September 16, 2026 20:20
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on d494e89 — fix(desktop): render the reader's own group lines in the act

⚠️ Action required

package-lock.json · View job

Locked npm dependency versions changed.

package-lock.json

Package Before After
apps/desktop 0.17.3 0.17.4

How to fix:

Add the ci-reviewed label after verifying the version changes are expected.


⚠️ Warnings

CI timings · View report · View job

Wall time 33m1s vs 6m (+450.3%). 9 job(s) slower, 2 faster, 2 unchanged.

  • OS-specific tests / Windows-only tests: -25.0s
  • Python tests / Run tests: +21.0s
  • JS & TS checks / JS & TS checks: -15.0s
  • OS-specific tests / macOS-only tests: +14.0s
  • Python lints / ruff enforcement (blocking): +7.0s

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) area/i18n Localization, locales, translations labels Sep 16, 2026
The GroupRow preview and the group transcript spelled the reader as the
English literal 'You' under every locale, so a zh roster read "You: …"
beside otherwise Chinese chrome. Add `group.you` to all four Bot Mode
bundles and use it at the three RENDER sites (bot-row preview,
group-chat-view speaker display and clicked label).

The persisted author marker written into the room log
(group-chat-parts.tsx, group-rounds.ts) stays the English sentinel:
group-activity.ts compares it by value, so translating it in place would
corrupt existing logs and break the comparison. The i18n.ts header now
documents that split.
teknium1 added a commit that referenced this pull request Sep 17, 2026
The dashboard lifespan started `_eager_reconcile_own_session_db` on a
daemon thread and never joined it. Under pytest each TestClient context
spawned one; the fresh tmp HERMES_HOME store makes every worker take the
bootstrap path, so on a slow CI runner ten of them were still queued on
`_session_db_bootstrap_lock` when the test's autouse leaked-DB sweep ran
`SessionDB.close()` on the connection the live worker was stepping in
`_open_probed` -> cross-thread `sqlite3_close` on an active statement ->
`Fatal Python error: Segmentation fault` after every test had passed
(PR #113430 run 35153362037, attempt 1; ~1/4 locally).

The worker is now a regular (non-daemon) thread that the lifespan
`finally` joins, so its connection is only ever closed by the thread that
opened it and it cannot outlive the server or the interpreter. Startup is
unchanged (the open still happens off the ready-probe path); the join is
bounded by SessionDB's write patience, so shutdown cannot hang on it.
@teknium1
teknium1 merged commit 4d46d76 into main Sep 17, 2026
55 of 57 checks passed
@teknium1
teknium1 deleted the fix/bots-i18n-shell-inventory branch September 17, 2026 00:13
teknium1 added a commit that referenced this pull request Sep 17, 2026
…made required

Two Bot Mode PRs merged minutes apart: #113430 added a GroupRow render in bot-row.test.tsx while #113414 made onNewSection a required GroupRowProps member. Each was green alone; together main's desktop typecheck fails with TS2741. One-line test fix, no runtime change.
OutThisLife added a commit that referenced this pull request Sep 23, 2026
Preserve the existing draft, routing, credential-sharing and avatar behavior. Extend the landed Bot Mode catalogs from #96726/#96878 and #113430; addresses the dialog report in #88798 by NealZhouPanda. Broader #90810 and #101305 remain independent.
OutThisLife added a commit that referenced this pull request Sep 23, 2026
Extend the existing Bot Mode catalogs, preserving schedule syntax, profile routes, capability IDs and user content. Cover locale switches through the real scheduling and editor components. Builds on the landed infrastructure by OutThisLife (#96726/#96878) and teknium1/Vadim Comanescu (#113430); report by NealZhouPanda (#88798). No wholesale supersede of #90810 or #101305.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Localization, locales, translations comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

3 participants