From 55c6bad295afa524e3fc740a63d609dc7abaa3a7 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 21 Oct 2026 22:28:34 +0200 Subject: [PATCH] fix(assistant): readable cards for any tool, and the CI round - A card for a tool without one of its own names what it works on: the place of an assignment, the day, the note, the booking; its arguments sit under the labels the other cards use, a new order reads as the names in order. 28 frequent tools carry their own action name in every language. - The server's own steps without a card still refuse, as before. - Tests: the rate limit is asked one request after another, the mention list closes on the caret move a browser reports, the place factory hands its category over as a plain id, eleven files formatted. --- .../Admin/addons/useAiAdminConfig.ts | 5 +- .../Assistant/AssistantChangeCard.tsx | 9 +- .../Assistant/AssistantComposer.test.tsx | 2 + .../Assistant/AssistantError.test.tsx | 9 +- .../components/Assistant/AssistantHints.tsx | 2 +- .../Assistant/AssistantLauncher.tsx | 9 +- .../Assistant/AssistantMentionText.tsx | 9 +- .../Assistant/assistantMentionModel.ts | 4 +- .../components/Assistant/assistantParts.ts | 1 + .../components/Assistant/assistantShare.ts | 5 +- .../components/Assistant/useChangeHover.ts | 4 +- .../components/Settings/ai/AiConnectPanel.tsx | 4 +- .../Settings/ai/useAiConnect.test.ts | 2 +- client/src/store/assistantMapModel.test.ts | 4 +- .../assistant/tool-call-generic.helpers.ts | 179 ++++++++++++++---- .../assistant/tool-call-preview.helpers.ts | 2 + server/tests/e2e/assistant.e2e.test.ts | 17 +- server/tests/helpers/factories/places.ts | 4 +- .../tool-call-preview.helpers.test.ts | 39 ++-- shared/src/assistant/assistant.schema.ts | 2 + shared/src/i18n/ar/assistant.ts | 29 +++ shared/src/i18n/az/assistant.ts | 29 +++ shared/src/i18n/br/assistant.ts | 29 +++ shared/src/i18n/ca/assistant.ts | 29 +++ shared/src/i18n/cs/assistant.ts | 29 +++ shared/src/i18n/de/assistant.ts | 29 +++ shared/src/i18n/en/assistant.ts | 29 +++ shared/src/i18n/es/assistant.ts | 29 +++ shared/src/i18n/et/assistant.ts | 29 +++ shared/src/i18n/fr/assistant.ts | 29 +++ shared/src/i18n/gr/assistant.ts | 29 +++ shared/src/i18n/hu/assistant.ts | 29 +++ shared/src/i18n/id/assistant.ts | 29 +++ shared/src/i18n/it/assistant.ts | 29 +++ shared/src/i18n/ja/assistant.ts | 29 +++ shared/src/i18n/ko/assistant.ts | 29 +++ shared/src/i18n/nl/assistant.ts | 29 +++ shared/src/i18n/pl/assistant.ts | 29 +++ shared/src/i18n/ru/assistant.ts | 29 +++ shared/src/i18n/sk/assistant.ts | 29 +++ shared/src/i18n/sv/assistant.ts | 29 +++ shared/src/i18n/th/assistant.ts | 29 +++ shared/src/i18n/tr/assistant.ts | 29 +++ shared/src/i18n/uk/assistant.ts | 29 +++ shared/src/i18n/vi/assistant.ts | 29 +++ shared/src/i18n/zh-TW/assistant.ts | 29 +++ shared/src/i18n/zh/assistant.ts | 29 +++ 47 files changed, 1019 insertions(+), 76 deletions(-) diff --git a/client/src/components/Admin/addons/useAiAdminConfig.ts b/client/src/components/Admin/addons/useAiAdminConfig.ts index 2fa2bd6d2..73fb93bcb 100644 --- a/client/src/components/Admin/addons/useAiAdminConfig.ts +++ b/client/src/components/Admin/addons/useAiAdminConfig.ts @@ -152,7 +152,10 @@ function useInstanceConnection(onChanged: () => void) { live, provider, models: live - ? modelOptions(models, live.model, { free: t('assistant.model.free'), recommended: t('assistant.model.recommended') }) + ? modelOptions(models, live.model, { + free: t('assistant.model.free'), + recommended: t('assistant.model.recommended'), + }) : [], busy, setModel, diff --git a/client/src/components/Assistant/AssistantChangeCard.tsx b/client/src/components/Assistant/AssistantChangeCard.tsx index 7812c3e09..e255d34e5 100644 --- a/client/src/components/Assistant/AssistantChangeCard.tsx +++ b/client/src/components/Assistant/AssistantChangeCard.tsx @@ -125,13 +125,20 @@ function KindTile({ } /** The verb as a quiet line over the name of what it touches. */ +/** What the change does: the tool's own action where TREK names it, else add, change or remove. */ +function verbLabel(preview: AssistantChangePreview, t: (key: string) => string): string { + const own = preview.tool ? `assistant.tool.${preview.tool}` : null; + const named = own ? t(own) : null; + return named && named !== own ? named : t(`assistant.change.verb.${preview.verbKey}`); +} + function ChangeHead({ preview, struck = false }: { preview: AssistantChangePreview | null; struck?: boolean }) { const { t } = useTranslation(); if (!preview) return