Skip to content

The agent that grows with you

fix(desktop): translate the gateway group reopen states and Retry

Teknium134d7a649449
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index cfb6311975c..526dde69f0c 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -2349,6 +2349,11 @@ export const en: Translations = {
importedBadge: 'imported map',
resetToMine: 'Back to my map'
},
+ gatewayGroupOpen: {
+ opening: 'Opening gateway group…',
+ lookupFailed: 'Could not look up this group on the gateway. Try again.',
+ missing: 'This gateway group no longer exists.'
+ },
agents: {
extendedTranscript: 'Extended transcript',
transcriptTruncated: 'Showing the latest 16 KiB',
diff --git a/apps/desktop/src/i18n/overlay-gaps.json b/apps/desktop/src/i18n/overlay-gaps.json
index 9d7b63769c2..7eb8de717d3 100644
--- a/apps/desktop/src/i18n/overlay-gaps.json
+++ b/apps/desktop/src/i18n/overlay-gaps.json
@@ -676,6 +676,9 @@
"freeTier.tryAgain": ["ar","ja","ru","zh-hant"],
"freeTier.unreachableBody": ["ar","ja","ru","zh","zh-hant"],
"freeTier.waiting": ["ar","ja","ru","zh-hant"],
+ "gatewayGroupOpen.lookupFailed": ["ar","de","es","fr","ja","ru","zh","zh-hant"],
+ "gatewayGroupOpen.missing": ["ar","de","es","fr","ja","ru","zh","zh-hant"],
+ "gatewayGroupOpen.opening": ["ar","de","es","fr","ja","ru","zh","zh-hant"],
"install.applyRemote": ["ar"],
"install.authNeedsOauth": ["ar"],
"install.authSignedIn": ["ar"],
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 0129d84c777..8a8de10104c 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -2107,6 +2107,12 @@ export interface Translations extends NoticeTranslations {
importedBadge: string
resetToMine: string
}
+ /** Bots: reopening a gateway group by name or restored tab key (#140805). */
+ gatewayGroupOpen: {
+ opening: string
+ lookupFailed: string
+ missing: string
+ }
agents: {
extendedTranscript: string
transcriptTruncated: string
diff --git a/apps/desktop/src/plugins/hermes-bots/canonical-group-reopen-by-name.test.tsx b/apps/desktop/src/plugins/hermes-bots/canonical-group-reopen-by-name.test.tsx
index 63e331e8599..7d42e51a613 100644
--- a/apps/desktop/src/plugins/hermes-bots/canonical-group-reopen-by-name.test.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/canonical-group-reopen-by-name.test.tsx
@@ -14,7 +14,9 @@ import { translateBots } from './i18n-test-helper'
// #140805: after a Desktop restart the in-memory room_id-keyed bindings are
// empty, so opening a group by NAME (roster row, restored tab) used to reach
// the gate whose only action minted a fresh room via groups.create.
-const { request, notify, openWorkspace } = vi.hoisted(() => ({ request: vi.fn(), notify: vi.fn(), openWorkspace: vi.fn() }))
+const { request, notify, openWorkspace, catalog } = vi.hoisted(() => ({
+ request: vi.fn(), notify: vi.fn(), openWorkspace: vi.fn(), catalog: { patch: null as null | ((t: Record<string, unknown>) => unknown) }
+}))
vi.mock('@hermes/plugin-sdk', async importOriginal => {
const sdk = await importOriginal<typeof HermesSdk>()
const { en } = await import('@/i18n/en')
@@ -33,7 +35,7 @@ vi.mock('@hermes/plugin-sdk', async importOriginal => {
gateway: sdk.atom('open')
}
},
- useI18n: () => ({ locale: 'en', t: en }),
+ useI18n: () => ({ locale: 'en', t: catalog.patch ? catalog.patch(en as unknown as Record<string, unknown>) : en }),
usePluginI18n: () => translateBots
}
})
@@ -53,6 +55,7 @@ const members = roster.map(m => ({ member_id: m.name, profile: m.name, handle: m
const original = { room_id: 'room-original', name: 'Team', members }
beforeEach(() => {
+ catalog.patch = null
state.connectionId.set('local')
state.profile.set('default')
state.gateway.set('open')
@@ -182,3 +185,23 @@ it('a late lookup from a superseded connection does not publish its room', async
expect(Object.values($canonicalGroupBindings.get()).some(binding => binding.connectionId === 'local')).toBe(false)
expect(screen.getByRole('button', { name: 'Start gateway group' })).toBeTruthy()
})
+
+it('renders the lookup states and Retry from the active catalog, not hardcoded English', async () => {
+ catalog.patch = t => ({
+ ...t,
+ common: { ...(t.common as object), retry: 'T:retry' },
+ gatewayGroupOpen: { opening: 'T:opening', lookupFailed: 'T:lookupFailed', missing: 'T:missing' }
+ })
+ let releaseList: (value: unknown) => void = () => undefined
+ let fail = true
+ gateway(() => fail ? Promise.reject(new Error('down')) : new Promise(resolve => { releaseList = resolve }))
+ await act(async () => { render(<GroupChatWorkspace group="canonical:local:default:gone" members={[]} />) })
+ expect(screen.getByText('T:lookupFailed')).toBeTruthy()
+
+ fail = false
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'T:retry' })) })
+ expect(screen.getByText('T:opening')).toBeTruthy()
+
+ await act(async () => { releaseList({ rooms: [], next_offset: null }) })
+ expect(screen.getByText('T:missing')).toBeTruthy()
+})
diff --git a/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx b/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx
index 5ad34d49a58..ddce2b25343 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx
@@ -593,6 +593,7 @@ export function GroupChatWorkspace(props: GroupChatWorkspaceProps) {
function GroupExecutionGate(props: GroupChatWorkspaceProps) {
const b = useBots()
+ const { t } = useI18n()
const connectionId = useValue(host.state.connectionId)
const profile = useValue(host.state.profile)
const gateway = useValue(host.state.gateway)
@@ -658,17 +659,17 @@ function GroupExecutionGate(props: GroupChatWorkspaceProps) {
const message = mode !== 'canonical'
? mode === 'unavailable' ? b.canonical.driverUnavailable : 'Checking group driver…'
- : lookupStatus === 'pending' ? 'Opening gateway group…'
- : lookupStatus === 'failed' ? 'Could not look up this group on the gateway. Try again.'
+ : lookupStatus === 'pending' ? t.gatewayGroupOpen.opening
+ : lookupStatus === 'failed' ? t.gatewayGroupOpen.lookupFailed
: canCreate ? 'This is a legacy Desktop room. Start a gateway-owned group with these members; the old history stays here and is not replayed.'
- : 'This gateway group no longer exists.'
+ : t.gatewayGroupOpen.missing
return <div className="grid gap-3 p-3">
<h2>{props.group}</h2>
<p>{message}</p>
{error && <p role="alert">{error}</p>}
{mode === 'canonical' && lookupStatus !== 'pending' && !canCreate &&
- <Button onClick={() => setLookupAttempt(value => value + 1)} variant="secondary">Retry</Button>}
+ <Button onClick={() => setLookupAttempt(value => value + 1)} variant="secondary">{t.common.retry}</Button>}
<Button disabled={!canCreate || busy} onClick={() => {
const route = { connectionId: connectionId ?? '', profile }