feat(ChatPage): update confirmation dialog text and selectors for editing user messages

This commit is contained in:
hy committed 2026-09-18 10:54:22 +08:00
1 parent 631796177d
commit 6057f4e81b
4 files changed
+13 -7

No files matched your search

+1 -1
View File
@@ -192,7 +192,7 @@
#### WB-SESSION-006 用户消息复制与编辑
- 系统行为:用户消息支持复制纯文本;没有任务运行时,最新一条用户消息支持编辑。点击编辑须先确认:确认框标题为「编辑这条消息?」,正文说明将撤回该消息之后的回答、原文回到输入框,且已编辑的文件不会被还原;确认后才撤回该 `runId` 的消息、run 与全部 message log,并把原文字、参考资料和附件恢复到输入区,等待用户修改后重新发送。取消确认则不撤回。已编辑的真实文件和 `ai_file_change` 不回滚。
- 系统行为:用户消息支持复制纯文本;没有任务运行时,最新一条用户消息支持编辑。点击编辑须先确认:确认框标题为「编辑这条消息?」,正文说明将撤回该消息之后的回答、原文回到输入框,且已编辑的文件不会被还原;主按钮为「确定」(危险态)。确认后才撤回该 `runId` 的消息、run 与全部 message log,并把原文字、参考资料和附件恢复到输入区,等待用户修改后重新发送。取消确认则不撤回。已编辑的真实文件和 `ai_file_change` 不回滚。
- 验收:
- `WB-SESSION-006-AC1` 复制操作写入消息的可读文本,并给出成功或失败反馈。
- `WB-SESSION-006-AC2` 只有最新用户消息且当前没有运行中任务时显示编辑入口。
+3 -3
View File
@@ -4002,14 +4002,14 @@ const ChatPage: React.FC = () => {
modal.confirm({
title: '编辑这条消息?',
content: '将撤回这条消息之后的回答,原文会回到输入框供你修改。已编辑的文件不会被还原。',
okText: '编辑',
okText: '确定',
okButtonProps: {
danger: true,
'data-testid': workbenchSelectors.userMessageEditConfirmButton
'data-testid': workbenchSelectors.editMessageConfirmButton
},
cancelText: '取消',
cancelButtonProps: {
'data-testid': workbenchSelectors.userMessageEditConfirmCancelButton
'data-testid': workbenchSelectors.editMessageConfirmCancelButton
},
onOk: async () => {
if (!currentPartnerId || aiRunId || messageItem.id !== latestUserMessageId) return
+2 -2
View File
@@ -204,8 +204,8 @@ export const workbenchSelectors = {
userMessageActionsPrefix: 'workbench-user-message-actions',
userMessageCopyButtonPrefix: 'workbench-user-message-copy-button',
userMessageEditButtonPrefix: 'workbench-user-message-edit-button',
userMessageEditConfirmButton: 'workbench-user-message-edit-confirm-button',
userMessageEditConfirmCancelButton: 'workbench-user-message-edit-confirm-cancel-button',
editMessageConfirmButton: 'workbench-edit-message-confirm-button',
editMessageConfirmCancelButton: 'workbench-edit-message-confirm-cancel-button',
userMessageAttachmentPrefix: 'workbench-user-message-attachment',
userMessageReferences: 'workbench-user-message-references',
contentPanel: 'workbench-content-panel',
@@ -248,7 +248,13 @@ describe('workbench conversation e2e', () => {
await copyButton.click()
await waitForAntMessageText(page, '已复制')
await editButton.click()
await getWorkbenchLocator(page, workbenchSelectors.userMessageEditConfirmButton).click()
const editConfirmButton = getWorkbenchLocator(
page,
workbenchSelectors.editMessageConfirmButton
)
await editConfirmButton.waitFor({ state: 'visible' })
await editConfirmButton.click()
await page.locator('.ant-modal-confirm').waitFor({ state: 'hidden' })
await page.waitForFunction(
(input: { testId: string; expected: string }) => {
const element = document.querySelector(`[data-testid="${input.testId}"]`)