[建议 / Feature] 右侧面板支持打开/预览工作区文件(代码、图片、PDF 及 Office 办公文档),并为插件体系提供 UI 扩展点
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复提议 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
(相关但不重复:#495「增加快速代码预览」聚焦消息中 file:line 的点击跳转;本 issue 聚焦更完整的能力——右侧面板作为工作区文件浏览器/预览器,并覆盖 Office 等非代码格式。若团队认为二者应合并,我可以把本内容并入 #495。)
问题类别 · Category
UI / 界面体验 · UI / UX
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
使用场景 · Use case
日常使用中经常需要在会话过程中查看工作区里的文件:
- 代码/文本:agent 提到某个实现后,想点开看一眼上下文,目前只能切到外部编辑器;
- Office 办公文档:工作区里常有 .xlsx 报表、.docx 报告、.pptx 演示、.pdf 文档(agent 处理数据、生成报告的产物),生成后想立刻翻看排版效果,目前桌面端没有任何入口;
- 图片:agent 生成的图表、截图、设计稿,需要肉眼确认渲染效果。
现在右侧面板主要用于会话产物展示(diff、agent 产出卡片),没有通用的"打开/浏览工作区文件"能力,每个文件都要离开 ZCode 去别的应用。
建议方案 · Proposal
按成本递增,三档任选或分阶段做:
- 基础档(改动最小):右侧面板增加工作区文件树;点击代码/文本/图片文件在右侧预览(代码带行号,支持消息里
file:line引用联动定位,可顺势落地 #495 的诉求)。 - 进阶档:内置常见格式预览——PDF、图片、Markdown;对 Office 文档(.xlsx/.docx/.pptx)可先做"只读渲染预览"或至少提供"用系统默认程序打开"的右键动作。
- 生态档(请重点考虑):当前插件清单(plugin.json)只有
commands/skills/hooks/mcpServers/agents五类可执行组件,channels/lspServers/outputStyles/settings仅记录不执行——没有任何 UI 面板扩展点,社区想做"文件浏览器/Office 预览"插件也无从下手。建议为插件体系增加 UI 扩展点(如panels/views组件,声明后在右侧面板挂载自定义视图),生态即可长出 VS Code Office Viewer(cweijan.vscode-office,支持 xls/xlsx/docx/pptx/pdf/epub 等)那样的第三方预览插件,官方无需自己维护各格式解析器。
预期价值 · Expected value
- 不切换应用即可查看工作区任意文件,保持"对话 + 查看产物"在同一窗口闭环;
- Office 文档(报表、报告、演示)是数据处理/报告生成工作流的高频产物,现在"生成后看一眼"必须切走,体验断档;
- UI 扩展点一旦开放,整个插件生态可以补齐官方来不及做的预览格式,长期收益最大。
你认为的优先级 · Your perceived priority
中 · Medium
你使用的 ZCode 版本 / 环境 · ZCode version / environment
ZCode Desktop v3.10.2 · Windows 11 Pro x64 (build 26200) · GLM-5.3-Flash
补充材料 · Additional context
- 关联 issue:#495(快速代码预览 / 点击跳转)——若右侧面板支持文件预览,二者可一并解决。
- 参考实现:VS Code 的资源管理器 + Office Viewer 扩展(cweijan.vscode-office)证明了"编辑器内直接预览办公文件"是成熟且受欢迎的形态(Marketplace 140 万+ 安装)。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading related issue #495 and the plugin.json component list, then inspect the existing right-panel and plugin architecture. The proposal spans file browsing, multiple document previews, and UI extension points, so first establish which phase is in scope. Done should be defined as an agreed, testable subset with clear supported formats and extension behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop, developer-experience, frontend, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100