Repository navigation
fix(wework): prevent horizontal conversation drift #2109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
5992bf0
fe6397a
387ad07
3af7cc9
471a2a9
73d5bc8
2eca1a8
1d8e6b7
73f39d1
a0c9238
7a6c03f
efb72e4
9ba39ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,14 +13,22 @@ import type { GuidanceWorkbenchMessage, QueuedWorkbenchMessage } from '@/types/w | |
|
|
||
| vi.mock('@/hooks/useTranslation', () => ({ | ||
| useTranslation: () => ({ | ||
| t: (key: string, options?: string | { action?: string; count?: number; device?: string }) => { | ||
| t: ( | ||
| key: string, | ||
| options?: string | { action?: string; count?: number; device?: string; location?: string } | ||
| ) => { | ||
| if (typeof options === 'string') return options | ||
| if (key === 'workbench.code_comment_count') { | ||
| return `${options?.count ?? 0} 个评论` | ||
| } | ||
| if (key === 'workbench.project_work_trigger_device_aria') { | ||
| return `${options?.action ?? ''},当前设备 ${options?.device ?? ''}` | ||
| } | ||
| if (key === 'workbench.composer_execution_device_label') { | ||
| return `运行于${options?.location ?? ''} · ${options?.device ?? ''}` | ||
| } | ||
| if (key === 'workbench.environment_cloud_device') return '云设备' | ||
| if (key === 'workbench.environment_local') return '本机' | ||
| if (key === 'workbench.remove_code_comments') { | ||
| return '移除代码评论' | ||
| } | ||
|
|
@@ -3275,6 +3283,81 @@ describe('ChatInput', () => { | |
| ).not.toBeInTheDocument() | ||
| }) | ||
|
|
||
| test('shows a subtle cloud-device control and opens device selection for a new task', async () => { | ||
| const devices: DeviceInfo[] = [ | ||
| { | ||
| id: 1, | ||
| device_id: 'cloud-online', | ||
| name: 'Cloud Online', | ||
| status: 'online', | ||
| is_default: false, | ||
| device_type: 'cloud', | ||
| }, | ||
| ] | ||
|
|
||
| render( | ||
| <ChatInput | ||
| value="" | ||
| onChange={vi.fn()} | ||
| onSubmit={vi.fn()} | ||
| disabled={false} | ||
| variant="desktop" | ||
| projectWork={projectWorkControls({ | ||
| devices, | ||
| currentStandaloneDeviceId: 'cloud-online', | ||
| })} | ||
| /> | ||
| ) | ||
|
|
||
| const deviceButton = screen.getByTestId('composer-execution-device-button') | ||
| expect(deviceButton).toHaveAccessibleName('运行于云设备 · Cloud Online') | ||
| expect(deviceButton).toBeEnabled() | ||
|
|
||
| await userEvent.click(deviceButton) | ||
| expect(screen.getByTestId('project-work-menu')).toBeInTheDocument() | ||
| }) | ||
|
|
||
| test('shows the actual runtime device without allowing an active task to switch it', () => { | ||
| const devices: DeviceInfo[] = [ | ||
| { | ||
| id: 1, | ||
| device_id: 'local-online', | ||
| name: 'Local Online', | ||
| status: 'online', | ||
| is_default: false, | ||
| device_type: 'local', | ||
| }, | ||
| { | ||
| id: 2, | ||
| device_id: 'cloud-online', | ||
| name: 'Cloud Online', | ||
| status: 'online', | ||
| is_default: false, | ||
| device_type: 'cloud', | ||
| }, | ||
| ] | ||
|
|
||
| render( | ||
| <ChatInput | ||
| value="" | ||
| onChange={vi.fn()} | ||
| onSubmit={vi.fn()} | ||
| disabled={false} | ||
| variant="desktop" | ||
| showProjectWorkBar={false} | ||
| projectWork={projectWorkControls({ | ||
| devices, | ||
| currentStandaloneDeviceId: 'local-online', | ||
| currentRuntimeDeviceId: 'cloud-online', | ||
| })} | ||
| /> | ||
| ) | ||
|
|
||
| const deviceButton = screen.getByTestId('composer-execution-device-button') | ||
| expect(deviceButton).toHaveAccessibleName('运行于云设备 · Cloud Online') | ||
| expect(deviceButton).toHaveAttribute('aria-disabled', 'true') | ||
| }) | ||
|
Comment on lines
+3286
to
+3359
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift Add real-Tauri execution-device launch coverage. These tests only verify the control and menu. Add a real-backend E2E that selects local/cloud execution, launches a task, verifies the runtime target, then verifies switching is blocked while active. Include failure/recovery and cleanup evidence in the QA plan. 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| test('uses the project work action as the standalone trigger accessible name', () => { | ||
| const devices: DeviceInfo[] = [ | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Restrict timestamp repair to terminal tasks.
running == falseis not sufficient: this file also creates/restores non-terminal tasks withstatus = "active"andrunning = false(Lines 1576-1577 and 3763-3765). Since this helper runs during transcript reads (Line 1330), it can persistcompleted_aton an idle active task and leave stale completion data when the task is later resumed. Gate the repair on a terminal status or an explicit legacy marker, and add an active-task regression test.🤖 Prompt for AI Agents