Skip to content

feat(workspace): add file tree preview panel#279

Open
musnows wants to merge 1 commit into
KunAgent:developfrom
musnows:codex/add-file-tree-panel
Open

feat(workspace): add file tree preview panel#279
musnows wants to merge 1 commit into
KunAgent:developfrom
musnows:codex/add-file-tree-panel

Conversation

@musnows

@musnows musnows commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a right-side workspace file tree opened from the top-right toolbar.
  • Add text file preview with multiple tabs, close buttons, source/render toggle for Markdown, raw HTML Markdown rendering, relative image loading, and unsupported-file fallback.
  • Add file/folder context menu actions for adding references, copying absolute/relative paths, and opening files in Finder/file manager.
  • Show referenced files on sent user messages so the visible prompt keeps its file context.
  • Keep the file tree panel title aligned with the active workspace folder name.

Validation

  • npm run typecheck
  • npm test -- src/renderer/src/components/chat/ChatFileTreePanel.test.ts src/renderer/src/lib/workspace-text-preview.test.ts src/renderer/src/components/chat/tests/WorkspaceModeTabs.test.ts src/main/services/workspace-service.test.ts
  • npm test -- src/renderer/src/agent/kun-runtime.test.ts src/renderer/src/agent/kun-mapper.test.ts src/renderer/src/components/chat/MessageTimeline.tool-summary.test.ts src/renderer/src/store/chat-store-thread-actions.test.ts
  • npm run build
  • npm run lint (passes with existing 9 react-hooks warnings)
  • npm run dist
  • Packaged macOS arm64 App smoke test: opened /tmp/kun-gui-file-tree-test/Kun.app, verified the file button is the rightmost topbar button, the side file tree opens, the title shows default_workspace, and files are listed.

中文说明

  • 在右上角工具栏增加文件树入口,并以右侧栏显示工作区文件树。
  • 支持文本文件多标签预览、关闭标签、Markdown 源码/渲染切换、Markdown 内 HTML 渲染、相对图片加载,以及非文本文件不支持预览提示。
  • 文件/文件夹右键菜单支持添加引用、复制绝对/相对路径、在 Finder/文件管理器中显示。
  • 发送后的用户消息会显示本次对话引用了哪些文件,避免只看到 prompt 而丢失上下文。
  • 文件树面板标题显示当前工作区目录名,不再固定显示“文件”。

Fixes #258

Issue: #258

Latest package for manual verification

  • Rebuilt package from commit 709176a with npm run dist.
  • Apple Silicon zip: dist/Kun-0.1.0-mac-arm64.zip
  • Apple Silicon app extracted for local testing: dist/Kun.app
  • Intel Mac zip: dist/Kun-0.1.0-mac-x64.zip
  • User smoke test reported no obvious issues after the latest file-reference display update.

最新手动验收包

  • 已基于 commit 709176a 重新执行 npm run dist 打包。
  • Apple Silicon zip:dist/Kun-0.1.0-mac-arm64.zip
  • 已解压可直接测试的 App:dist/Kun.app
  • Intel Mac zip:dist/Kun-0.1.0-mac-x64.zip
  • 用户已完成最新文件引用显示逻辑的手动冒烟测试,暂未发现明显问题。

@musnows musnows marked this pull request as ready for review June 14, 2026 00:03
@musnows musnows force-pushed the codex/add-file-tree-panel branch from 9b402bf to 709176a Compare June 14, 2026 00:22
@musnows

musnows commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator Author

新增文件树视图,能够看到文件,并添加到对话

image image

对话引用的文件支持显示(之前只会显示prompt,看不到引用的文件)

image

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