feat(canvas): 新增会话画布,作为右侧工作区 Tab 呈现 - #1971
Open
wafo210715 wants to merge 1 commit into
Open
Conversation
- 采用 JSON Canvas 开源格式(github.com/obsidianmd/jsoncanvas),与 Obsidian Canvas 互通 - CanvasView 自由画布:双击建节点、锚点拖连线、框选、成组、撤销重做、自动整理、缩放平移 - 通过右侧工作区加号菜单「打开画布」进入;作为普通可关闭 Tab,天然支持并排分屏 - 画布内容按会话持久化(session-canvas.canvas),组件内防抖自动保存 + 卸载/beforeunload 同步兜底 - 支持选中簇导出为独立 .canvas + .md 文件到 ~/.proma/canvas-exports/ Made-with: Proma
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能
为 Agent 会话新增自由画布(Canvas),以右侧工作区的普通 Tab 呈现:
<session-dir>/session-canvas.canvas,组件内防抖自动保存 + 卸载/beforeunload 同步兜底,带 loaded 守卫防止空内容覆盖磁盘.canvas+.md文件到~/.proma/canvas-exports/实现要点
WorkspaceComponentTab打开状态机制(per-session 持久化、关闭回退),key={sessionId}remount 避免跨会话状态残留effectiveActiveTab中 canvas 豁免workspaceSlug要求(会话画布不依赖项目根)CANVAS_IPC_CHANNELS(export/load-session/save-session/save-session-sync)→ main handlers → preload bridge → renderergetAgentSessionWorkspacePath,不引入新存储截图
个人使用场景
读文献、捋理论谱系的时候爱用
偶尔写游戏代码的时候也会用这个捋各个系统之间的沟通
可以截图给agent,也有助于边看思维导图边用语音描述给agent
测试
tsc --noEmit通过;bun test377 pass / 4 fail(4 个失败在未改动前的 upstream/main 基线上同样存在,与本 PR 无关)vite build/ preload / main esbuild 通过Made with Proma · GitHub