Skip to content

feat(chat): add delete action to dock file list rows - #309

Open
chujieHong wants to merge 1 commit into
TencentCloud:developfrom
chujieHong:feat/chat-dock-file-delete
Open

feat(chat): add delete action to dock file list rows#309
chujieHong wants to merge 1 commit into
TencentCloud:developfrom
chujieHong:feat/chat-dock-file-delete

Conversation

@chujieHong

Copy link
Copy Markdown
Contributor

Each file row in the chat dock "modified files" panel now has a delete button (Trash2 icon, danger hover) to the left of the download button, with a Popconfirm guard since deletion is irreversible.

  • Calls the existing DELETE /agents/{id}/workspace/file endpoint
  • Deleted paths are hidden via a canonical-key set (the list itself is message-derived and would otherwise keep showing them)
  • The file's open viewer tab is closed after deletion (same tab id function as openFileAt, so no mismatch)
  • 404 during delete treats the file as already gone and hides the row
  • Button styles shared with the download button; hover-reveal behavior extended to both actions

Summary

在专家聊天「已修改文件」面板的每行文件上,下载按钮左侧新增删除按钮(Trash2 图标、危险色 hover),点击弹 Popconfirm 二次确认后调用既有 DELETE /workspace/file 接口真实删除文件
删除后文件从列表消失(通过 canonical-key 集合过滤)、自动关闭该文件打开的查看器标签页;404 视为已删除并提示
改动 5 个前端文件:ChatDockFileList.tsx、ChatDockPanel.tsx、chatBrowserPanel.partial.less、中英文 locale

image

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

  • make all passes locally
  • Added/updated tests

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

Each file row in the chat dock "modified files" panel now has a delete
button (Trash2 icon, danger hover) to the left of the download button,
with a Popconfirm guard since deletion is irreversible.

- Calls the existing DELETE /agents/{id}/workspace/file endpoint
- Deleted paths are hidden via a canonical-key set (the list itself is
  message-derived and would otherwise keep showing them)
- The file's open viewer tab is closed after deletion (same tab id
  function as openFileAt, so no mismatch)
- 404 during delete treats the file as already gone and hides the row
- Button styles shared with the download button; hover-reveal behavior
  extended to both actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant