chore(chat): simplify composer gateway status and toolbar agent label (#1225)

This commit is contained in:
paisley
2026-08-05 17:16:45 +08:00
committed by GitHub
parent 3f2cd9345f
commit 1875dac040
7 changed files with 14 additions and 16 deletions
+2 -2
View File
@@ -14,7 +14,7 @@
"scrollToLatest": "Back to bottom",
"toolbar": {
"refresh": "Refresh chat",
"currentAgent": "Talking to {{agent}}",
"currentAgent": "{{agent}}",
"workspace": "Workspace"
},
"generatedFiles": {
@@ -227,7 +227,7 @@
"thinking": "Thinking…",
"gatewayConnected": "connected",
"gatewayStarting": "starting",
"gatewayStatus": "gateway {{state}} | port: {{port}} | pid: {{pid}}",
"gatewayStatus": "gateway {{state}}",
"retryFailedAttachments": "Retry failed attachments",
"workspacePrefix": "{{workspace}}",
"workspacePickerTitle": "Select workspace folder",
+2 -2
View File
@@ -14,7 +14,7 @@
"scrollToLatest": "最下部に戻る",
"toolbar": {
"refresh": "チャットを更新",
"currentAgent": "現在の会話相手: {{agent}}",
"currentAgent": "{{agent}}",
"workspace": "ワークスペース"
},
"generatedFiles": {
@@ -227,7 +227,7 @@
"thinking": "考え中…",
"gatewayConnected": "接続済み",
"gatewayStarting": "起動中",
"gatewayStatus": "ゲートウェイ {{state}} | ポート: {{port}} | PID: {{pid}}",
"gatewayStatus": "ゲートウェイ {{state}}",
"retryFailedAttachments": "失敗した添付を再試行",
"workspacePrefix": "{{workspace}}",
"workspacePickerTitle": "ワークスペースフォルダーを選択",
+2 -2
View File
@@ -14,7 +14,7 @@
"scrollToLatest": "Вернуться вниз",
"toolbar": {
"refresh": "Обновить чат",
"currentAgent": "Общение с {{agent}}",
"currentAgent": "{{agent}}",
"workspace": "Рабочая область"
},
"generatedFiles": {
@@ -227,7 +227,7 @@
"thinking": "Думаю…",
"gatewayConnected": "подключён",
"gatewayStarting": "запуск",
"gatewayStatus": "шлюз {{state}} | порт: {{port}} | PID: {{pid}}",
"gatewayStatus": "шлюз {{state}}",
"retryFailedAttachments": "Повторить неудавшиеся вложения",
"workspacePrefix": "{{workspace}}",
"workspacePickerTitle": "Выберите папку рабочей области",
+2 -2
View File
@@ -14,7 +14,7 @@
"scrollToLatest": "回到底部",
"toolbar": {
"refresh": "刷新聊天",
"currentAgent": "当前对话对象:{{agent}}",
"currentAgent": "{{agent}}",
"workspace": "工作空间"
},
"generatedFiles": {
@@ -227,7 +227,7 @@
"thinking": "思考中…",
"gatewayConnected": "已连接",
"gatewayStarting": "启动中",
"gatewayStatus": "网关{{state}} 端口:{{port}} 进程 ID{{pid}}",
"gatewayStatus": "网关{{state}}",
"retryFailedAttachments": "重试失败的附件",
"workspacePrefix": "{{workspace}}",
"workspacePickerTitle": "选择工作空间文件夹",
-2
View File
@@ -1307,8 +1307,6 @@ export function ChatInput({
: gatewayStatus.state === 'running'
? t('composer.gatewayStarting')
: gatewayStatus.state,
port: gatewayStatus.port,
pid: gatewayStatus.pid ?? '',
})}
</span>
{chatComposerStatusComponents.map((Component, index) => (
+4 -4
View File
@@ -119,7 +119,7 @@ function translate(key: string, vars?: Record<string, unknown>): string {
case 'composer.gatewayStarting':
return 'starting';
case 'composer.gatewayStatus':
return `gateway ${String(vars?.state ?? '')} | port: ${String(vars?.port ?? '')} ${String(vars?.pid ?? '')}`.trim();
return `gateway ${String(vars?.state ?? '')}`;
case 'composer.retryFailedAttachments':
return 'Retry failed attachments';
case 'composer.workspacePrefix':
@@ -347,7 +347,7 @@ describe('ChatInput agent targeting', () => {
);
const workspaceSelector = screen.getByTestId('chat-workspace-selector');
const gatewayStatus = screen.getByText(/gateway connected \| port: 18789/i);
const gatewayStatus = screen.getByText(/gateway connected/i);
expect(workspaceSelector.compareDocumentPosition(gatewayStatus) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
});
@@ -693,7 +693,7 @@ describe('ChatInput agent targeting', () => {
fireEvent.keyDown(searchInput, { key: 'Escape' });
expect(screen.queryByPlaceholderText('Search skills')).not.toBeInTheDocument();
expect(await screen.findByText('gateway connected | port: 18789')).toBeInTheDocument();
expect(await screen.findByText('gateway connected')).toBeInTheDocument();
});
it('read-only workspace selector does not open the native picker', () => {
@@ -982,7 +982,7 @@ describe('ChatInput agent targeting', () => {
renderChatInput();
expect(screen.getByText(/gateway starting \| port: 18789/i)).toBeInTheDocument();
expect(screen.getByText(/gateway starting/i)).toBeInTheDocument();
});
it('renders the skill trigger after the @ agent picker', () => {
+2 -2
View File
@@ -29,7 +29,7 @@ vi.mock('@/stores/chat', () => ({
vi.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string) => ({
'toolbar.currentAgent': 'Talking to Main',
'toolbar.currentAgent': 'Main',
'toolbar.refresh': 'Refresh',
'toolbar.workspace': 'Workspace',
'questionDirectory.title': 'Question directory',
@@ -55,6 +55,6 @@ describe('ChatToolbar', () => {
renderToolbar();
expect(screen.queryByRole('button', { name: 'Refresh' })).not.toBeInTheDocument();
expect(screen.getByText('Talking to Main')).toBeInTheDocument();
expect(screen.getByText('Main')).toBeInTheDocument();
});
});