Conversation
- 在设置中添加两个开关:autoPullOnOpen 和 autoPullOnSwitch,默认关闭 - 切换文件时根据 autoPullOnSwitch 配置决定是否自动拉取 - 拉取时禁用编辑器并显示 loading 状态 - 修复可能导致的编辑内容被覆盖的问题 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 检测到更新时立即显示 loading 状态 - 保持原有逻辑不变 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 在 isPulling 时传递 editable={false} 给编辑器组件
- 编辑器在拉取远程文件时会被禁用
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 当 isPulling 为 true 时,优先显示拉取遮罩而不是编辑器 - 确保在从远程拉取文件时禁用编辑器 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 修复 bug:点击文件时没有调用 readArticle,导致远程文件不会被自动拉取 - 在 setActiveFilePath 中调用 readArticle,触发读取本地+远程拉取流程 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 当 isPulling 为 true 时隐藏 Outline 组件,避免访问未加载的编辑器 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 添加 isEditorReady 状态跟踪编辑器初始化 - 只有在编辑器准备好后才显示 Outline,避免访问未初始化的编辑器 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 在 Outline 组件中添加 editor.view.dom 检查 - 确保编辑器完全初始化后再访问相关属性 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 添加 100ms 延迟后再显示 Outline 组件 - 确保编辑器完全挂载后再渲染 Outline Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 在访问 editor.view.dom 前检查编辑器是否完全初始化 - 避免在编辑器未准备好时访问导致错误 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 当 filePath 变化时,清除旧的编辑器实例 - 确保 Outline 组件不会引用已失效的编辑器 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 在 Outline 组件中添加 isEditorReadyRef 来跟踪编辑器就绪状态 - 使用轮询方式检测 editor.view.dom 是否可用 - 添加 key 属性确保组件正确重新挂载 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 移除 early return,避免 React Hooks 规则错误 - Outline 内部使用 isEditorReadyRef 来跟踪编辑器状态 - md-editor-wrapper 简化逻辑 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 添加 editorReady 状态跟踪编辑器的 onEditorReady 回调 - 只有当 onEditorReady 被调用后才显示 Outline - 文件切换时重置 editorReady 状态 这修复了远程文件拉取后 Outline 报错的问题。 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 在访问 editor.view.dom 前添加检查 - 避免编辑器未准备好时访问导致错误 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 点击远程文件时,先设置 currentArticle 为空,让编辑器先渲染出来 - 然后再异步拉取远程内容 - 这样确保编辑器完全准备好后再处理远程内容 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 使用 isEditorReadyRef 来跟踪编辑器是否准备好 - 使用 getBoundingClientRect() 来检测 DOM 是否真正挂载 - 检查 editor.isDestroyed 避免访问已销毁的编辑器 这修复了第二次点击远程文件时报错的问题。 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- 大纲组件只在用户点击打开时才渲染(outlineOpen && editorReady) - 添加 editorReady 状态确保编辑器完全准备好 - 这修复了第二次点击远程文件时的报错问题 Co-Authored-By: Claude Opus 4.6 <[email protected]>
在 pullFile 方法中,从远程 API 获取的文件内容是 base64 编码的, 直接保存会导致本地文件存储的是编码后的字符串而不是解码后的 Markdown 内容。修复:在保存前先解码 base64 内容。 Co-Authored-By: Claude Opus 4.6 <[email protected]>
在 pullFile 方法中,拉取文件后没有更新本地记录的远程 SHA, 导致下次比较时仍然认为远程文件有更新。修复:拉取成功后 获取远程 SHA 并更新本地记录。 Co-Authored-By: Claude Opus 4.6 <[email protected]>
在 executePull 函数中,拉取远程文件后没有更新本地记录的 远程 SHA,导致下次比较时仍然认为远程文件有更新。修复: 拉取成功后获取远程 SHA 并更新本地记录。 Co-Authored-By: Claude Opus 4.6 <[email protected]>
1. 修复 Gitee API 上传后返回 SHA 错误的问题 - Gitee API 返回的是 result.data.content.sha,之前错误地使用了 result.data.sha 2. 修复 SHA 匹配后仍误报更新的问题 - 当 SHA 匹配时直接返回 action: 'none',不再继续比较时间 3. 修复推送时本地与远程内容相同但未更新 SHA 的问题 - 当检测到本地和远程内容相同时跳过推送,并更新 SHA 4. 修复文件切换后首次检测被跳过的问题 - 文件切换时重置最后输入时间,让首次检测立即执行 Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
No description provided.